Documentation
A URL, a key, and a client.
OpenAI-compatible /v1 API at https://infer.industrialdata.ca/v1. Create an account, fund a prepaid balance, create an ide_sk_ key, and point any OpenAI client at that base URL. Prompts and completions are not stored.
Quickstart
Four steps from nothing to a first completion. The request builder below only writes code and sends nothing. The Sandbox sends a request when you press Run.
- Create an account at /signup. Enter your email and open the sign-in link we send you, or choose Sign in with IDE. There is no password.
- Fund your prepaid balance at /billing. Top-ups go through Stripe Checkout, and Enter promo code there takes you to /promo-enter to redeem a promo code. Requests are refused with
402once the balance runs out. - Create an API key at /account. The full
ide_sk_…secret is shown once. Copy it before you leave the page. - Send a request to
https://infer.industrialdata.ca/v1/chat/completionswith that key as a bearer token.
- Base URL
https://infer.industrialdata.ca/v1. It already includes/v1. Do not append another.- $INFER_API_KEY
- Your key,
ide_sk_<12 hex>_<32 hex>. Treat it as a password. Do not commit it or ship it in a frontend bundle. - model
- An exact
idfrom GET /v1/models, such asqwen3.6-35b-a3b. Family names such as “Qwen” are not request IDs.
curl https://infer.industrialdata.ca/v1/chat/completions \
-H "Authorization: Bearer $INFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-35b-a3b",
"messages": [{"role": "user", "content": "Explain bounded retries."}]
}'
Request builder · python uses pip install openai, typescript uses npm install openai
Authentication
Every inference request carries your key as a bearer token. GET /v1/models is public and needs no key.
- Send
Authorization: Bearer ide_sk_<id>_<secret>onPOST /v1/chat/completionsand the otherPOSTroutes.X-Api-Key: ide_sk_…is accepted as well. - A missing, malformed, unknown, or revoked key is
401with codeinvalid_api_key. Retrying will not help. - Clients that read OpenAI environment variables work unchanged: set
OPENAI_BASE_URLto the base URL andOPENAI_API_KEYto your key. - CORS is open (
Access-Control-Allow-Origin: *), but a key in browser code is a published key. Call the API from a server you control.
export INFER_API_KEY="ide_sk_…" # from /account, shown once
export OPENAI_BASE_URL="https://infer.industrialdata.ca/v1"
export OPENAI_API_KEY="$INFER_API_KEY"
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}
API keys
Keys belong to your account and draw on its prepaid balance. Manage them at /account.
- Create
- Sign in at /account, give the key a label (
defaultif you leave it), tick at least one of the three boxes below, and create it. All three start off, and a key with none is refused. The page shows the full secret once. Only its SHA-256 hash is stored, so a lost key cannot be shown again. Create a new one and revoke the old one. - Local LAN
- Call your Cores directly on the local network.
- Internet: any Core
- Call
https://infer.industrialdata.ca/v1using the general network pool. - Internet: my Cores
- Call
https://infer.industrialdata.ca/v1routed to your own Cores (see Your Cores). With only this box, calls never use the pool. With both Internet boxes, your Cores go first and then the pool, unless the call asks for your Cores only. - Change
- Change the boxes on a key at /account and select Save, or send
PATCH /account/keys/<key id>with any ofallow_local,allow_external, andlocal_useas JSON booleans. The secret stays the same. - Format
ide_sk_, a 12-hex-character key id,_, and a 32-hex-character secret. The account page lists the key id. The secret is shown once and is not shown again.- Activation
- A key is active as soon as it is created. The API loads keys from a signed registry that it refreshes every 30 seconds, so a brand-new key can get
401for up to about 30 seconds. - Revoke
- Press Revoke next to the key at /account. The next request with that key to
https://infer.industrialdata.ca/v1is refused with401 invalid_api_key. A Core's local address remembers a key it has allowed for up to 2 days (never past the end of your Sign in with IDE), so a revoked key can keep working there until then. Revoking cannot be undone.
Sandbox
Pick an example, change its fields, and press Run to try it here, or copy the request as curl, Python, or TypeScript. The code is the POST /v1/chat/completions call you send with your own key.
Runs use a shared sandbox key on our side, so no account is needed. If you have a key, you can paste it below to run on your own account instead. Replies are capped at 512 tokens. Do not send anything private. Prompts and images are not stored.
Leave it empty to use the sandbox key. Your key stays in this tab's memory and is sent only to this site's API; it is not stored and is gone when you reload. Prefer a key made for testing, and revoke it at /account when you are done.
curl https://infer.industrialdata.ca/v1/chat/completions \
-H "Authorization: Bearer $INFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-35b-a3b",
"messages": [{"role": "user", "content": "Explain bounded retries."}],
"max_tokens": 256,
"reasoning": {"enabled": false}
}'
Run needs JavaScript. You can copy the code and run it with your own key.
A run is in progress in the other tab.
Run calls this site's sandbox with our key; the code above is the call you make with yours.
{
"id": "chatcmpl-…",
"object": "chat.completion",
"created": 1795795200,
"model": "qwen3.6-35b-a3b",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "Bounded retries cap how many times a client repeats a failed call…"},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 182,
"total_tokens": 196,
"completion_tokens_details": {"reasoning_tokens": 0}
}
}
An example reply. Press Run for a live one.
usage
Raw JSON
data: URIs (PNG, JPEG, or WebP). The code below reads image.png from disk.PNG, JPEG, or WebP up to 10 MB. Your browser shrinks it to 1,024 px on the long side and re-encodes it as JPEG, which drops camera metadata such as GPS. Nothing is uploaded until you press Run.
IMAGE_URL="data:image/png;base64,$(base64 < image.png | tr -d '\n')"
printf '%s' '{
"model": "qwen3.6-35b-a3b",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "'"$IMAGE_URL"'"}}
]
}
],
"max_tokens": 256,
"reasoning": {"enabled": false}
}' | curl https://infer.industrialdata.ca/v1/chat/completions \
-H "Authorization: Bearer $INFER_API_KEY" \
-H "Content-Type: application/json" \
-d @-
Run needs JavaScript. You can copy the code and run it with your own key.
A run is in progress in the other tab.
Run calls this site's sandbox with our key; the code above is the call you make with yours.
{
"id": "chatcmpl-…",
"object": "chat.completion",
"created": 1795795200,
"model": "qwen3.6-35b-a3b",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "A red circle, a blue square, and a green triangle on a light grey background."},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 282,
"completion_tokens": 21,
"total_tokens": 303,
"completion_tokens_details": {"reasoning_tokens": 0}
}
}
An example reply. Image tokens count as prompt tokens. Press Run for a live one.
usage
Raw JSON
Models
GET /v1/models is the live list of what is served. Make it the first request from a new network: if it fails, chat will fail too.
- Send
data[].idasmodel, exactly as listed. Models withis_ready: falsehave no healthy capacity right now. - The response is
{"data": [...]}, one provider model document per model (schema_version2.4) with context limits, input modalities, prices, and supported parameters. It is not the OpenAI model object: there is noobjectorowned_by. GETandHEADare supported, with anETagandCache-Control: public, max-age=30. A request that sends a key orX-Ide-Own-Coresis answered for that caller withCache-Control: private, no-store.GET /v1/models/{id}is not served.- With your key and
X-Ide-Own-Cores: only, the list holds only the models your own Cores are serving now. See Your Cores.
curl -s https://infer.industrialdata.ca/v1/models \
| jq -r '.data[] | select(.is_ready) | .id'
| Model | Context | Max output | Modalities | Input / 1M | Cached / 1M | Output / 1M |
|---|---|---|---|---|---|---|
Qwen3.6 35B A3Bqwen3.6-35b-a3b | Context262k | Max output131,072 | text image | Input / 1M$0.111 | Cached / 1M$0.075 | Output / 1M$0.941 |
Qwen3.8 27Bqwen3.8-27b | Context66k | Max output32,768 | text image | Input / 1M$0.269 | Cached / 1M$0.110 | Output / 1M$2.321 |
Gemma 4 31B ITgemma-4-31b-it | Context57k | Max output28,672 | text image | Input / 1M$0.219 | Cached / 1M$0.104 | Output / 1M$0.458 |
Nemotron 3.5 Lightning 30B A3Bnemotron-3.5-lightning | Context131k | Max output65,536 | text | Input / 1M$0.056 | Cached / 1M$0.025 | Output / 1M$0.187 |
Limits are in tokens and rates are in USD per 1,000,000 tokens (reasoning tokens bill at the output rate; per-request fee is $0). All four stream text output and accept tools, JSON mode, structured outputs, and reasoning control. This table is those public chat models, and it matches /billing. GET /v1/models is the live document and can include other rows. Speech to text and text to speech are not in this table. See Audio.
Chat completions
POST /v1/chat/completions takes the OpenAI chat body and returns a chat.completion object with usage. The body must be one JSON object of at most 32 MiB.
- Send
modeland a non-emptymessagesarray. Keep system prompts inmessages. - Only the fields below are accepted. Any other top-level field is
400unsupported parameter "…", and engine-internal fields such aschat_template,guided_json, orbest_ofare refused by name. - A long request may answer
200early and send JSON whitespace (newlines) as keepalive until the body is ready. Standard JSON parsers ignore it.
Parameters
- modelstring, required
- A served id from
GET /v1/models. An id that is not served is404 not_found. - messagesarray, required
- Chat messages.
contentis a string or an array oftextandimage_urlparts (see Images). - streamboolean
- Server-sent events. See Streaming.
- stream_optionsobject
- Only
include_usage(boolean). It is forced on whenstreamis true. - max_tokensinteger
- Positive integer, up to the model's max output.
max_completion_tokensis accepted as an alias. - temperature, top_pnumber
temperature0–2,top_p0–1.- top_k, min_pnumber
top_kinteger ≥ −1,min_p0–1.- presence_penalty, frequency_penaltynumber
- −2 to 2.
repetition_penalty0–10. - stopstring or array
- One string or up to 4 strings, each at most 256 bytes.
- seed, min_tokensinteger
seedany integer.min_tokens0–4096.- response_formatobject
{"type": "text"},{"type": "json_object"}, or{"type": "json_schema", "json_schema": {…}}with a schema up to 16 KiB and 12 levels deep.- tools, tool_choicearray, string or object
- Up to 64
functiontools (64 KiB total).tool_choiceisnone,auto,required, or a function object.parallel_tool_callsis a boolean. - logprobs, top_logprobsboolean, integer
top_logprobs0–20.logit_biastakes up to 128 entries, each −100 to 100.- reasoningboolean or object
- Turns thinking on or off. See Reasoning.
include_reasoning(boolean) is the legacy form, andreasoning_effortis accepted as described there. - chat_template_kwargsobject
enable_thinking(boolean) is the engine switch behindreasoning.- n, userinteger, string
nmust be 1.useris a string of at most 128 bytes.
Streaming
Set "stream": true for text/event-stream output. Each data: event is a chat.completion.chunk. Treat each one as a delta, not a full reply.
- Append
choices[0].delta.contentin order. Some events carry no text. - The last chunk before
data: [DONE]carriesusageand may have an emptychoicesarray. Guard for it. - Lines starting with
:(: keepalive) are SSE comments sent while the model is busy. Ignore them. [DONE]is sent only after a normal finish and its usage. A failure mid-stream arrives as adata:event holding anerrorobject, with no[DONE].- Closing the connection cancels the generation. Do not retry a half-read stream unless you can restart the whole reply.
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Bounded"}}]}
: keepalive
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"object":"chat.completion.chunk","choices":[],"usage":{"prompt_tokens":18,"completion_tokens":211,"total_tokens":229}}
data: [DONE]
const stream = await client.chat.completions.create({
model: "qwen3.6-35b-a3b",
messages,
stream: true,
});
for await (const chunk of stream) {
const text = chunk.choices[0]?.delta?.content;
if (text) process.stdout.write(text);
if (chunk.usage) console.log("\n", chunk.usage);
}
Images
qwen3.6-35b-a3b, qwen3.8-27b, and gemma-4-31b-it read images. nemotron-3.5-lightning is text only.
- Send images inline as base64 data URIs:
data:image/png;base64,…,image/jpeg, orimage/webp. - Remote
http://andhttps://image URLs are not fetched. They are400withimage_url must use a data:image/* base64 URI. Download the image yourself and inline it. - Audio, video, and file parts in a chat message are not accepted. Neither are SVG or PostScript payloads. Speech uses the routes in Audio, not a chat part.
- Images count toward the 32 MiB body cap and toward prompt tokens. One request may carry at most 16,384 image tokens.
X-Ide-Own-Cores: preferred (the default for a key that can use your Cores), an image request goes to one of your Cores that reads images, else to an image-capable server in the shared pool. With X-Ide-Own-Cores: only, an image for a model your Cores serve as text only is 400 unsupported_modality before anything runs, and nothing is charged. On a Core's local address, an image works only when that Core's model reads images. See Your Cores.
{
"model": "qwen3.6-35b-a3b",
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "What is in this image?" },
{ "type": "image_url", "image_url": { "url": "data:image/png;base64,iVBORw0KGgo…" } }
]
}]
}
Audio
Speech to text and text to speech are not on /billing, and they are not public chat models. Any valid key with credit can call the routes below. An unknown key is 401 and an empty balance is 402. Chat that names either model is 404 model_not_found for every key.
Both models are on the Cores card at /account. While either model is loaded, that Core does not serve chat. The per-key rate limit in Rate limits applies to both routes. Neither route takes a chat capacity slot.
Speech to text
POST /v1/audio/transcriptions takes an OpenAI multipart form and returns JSON. The model you load is nemotron-3.5-transcribe-30b-a4b (Nemotron 3.5 Transcribe 30B A4B). It is not a row of the public GET /v1/models document. With your key and X-Ide-Own-Cores: only, that list shows what your Cores are serving, including this model when one of them has it loaded. The Core's inference app must be 20261126.8 or newer. An older app leaves the model unavailable.
- The body is
multipart/form-datawith afilepart. JSON is400. The route readsmodeland forwards the form.modelmay benemotron-3.5-transcribe-30b-a4b, or that id with a vendor prefix such asnvidia/.whisper-1, an emptymodel, and any other value are served by the transcription model your Cores are serving. When that is Nemotron, those values reach Nemotron. - The call runs only on Cores you own. The key must be allowed to use them: Internet: my Cores, a current Sign in with IDE, and you own the Core. You do not need
X-Ide-Own-Cores.only,preferred,off, or a missing header all still run only on your Cores. A repeated or unrecognized value is400. A reply from a Core carriesX-Ide-Own-Core: trueandX-Ide-Served-By. - The upload cap is 32 MiB, about 17 minutes of 16 kHz 16-bit mono WAV. The route also accepts FLAC or MP3. Over the cap is
413. On the public URL the edge may refuse that body before the service, so it is not the JSON envelope. When the route itself refuses the size, the code isaudio_too_large. - The public route waits 110 seconds after the upload is read. If the Core has not answered, the reply is
413 audio_too_longand the body is JSON. Do not retry it. Ten minutes of audio fits one request. - A
200is the Core's JSON, includingtext. There is nousageobject. Every price on this model is zero, so a completed call costs $0. It still places a hold of 1 nano-USD first, so an empty balance is402and nothing runs. The hold is released when the call finishes. 403 own_cores_not_allowed: the key cannot use your Cores or you own none.409 model_not_loaded: none of your Cores is serving a transcription model this request can use.409 own_cores_unavailable: your Cores cannot be used for this request right now (see Your Cores).
curl https://infer.industrialdata.ca/v1/audio/transcriptions \
-H "Authorization: Bearer $INFER_API_KEY" \
-F "file=@clip.wav" \
-F "model=whisper-1"
Text to speech
POST /v1/audio/speech takes one JSON object and returns audio. The model you load is phonon-31m-en (Phonon 31M EN). The Core's inference app must be 20261126.10 or newer.
modelmust bephonon-31m-enorgradium/phonon-31m-en.tts-1, an omittedmodel, and any other id are400 invalid_requestwith the messagemodel is not served on this route. An unknown or missing key is401before that check runs.inputis the text to speak: a non-empty string of at most 4,096 characters. Longer text is400.response_formatmay bewavorpcm. Omit it forwav.mp3and any other format are400. Avoicefield does not choose a voice. The model uses its own. The speech server refuses a body over 64 KiB with413.- A
200isaudio/wav, oraudio/pcmwhen you asked forpcm. It is not JSON and it has nousageobject, so a completed call settles at 0 tokens and the debit is 0. A hold is taken from the size of the request first, so an empty balance is402and nothing runs.phonon-31m-encan appear in GET /v1/models. That listing does not open the route. - This route does not use your Cores the way transcription does. It does not check which Cores you own, and the reply does not carry
X-Ide-Own-Core.X-Ide-Own-Cores: onlyis400 own_cores_unsupported_route.preferredandoffare accepted and do not steer the call. The service dials a healthy server for the model, which may not be a Core you own. The reply carriesX-Ide-Served-Bynaming that server. - An accepted model id with no healthy server serving it is
404 model_not_found. Nothing is charged and no server is dialled.
curl https://infer.industrialdata.ca/v1/audio/speech \
-H "Authorization: Bearer $INFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"phonon-31m-en","input":"Bounded retries."}' \
--output speech.wav
Reasoning
The models think before they answer unless the request turns thinking off. Thinking tokens are completion tokens: they count in usage and are billed.
- Turn thinking off with
"reasoning": {"enabled": false},"reasoning": false,"reasoning": {"effort": "none"}, or"chat_template_kwargs": {"enable_thinking": false}. "reasoning": {"exclude": true}removes the reasoning trace from the response but leaves thinking on. Usage still counts it.usage.completion_tokens_details.reasoning_tokensis always present on a successful response.- With none of
reasoning,include_reasoning, orreasoning_effortsent andmax_tokensbetween 1 and 16, thinking is turned off so short probes are not spent inside the trace. - Top-level
reasoning_effortmust benone,minimal,low,medium,high, orxhigh(anything else is400), and is passed to the engine as-is. It is not an effort dial; usereasoning.
completion = client.chat.completions.create(
model="qwen3.6-35b-a3b",
messages=[{"role": "user", "content": "Reply with one word."}],
extra_body={"reasoning": {"enabled": False}},
)
Rate limits
Two limits apply to chat on https://infer.industrialdata.ca/v1. Both answer 429 with Retry-After, and both are safe to retry after that wait. Speech to text and text to speech take the per-key limit and do not take the chat capacity slot. See Audio.
- Per keyrate_limit_exceeded
- Each key can send a burst of 60 requests, refilled at one request a second. Responses carry
x-ratelimit-limit-requests,x-ratelimit-remaining-requests, andx-ratelimit-reset-requests(time until the burst is full again, such as60s). - Capacityoverloaded
- Every slot for that model, or for the whole service, is busy.
Retry-Afteris 1 second. The limit grows and shrinks with the number of healthy servers for that model, so the concurrency figure in /v1/models is a guide, not the live limit.
Embeddings and rerank
POST /v1/embeddings and POST /v1/rerank take the same key, but no model is served on either today, so a call answers 404 model_not_found. A model id that does not belong on that route is 400 first. Check /v1/models before you depend on them.
Your Cores
If you own Cores, a key can send your requests to them, through https://infer.industrialdata.ca/v1 or straight to a Core on your local network. Choose each Core's model on the Cores card at /account.
A key can use your Cores when all of these hold:
- The key has Internet: my Cores ticked.
- Your account is linked with Sign in with IDE, and that sign-in is less than 30 days old. When it runs out, sign in with IDE again at /account.
- You own the Core in your IDE account. A seat on someone else's Core does not count.
X-Ide-Own-Cores
Send this header on POST /v1/chat/completions to choose where the request runs. Any other value, or the header sent twice, is 400 invalid_request. A key with only Internet: my Cores ticked always runs as only, whatever the header says or leaves out, and never on the shared pool.
- only
- Only your Cores serve the request. If they cannot, it is refused (see below), never sent elsewhere.
- preferred
- Your Cores first, then the shared pool. This is the default for a key with both Internet boxes ticked.
- off
- The shared pool only, for a key with both Internet boxes. A key with only Internet: any Core always gets this.
- When you send
preferredoronly, a reply from a model server carriesX-Ide-Own-Core: trueorfalse. Refusals do not. truemeans the Core that produced the reply is one of yours: its name is on our list of Cores you own. With an image, it also means the image was read on that Core and not by the shared image reader.falsemeans one of those is not so. Another Core served it, the shared image reader read the image, or the key cannot use your Cores. The header is for your own tracking only. It does not change the price, and it grants nothing. We record the same yes or no with the request.- The header is left out when the Core took more than 12 seconds to start replying, because by then the response has already begun.
X-Ide-Served-Bystill names the Core. - A request served on your Cores through
https://infer.industrialdata.ca/v1is billed at the same rates as any other. 403 own_cores_not_allowed: the request runs asonly, and the key cannot use your Cores or you own none. A key without Internet: my Cores that sendsonlygets this too.409 own_cores_unavailable: the request runs asonly, and your Cores cannot be used for it right now: they cannot be checked, own-Cores routing is switched off, or you own more than 256 Cores. Retry later, or, with both Internet boxes ticked, sendpreferred.409 model_not_loaded: none of your Cores is serving that model. The message names what they are serving, andloaded_modelslists those ids.429 overloaded: every one of your Cores serving that model is busy.400 unsupported_modality: you sentonlywith an image, and your Cores serve that model as text only. A Core reads images only when its model's image projector is loaded; see Images.- Embeddings, rerank, and text to speech refuse
onlywith400 own_cores_unsupported_route, and a key with only Internet: my Cores with409 own_cores_unavailable. Speech to text does not use this header to choose a pool: it always runs on your Cores. See Audio.
On your local network
- The Host turns on Allow LAN access in the Host portal. Until then the Cores card says that LAN access is off.
- The Cores card shows each Core's local address,
https://<LAN IPv4>:<port>. Use it as the base URL with/v1appended, and send the same key as a bearer token. - A Core answers only under
/v1/.GET /v1/modelslists only the model that Core is serving. A chat model servesPOST /v1/chat/completions. A speech-to-text model servesPOST /v1/audio/transcriptionsand does not serve chat. A text-to-speech model servesPOST /v1/audio/speechand does not serve chat. - The Core serves a certificate it made itself, named
ide-inference-lanand carrying no IP address, so a client refuses it until you pin or trust that certificate. - The Core asks
infer.industrialdata.cawhether the key may use it. The rules above apply, and your available balance (your balance less holds for requests in flight) must be above zero. A refused key is401. - Calls to a Core's local address are charged at the same rates as calls through
https://infer.industrialdata.ca/v1. - A Core that loses its internet connection keeps serving against your last known balance, and the calls it served are charged when it reconnects. Your balance can then end below zero.
Routing
A call to https://infer.industrialdata.ca/v1 passes through Cloudflare, one of two infer edges, and one of two hubs, then runs on one Core. Each reply names that Core in X-Ide-Served-By.
- Edges. Both edges are checked every 15 seconds. If the active one fails twice in a row, the name moves to the other edge, and it moves back after three good checks.
- Hubs. Each edge sends to one hub and keeps the other as a backup. If the first hub cannot be reached or answers
502,503or504before anything has reached you, the edge tries the backup hub once. - Which Cores serve. A Core is in the pool when its owner approved it, it checked in during the last 3 minutes, and its model is loaded and ready. The hubs read that list from infer every 5 seconds, signed. If a hub cannot get a fresh list for 120 seconds, it stops using Host Cores until it can.
- Size of the request. A model can run at more than one context size. A request that fits in 32k tokens goes to the 32k servers first, then the standard ones, then the 256k ones. A larger request goes to the 256k servers first.
- Choosing a Core. Within a size, the hub picks a healthy Core with room, at most 4 requests in flight each, and prefers the one with the fewest. Requests that share the same start of the conversation go back to the same Core, so its cache is reused. Otherwise the hub takes turns.
- Your Cores. With
preferred, your Cores with room come first, balanced across all of them by the same rules, and then the Cores of other Hosts. Withonly, the request stays on your Cores. See Your Cores. - Failover. If a Core cannot be reached, answers
502,503or504, or has no room left for the prompt, the hub tries the next Core of that size. Underpreferredyour other Cores come first. When the Cores of that size were busy, it moves on to the next size. This happens only before the first byte reaches you. A stream that breaks midway ends with an error event and is not retried, so retry it yourself. - Context length. If a Core refuses the request as too long for its context, the hub tries once more on a larger size, or on another Core. If a larger size was only busy, you get
429 overloaded, because the request may still fit there. Otherwise you get the refusal. - Draining. A Core keeps serving its current model while it downloads a new one. When it switches, it stops taking new requests, so they go to other Cores within about a second. It lets requests already running finish, for up to 2 minutes, before it unloads the old model. A Core that goes offline leaves the pool within about a second, and a request streaming from it ends with an error.
Working offline
Local AI on your Cores keeps working when your site loses its internet connection, or when we cannot be reached.
- The first time a key is used on a Core, the Core asks
infer.industrialdata.cawhether the key may use it. The Core then keeps serving a key it has checked for up to 2 days offline while its copy of your wallet lasts, and settles with us when it is back online. A yes never lasts past the end of your Sign in with IDE. - A key the Core has not seen yet cannot be checked while offline, so it is refused until the connection is back.
- The kept answers are held in memory, so they last only while the Core stays on. A Core that restarts while offline must reach our control plane again for attestation, our check that it is a genuine Core, before it accepts keys. It then asks about each key again. This is known and intended.
- The trade-off: a key you revoke or delete can keep working on your local network until that Core's kept yes runs out, which takes up to 2 days. If a key leaks, revoke it at /account and expect this delay on the LAN. The public endpoint stops accepting it within a few seconds.
- A Host can ask us in writing for a longer window. Email support@industrialdata.ca from the account's address and name the Cores and the window you need. A longer window is not built yet. We would build it on request.
Balancing on your local network
Your Cores on one site work as one pool. Call any Core's local address, and the request runs on whichever of your Cores serves the model and has room. This works offline too.
- Any Core is a way in. Use any Core's local address as the base URL. With balancing, its
GET /v1/modelslists every model your Cores on that site are serving. This replaces the one-model list described under On your local network. - Who is in the pool. infer tells each Core which of your other Cores share its site, and what each one serves. Each Core checks the others about once a minute, so it knows which are up and how busy they are.
- Choosing a Core. The Core you called serves the request itself when it runs that model and has room. Otherwise it passes the request to the least busy of your Cores that serves the model.
- Failover. If that Core cannot be reached or is busy before the first byte, the request goes to the next one. A stream that breaks midway ends with an error and is not retried. If none of your Cores serves the model, you get
409 model_not_loadedwithloaded_models. If they are all busy, you get429 overloadedwithRetry-After. - One check, one record. The Core you called checks your key once, and the request is recorded once in your activity log, whichever Core served it. LAN calls are charged at the same rates as calls through
https://infer.industrialdata.ca/v1. A request is passed on at most once, between your own Cores only, over an encrypted link that only those Cores can use. - Offline. Balancing needs only your local network. Keys work by the rules in Working offline.
X-Ide-Served-Bynames the Core that served the request.
Prepaid balance
Usage is paid from a prepaid USD balance on your account. Current per-model rates are on /billing.
- Top up at /billing through Stripe Checkout, by credit pack or in dollars. Receipts are listed on the same page.
- A promo code adds a fixed amount once. Follow Enter promo code on /billing to /promo-enter and enter it there.
- Before the model runs, the API places a hold on your balance sized from the estimated prompt and
max_tokens, capped at what you have available. Holds from your other in-flight requests count against the balance. - If what is available cannot cover the estimated prompt, the request is refused with
402 Payment Requiredand codewallet_balance_exhausted. No model runs and nothing is charged. - When the response completes, the actual usage is debited and the hold is released. A request that ends in an error before it completes is not charged.
{
"error": {
"message": "Prepaid inference wallet balance is exhausted.",
"type": "billing_error",
"param": null,
"code": "wallet_balance_exhausted"
}
}
Metering
Each completed request is priced from the usage object the API returns to you, so you can reproduce every debit.
Wallet balances and per-request charges are settled in nano-dollars (nano-USD), so a fraction of a cent still has an exact ledger balance. One US dollar is 1,000,000,000 nano-USD. Each token term below is rounded half-to-even to a whole nano-USD. Pricing pages show ordinary US dollars; this section is the customer-facing description of that unit.
- prompt_tokens
- Input tokens, including image tokens.
- prompt_tokens_details.cached_tokens
- The part of the prompt served from cache, billed at the cached-prompt rate. Absent means 0.
- completion_tokens
- Output tokens, including reasoning.
- completion_tokens_details.reasoning_tokens
- The part of the output spent thinking, billed at the reasoning rate.
- request fee
- Currently
0nano-USD across all public models.
cost_nano_usd =
(prompt_tokens - cached_tokens) x prompt_rate
+ cached_tokens x cached_prompt_rate
+ (completion_tokens - reasoning_tokens) x completion_rate
+ reasoning_tokens x reasoning_rate
+ request_fee
# rates are nano-USD per 1,000,000 tokens; 1 USD = 1,000,000,000 nano-USD
# each token term is rounded half-to-even to a whole nano-USD
Cached and reasoning tokens are subsets of their parent counts, so each token is billed once. The rates for each model are on /billing.
Errors
Errors use the OpenAI envelope {"error": {"message", "type", "param", "code"}} with Content-Type: application/json. Branch on the HTTP status and error.code, not on the message.
| Status | error.code | Meaning |
|---|---|---|
400 | invalid_request, unsupported_modality, own_cores_unsupported_route | Not a JSON object, an unsupported or blocked field, a value out of range, a remote image URL, an image for a model that does not read images (or, with X-Ide-Own-Cores: only, that your Cores serve as text only), a model id sent to embeddings, rerank, or text to speech that does not belong there (including tts-1 and an omitted model on POST /v1/audio/speech), or a bad X-Ide-Own-Cores value. Fix the request. |
401 | invalid_api_key | Missing, unknown, or revoked key. Check /account. |
402 | wallet_balance_exhausted | The prepaid balance cannot cover the request. Checked before the model runs. Top up at /billing. |
403 | key_has_no_access, key_not_allowed_external | key_has_no_access: the key has none of Local LAN, Internet: any Core, or Internet: my Cores ticked. key_not_allowed_external: the key has only Local LAN, so it cannot call https://infer.industrialdata.ca/v1. Turn the setting on for the key at /account. See API keys. |
403 | own_cores_not_allowed | The request runs as X-Ide-Own-Cores: only (you sent it, the key has only Internet: my Cores, or you called POST /v1/audio/transcriptions), and the key cannot use your Cores or you own none. See Your Cores. |
404 | not_found, model_not_found | The path is not served (for example /v1/completions or GET /v1/embeddings), or the model id is not served. Embeddings, rerank, and text to speech say model_not_found when no healthy server is serving the model. Chat naming an audio model is model_not_found for every key. See Audio. |
409 | model_not_loaded, own_cores_unavailable | model_not_loaded: the named model is not loaded on your Cores (with X-Ide-Own-Cores: only or on POST /v1/audio/transcriptions) or on the Core you called. The message says which model is loaded, and loaded_models lists those ids. Use a listed id, or choose a model at /account. Do not retry. own_cores_unavailable: your Cores cannot be used for this request right now (see Your Cores); retry later, or on chat with both Internet boxes ticked send preferred. |
413 | audio_too_large, audio_too_long, or none | The body is over 32 MiB (or over 64 KiB on POST /v1/audio/speech, where the speech server returns JSON with code: null). On https://infer.industrialdata.ca the edge refuses bodies over 32 MiB before the service, so the body is not the JSON envelope. When the transcription route itself refuses the size, the code is audio_too_large and the body is JSON. A transcription that does not finish within 110 seconds of the upload is audio_too_long, also JSON. Do not retry a 413. |
429 | rate_limit_exceeded, overloaded | The key's rate limit, or no free capacity. See Rate limits. Wait for Retry-After, then retry. |
502 | upstream_error, upstream_generation_error, invalid_upstream_response, missing_usage | The model server failed or returned an incomplete response. Not charged. Retry with backoff. |
503 | service_unavailable | The image encoder is not ready for an image request. Retry with backoff. |
503, 504 | none | The edge could not reach the service; the body is not the JSON envelope. A busy engine is reported as 429, not 503. Retry with backoff. |
- Do not retry
400,401,402,403,404,409 model_not_loaded, or413. Retry429,5xx, and409 own_cores_unavailableonly. - Use capped exponential backoff with jitter. Cap attempts at four.
// Retry only transient failures; honour Retry-After, cap attempts, add jitter.
const retryable = new Set([429, 500, 502, 503, 504]);
if (!retryable.has(response.status) || attempt >= 4) throw error;
const retryAfterMs = Number(response.headers.get("retry-after") ?? 0) * 1000;
const backoffMs = Math.min(8_000, 250 * 2 ** attempt) * (0.5 + Math.random());
await new Promise((resolve) => setTimeout(resolve, Math.max(retryAfterMs, backoffMs)));
Clients
Any client that speaks OpenAI Chat Completions works. Set the base URL to https://infer.industrialdata.ca/v1, the API key to your ide_sk_ key, and the model to an exact id from GET /v1/models. None of these run the model on your computer.
- When a client asks for an API format or wire protocol, select Chat Completions (
POST /v1/chat/completions). Clients configured for the OpenAI Responses API (POST /v1/responses) will receive404 not_found. - Enable native tool calling on all four public models, and vision / image input on
qwen3.6-35b-a3b,qwen3.8-27b, andgemma-4-31b-it(on a Core only when its image projector is loaded; see Images).
IDEs and editors
Terminal agents
Visual Studio 2026
Bring Your Own Model (BYOM) is generally available in Visual Studio 2026 version 18.12 and later across Community, Professional, and Enterprise, with no GitHub sign-in required. See the Visual Studio blog and the 18.12 release notes.
- Open GitHub Copilot Chat, open the model picker, and choose Manage models.
- Select Add model provider and choose Custom Endpoint (on 18.10–18.11, select OpenAI with a custom URL, as described in Using AI models in Copilot Chat).
- Enter
https://infer.industrialdata.ca/v1as the endpoint URL, paste youride_sk_…API key, and set Model API format to Completions. - Add a served model id such as
qwen3.6-35b-a3b, enable tool calling (and vision for image-capable models), then select it in Agent Mode or Chat.
Visual Studio Code
Run Chat: Manage Language Models from the Command Palette, choose Add Models → Custom Endpoint → Chat Completions, or add an entry to chatLanguageModels.json (VS Code custom endpoint docs):
[
{
"name": "Industrial Data Infer",
"vendor": "customendpoint",
"apiKey": "${input:inferApiKey}",
"apiType": "chat-completions",
"models": [
{
"id": "qwen3.6-35b-a3b",
"name": "Qwen3.6 35B A3B",
"url": "https://infer.industrialdata.ca/v1/chat/completions",
"toolCalling": true,
"vision": true,
"maxInputTokens": 196608,
"maxOutputTokens": 65536
}
]
}
]
Terminal agents
For OpenCode, export INFER_API_KEY and declare an OpenAI-compatible provider in opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"model": "infer/qwen3.6-35b-a3b",
"providers": {
"infer": {
"name": "Industrial Data Infer",
"env": ["INFER_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://infer.industrialdata.ca/v1"
},
"models": {
"qwen3.6-35b-a3b": {
"name": "Qwen3.6 35B A3B"
}
}
}
}
}
For Aider, prefix the model id with openai/ so LiteLLM routes to OPENAI_API_BASE:
export OPENAI_API_BASE="https://infer.industrialdata.ca/v1"
export OPENAI_API_KEY="ide_sk_your_key"
aider --model openai/qwen3.6-35b-a3b
curl -s https://infer.industrialdata.ca/v1/models from the same machine. A 200 means the network path works; then check the key and the exact model id.