Skip to Content
Docs

Reference

Errors

The error shape, every error code, and what to do about each.

Errors are a JSON object with an error field:

JSON
{"error": {"message": "no ready miner serves this model", "type": "invalid_request_error", "code": "no_miner_available"}}

Numeric codes and reasons Not live yet

JSON
{"error": {"code": 402, "message": "prepaid balance ...", "metadata": {"reason": "insufficient_balance", "available": "0", "required": "<amount>"}}}

code becomes the HTTP status as a number, and the reason string below moves to error.metadata.reason. Read the reason as error.metadata.reason, falling back to error.code when it is a string, and the code works with both shapes.

When a session was started before the error, error.session_id (or error.metadata.session_id) is set. Look it up with GET /v1/sessions/{id} to see every attempt and any channel that was opened.

HTTPcodeMeaningWhat to do
202(not an error)object: "chat.completion.pending": no verified reply within the response deadline. The session continues.Poll GET /v1/sessions/{id} until reply is set, or use stream: true.
400invalid_json, model_required, messages_required, invalid_message, invalid_max_tokensThe body is not valid.Fix the request. The message says which field.
400unsupportedThe request asks for something not supported: tools, or n above 1.Remove the field.
400invalid_provider, invalid_sort, invalid_payer, invalid_addressA provider, flop.payer or address value is wrong.See routing and payer modes.
400escrow_limitThe escrow for this request would pass the maximum per request.Lower max_tokens or shorten the prompt.
401unauthorizedMissing, unknown or revoked key, or the payer mode needs a wallet key.Check the Authorization header. Create a key on the account page.
401invalid_challenge, challenge_expired, challenge_used, invalid_signatureSign-in failed.Ask for a new challenge and sign it with the same address.
402insufficient_balanceYour prepaid balance cannot cover the request. The error carries available and required.Top up or lower max_tokens.
402insufficient_fundsIn grant mode, your wallet cannot cover the escrow.Fund your wallet.
402grant_required, grant_expired, grant_expiring, grant_revoked, grant_exhausted, grant_not_usable, grant_per_tx_limitGrant mode, and the grant cannot pay for this request.Sign a new grant on the account page, or raise its caps.
404model_not_foundUnknown model id.Use an id from GET /v1/models.
404miner_not_found, session_not_found, key_not_found, not_foundUnknown miner, session, key or path.
403forbiddenThe request did not come through the public endpoint.Use the documented base URL.
409too_many_keysThis wallet has the most active keys allowed.Revoke one first.
200, in a streamstream_mismatchThe streamed text differs from the verified reply.Use verified_content from the error chunk.
413body_too_largeThe request body is too large.Shorten the prompt.
429rate_limited, too_many_concurrent, grant_daily_cap, demo_budget_exhaustedA rate, concurrency, grant daily or demo limit was reached.Wait for the Retry-After header, or use a wallet key.
503all_attempts_failedEvery miner tried failed before producing output. It is 503, not 502, because common SDKs retry a 502 at once, and each retry can cost an on-chain fee.Wait for Retry-After, or choose other miners.
503no_miner_availableNo ready miner matches the model and your provider rules.Check the ready miners or relax provider.
503payer_underfunded, daily_cap_reached, delegate_unfunded, payer_unavailableThe router's wallet cannot pay right now, or hit its daily cap.Retry later.
503shutting_downThe service is restarting.Retry in a few seconds.

This list follows the server at the time of writing; /openapi.json is the reference. Treat an unknown 5xx as retryable after a pause, and any 4xx as a problem with the request.

429 and 503 responses carry a Retry-After header.

Retries

The router already retries on another miner when an attempt fails before any output. A reply that started is never retried, so a client-side retry can open a second channel. Retry only on errors, not on slow replies: a normal reply takes 15 to 50 s on devnet. Set your client timeout to at least 120 s.

Python
requests.post(url, json=body, headers=headers, timeout=120)  # one request, no automatic retries