Docs menuinvideo Platform docsQuickstartFor AI agentsAPI referenceAuthenticationRequestsFilesErrorsLimitsBilling and balanceCatalogueProvider keys (BYOK)Formats and model IDsChat completionsOpenAI ResponsesAnthropic MessagesGeminiStreaming chat answersTools (function calling)Structured output (JSON)VideoAudioUse your own SDKOpenAI mediaElevenLabsReplicatefalGemini mediaxAIRunwayLumaDeepgram and CartesiaMakers' own APIsVideo provider formatsImage provider formatsAudio provider formatsLLM provider formatsGenerate and edit imagesTest your integrationWorkspaces and membersSecurityService accountsModels
View as markdown

Errors

API error codes, their causes, and how to respond.

When the API rejects a call, it returns an HTTP error with a JSON body. Most use {error, message}. The invalid_input error uses {error, detail}.

HTTPerrorWhenWhat to do
400The body is not valid JSON.Fix the body.
401unauthorizedThe API key is missing, invalid, disabled or expired.Check Authorization: Bearer iv_....
404model_not_foundNo such model or mode, or it is off for this workspace.Check GET /v1/models.
404not_foundNo request with this id in this workspace.Check the id.
410log_expiredThe request's logs are older than 90 days.
413The body is over 64 MB.Send large files as an https URL.
422invalid_inputThe input does not fit the model's schema.Read detail.
422model_not_pricedThese options have no price yet.Pick other options.
429rate_limitedOver the workspace's requests per minute.Wait Retry-After seconds.
402insufficient_balanceThe balance is $0 or less, or less is available than this request's estimated cost.Add funds, then retry.
429spend_limit_exceededA spend limit (daily or monthly; for the workspace, a model or a key) has been reached.Wait until resets_at, or raise the limit in the console.
500server_errorSomething went wrong on our end. Please try again.Retry with the same Idempotency-Key.

invalid_input

json
{
  "error": "invalid_input",
  "detail": [{ "loc": ["body", "input", "duration"], "msg": "must be one of 5, 10", "type": "enum" }]
}

loc is the path to the field; its last item is the field's name.

A failed run is not an error

A request that was accepted and then failed answers 200 with status: "failed" and an error object. See Requests.

Chat completions errors

POST /v1/chat/completions and POST /v1/responses answer errors in the OpenAI shape, so OpenAI SDKs read them. The Anthropic and Gemini doors answer in their own shapes with the same codes and HTTP statuses: see Formats and model IDs.

json
{ "error": { "type": "invalid_request_error", "code": "context_length_exceeded", "message": "...", "param": "messages" } }
HTTPcodeWhen
400invalid_requestThe body does not fit the chat completions shape.
400context_length_exceededThe messages are longer than the model's context window.
400max_tokens_too_lowThe answer reached max_tokens before it could finish. Charged for the tokens used.
400content_filteredThe model refused the prompt or stopped its answer. Charged for the tokens used.
400model_not_chatThe model is not a language model: use POST /v1/request.
404model_not_foundNo such model, or it is off for this workspace.
422model_not_pricedThe model has no price yet.
429spend_limit_exceededThe workspace's spend limit is used up.
429rate_limitedOver the workspace's requests per minute. Wait Retry-After seconds.
429upstream_rate_limitedThe model is busy. Retry after a short wait.
500internal_errorSomething went wrong on our end. Please try again.
502upstream_errorThe model failed. Retry.
504upstream_timeoutThe model took too long. Retry, or ask for a shorter answer.

What a failed chat call costs

  • A call that fails because of its own settings (max_tokens_too_low, content_filtered) is charged for the tokens the model used: the error has charged_usd and says so, e.g. "Charged $0.0000858 for 30 tokens used before max_tokens was reached."
  • A failure on our side or the model provider's side (internal_error, upstream_*, rate_limited) costs nothing.
  • A caller who closes a stream early: the model finishes the answer in the background and the call is charged its real tokens.
Errors - Docs | invideo Platform