Error reference for every endpoint and tool

Decode any Flux error: the error shape each endpoint and tool uses, every ability error code with what it means, whether to retry, and where the fix is.

Every Flux error starts with an HTTP status, and most carry a machine-readable code. The abilities grew up one at a time, so today the code does not always sit in the same place: this page shows each shape, then lists every ability code in one table.

For chat and the money checks (every 402 refusal on a model call), see the chat error reference. This page covers the abilities and the two MCP servers, and links back there for chat.

Read the status first

StatusMeansRetry?
400The request was refused as it stands.No: fix the request
401The key is missing or not accepted, or the key is not allowed this ability's model.No: fix the key
402A plan or money check refused the call. Nothing was charged.No: read the code
403This key or account may not use this model or ability.No
404The ability is not switched on for your account yet.No
413The input is too large.No: send less
422The request is well formed but its content was refused.No: fix the request
429Too many calls, or a shared budget is used up.Yes, after a wait
502, 503, 504A temporary fault behind the gateway.Yes, with backoff
529The service behind the gateway is at capacity.Yes, with backoff

The tools server is the exception: it answers with HTTP 200 and puts the refusal inside the tool result. See Tools server results.

The error shapes

Chat

Chat and model calls use the OpenAI error shape. The code is at error.code, and 402 refusals carry their reason in a header or at error.provider_specific_fields.error, as the 402 section explains.

json
{"error": {"message": "Flux Router error: ...", "type": "invalid_request_error", "param": null, "code": "invalid_api_key"}}

Ability endpoints

Speech to text, text to speech, the voice list, search, images and decision mode use the same outer shape. The code is at error.code, and param names the field at fault when there is one. Some 400s carry only param and no code.

json
{"error": {"message": "unsupported or unrecognized audio format", "type": "invalid_request_error", "code": "unsupported_file_format", "param": "file"}}

Images, when a credit check blocks the call

The image endpoints wrap a balance or spend-cap refusal one level deeper, under detail. The code is one of the balance codes from the 402 section, such as credit_exhausted or daily_cap.

json
{"detail": {"error": {"code": "credit_exhausted", "message": "..."}}}

Page reading

POST /v1/fetch returns a flat shape. The code is the error string itself, and message, when present, explains it.

json
{"error": "social_blocked", "message": "social-media mass-scrape is not supported"}

Tools server results

The Flux tools server (/mcp-tools/) never answers a tool call with a protocol error. A refusal is a normal tool result whose structured content carries the code:

json
{
  "error": "rate_limited",
  "capability": "apps",
  "message": "Connected apps is busy for this account right now. Wait a moment, then retry.",
  "retryable": true,
  "retry_after_seconds": 30
}
  • retryable tells your agent whether trying again can help.
  • retry_after_seconds appears on some rate_limited answers.
  • upgrade_url appears on premium_locked and payment_required.

Apps are reached only through the tools server, so every apps error arrives in this shape.

Routing server

The routing server (/mcp) speaks JSON-RPC, so its errors are JSON-RPC errors with a numeric code:

json
{"jsonrpc": "2.0", "id": 1, "error": {"code": -32002, "message": "..."}}
CodeMeaning
-32700The body is not valid JSON.
-32600The JSON is not a valid request.
-32601Unknown method.
-32602Invalid arguments.
-32603Internal error. Retry.
-32001A required header did not match.
-32002The key is missing or not accepted.
-32003Rate limited. Retry after a wait.
-32004The call needs a session: send initialize first and pass MCP-Session-Id.
-32005The session has expired. Start a new one with initialize.

Reading the code in one place

This reads the code from any of the HTTP shapes above:

ts
async function fluxErrorCode(res: Response): Promise<string | null> {
  const hold = res.headers.get('X-Flux-Hold-Reason');
  if (hold) return hold;
  const body = await res.json().catch(() => null);
  if (!body) return null;
  if (typeof body.error === 'string') return body.error; // page reading
  const err = body.error ?? body.detail?.error; // abilities, chat, image credit
  return err?.provider_specific_fields?.error ?? err?.code ?? null;
}

Every ability code

StatusCodeWhereWhat it meansRetry?Fix
400(none, param set)Speech to text, text to speechA field is invalid, for example stream on transcription or an srt format.NoSpeech to text, text to speech
400unsupported_file_formatSpeech to textThe file is not audio Flux recognises. The format is read from the file, not its name.NoSpeech to text
400invalid_request_errorText to speechThe speech service refused the request after it passed Flux's own checks. A voice, format or speed that does not suit the model is a 400 with param set and no code instead.No: change the text or voiceText to speech
400edit_unsupportedImagesThis image model cannot edit.NoImages
400invalid_reference_imageImagesA reference image is the wrong type or too large.NoImages
400moderation_blockedImagesThe prompt or image was refused by moderation.NoImages
400social_blockedPage readingMajor social networks are not read.NoRead a page
400blocked targetPage readingThe URL points at a private or internal address.NoRead a page
400url required, body must be JSONPage readingThe request body is missing its url, or is not JSON.NoRead a page
401unauthorizedPage readingThe key was not accepted.NoRead a page
401, 403permission_errorImagesThe key is not accepted, or is not allowed this image model.NoImages
402premium_lockedSpeech, transcription, search, images, toolsThe ability needs a paid plan with a cleared payment. Nothing was charged.NoPlans
402upgrade_requiredPage readingThe same as premium_locked, in the page-reading shape.NoPlans
402payment_requiredTools, appsThe balance or the free allowance has run out, or (web_fetch on a Free plan) a paid plan is needed.NoApp problems
402credit_unresolvedSpeech, transcription, search, page reading, imagesYour balance could not be checked just now.Yes, onceChat error reference
402credit_exhausted, daily_cap, monthly_capSpeech, transcription, search, images, page readingYour balance, or a spend cap you set, would be passed. The same codes as chat.NoChat error reference
402price_exceeds_max_priceImagesThe image would cost more than your max_price. You were not charged.No: raise max_priceImages
403organization_must_be_verifiedImagesThis image model is not available to your account right now.No: pick another modelImages
404(none)Any ability endpointThe ability is not switched on for your account yet.NoAbilities
413file_too_largeSpeech to textThe audio is over the size limit.NoSpeech to text
413(none)Second opinionThe request is too large to check.NoSecond opinion
429rate_limit_errorSpeech to text, text to speech, searchThe per-account rate or audio budget is used up.Yes, after a waitAbilities
502, 504capability_unavailableSpeech, transcription, search, images, page readingA temporary fault behind the gateway.YesRetry with backoff
502upstream_error, upstream_incomplete, upstream_empty, usage_unavailable, settlement_unavailableSearchThe search did not complete.YesSearch
502provider failedPage readingThe page could not be read.Yes, onceRead a page
503capability_unavailablePage readingRendering is unavailable for a while.YesRetry with backoff, or drop render
503(none)Second opinionToo many checks are running at once.Yes, after Retry-AfterSecond opinion

Tools server codes

errorWhat it meansRetry?Fix
ability_disabledNot switched on for your account yet.NoCarry on without the tool
premium_lockedNeeds a paid, cleared plan. The tool can drop out of your agent's list after this.NoPlans
payment_requiredBalance or free allowance used up.NoBilling
auth_failedThe key on the server entry was not accepted.NoTools server
rate_limitedToo many calls. May carry retry_after_seconds.YesWait, then retry
capability_unavailableA temporary fault.YesRetry shortly
invalid_requestThe input was refused.NoFix the input
too_largeThe input is over the tool's limit.NoSend less
forbiddenThis key may not use the ability.NoTools server
apps_errorFinding or running an app action failed on the app side.OnceApp problems

Decision mode

POST /v1/decide (and /v1/systemone) uses the ability-endpoint shape: the code is at error.code, and param names the request field at fault (model, state, questions, images or body), never a value. The message is fixed text: it never repeats your state, instructions, option text, question ids or images. Request details are on the decision mode reference.

StatusCodeWhat it meansRetry?Fix
401invalid_api_keyThe key is missing or not accepted.NoCheck the key
402credit_unresolved, or a balance codeYour prepaid credit or a spend cap stopped the call, or your balance could not be checked.Once, for credit_unresolvedChat error reference
403model_not_allowedThe key is limited to a list of models that does not include flux-decide.NoAdd flux-decide to the key
403paid_plan_requiredThe plan or the key cannot use decision mode.NoPlans
404not_foundDecision mode is not switched on.NoAbilities
413request_too_largeThe body is over the size limit.NoSend less
422invalid_requestThe body does not match the request shape.NoFix the field named by param
422model_not_supportedmodel is missing, or is not flux-decide.NoSend "model": "flux-decide"
422state_too_longThe state is over the token limit. The model would never read the rest, so Flux refuses rather than answer wrongly.NoSend a shorter state
422upstream_rejectedThe decision model refused the request, for example an image it could not read.NoCheck the images and questions
429rate_limit_exceededToo many decisions from your account.Yes, after Retry-AfterWait, then retry
529upstream_overloadedThe decision model is at capacity.YesRetry with backoff
503upstream_unavailableThe decision model did not answer in time or could not be reached.YesRetry with backoff
503capability_unavailableDecision mode is temporarily unavailable.YesRetry later

Nothing is charged for any of these.

premium_locked, payment_required and credit_unresolved

Three 402 codes look alike and need different fixes:

  • premium_locked (or upgrade_required from page reading): your plan does not include paid abilities yet. Add a paid plan, or wait for your first payment to clear. Adding credit alone does not help.
  • payment_required: a tool's route asked for payment. Usually the money ran out: your balance, or on apps the free daily runs, so add credit. The web_fetch tool also answers payment_required on a Free plan, where the fix is a paid plan, as for premium_locked.
  • credit_unresolved: nothing is wrong with your account. Flux could not read your balance at that moment, so it refused rather than guess. Retry once; if it keeps happening, contact support.

Getting help

Keep the X-Flux-Request-Id header from the failing response, or the time of a tool call, and contact support. That lets us find the exact request.