Anthropic Messages (/v1/messages) and Gemini native (/v1beta/...) requests
return the same HTTP status and message in their protocol’s own error shape
(error.type for Anthropic, error.status for Gemini), without error.code.
Meaning: The gateway reserves the maximum possible charge before calling
the provider. insufficient_funds means your balance cannot cover that
reservation; api_key_spend_limit_exceeded means the key’s own spend limit
would be exceeded.How to fix: add balance under Console > Billing, or raise the key’s
spend limit. For text models, a smaller max_tokens (or
max_completion_tokens) lowers the reservation.
Meaning:model_not_available — the model ID is unknown, disabled, or has
no live route.How to fix: call GET /v1/models with the
same key and copy an ID exactly. Also confirm the protocol: a model is only
served on the protocols listed on its page (for example, Gemini models answer
generateContent, GPT-5 models do not).
Meaning:rate_limit_exceeded (request rate) or
api_key_concurrency_exceeded (requests in flight on one key).How to fix: wait for the Retry-After header, then retry with exponential
backoff and jitter. Cap parallel video submissions.
Meaning:502 means the upstream provider failed the request or task
(provider_http_error, provider_task_failed). 503 means no healthy route
could take it (no_eligible_route, provider_route_unavailable).How to fix: retry with exponential backoff. For async tasks, check
task status before resubmitting so you do not
pay for a duplicate. Contact support with the status, time, model ID, and the
x-gateway-execution-id or task ID — never the API key.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"FreeModel","description":"FreeModel API documentation for text, image, and video models, integrations, guides, and troubleshooting.","colors":{"primary":"#4F46E5","light":"#7C6FF0","dark":"#4F46E5"},"logo":{"light":"https://mintcdn.com/freemodel/7w8_u0KneIRvUPMZ/logo/light.svg?fit=max\u0026auto=format\u0026n=7w8_u0KneIRvUPMZ\u0026q=85\u0026s=fcf236d6f35ffaaf9aeaf391b2fc3ffe","dark":"https://mintcdn.com/freemodel/7w8_u0KneIRvUPMZ/logo/dark.svg?fit=max\u0026auto=format\u0026n=7w8_u0KneIRvUPMZ\u0026q=85\u0026s=a090a2c72503058cad34475464547785"},"favicon":"https://mintcdn.com/freemodel/2JFPcrdyx595AdAq/favicon.svg?fit=max\u0026auto=format\u0026n=2JFPcrdyx595AdAq\u0026q=85\u0026s=9140cf4a97dbc91f0e6d8495d203ec23","api":{"mdx":{"auth":{"method":"bearer"},"server":"https://api.freemodel.app"}},"navbar":{"links":[{"href":"https://freemodel.app/dashboard","label":"Console"}],"primary":{"type":"button","label":"Get API Key","href":"https://freemodel.app/sign-up"}},"footer":{"socials":{"website":"https://freemodel.app"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"freemodel","hasAudioNarration":false,"actualSubdomain":"freemodel","customDomains":["docs.freemodel.app"],"gitSource":{"type":"github","owner":"bytevirts","repo":"freemodel-doc","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"89f073d7-bc5c-48ec-9cd7-2e2d9d441d1c","liveDeploymentHistoryId":"6ac7bf81cd1d8ab9d9586523","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ac7bf81cd1d8ab9d9586523"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac7bf81cd1d8ab9d9586523","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Manual","count":66},{"language":"default","tag":"Video Series","count":35},{"language":"default","tag":"Text Series","count":18},{"language":"default","tag":"Seedance 2.0","count":9},{"language":"default","tag":"GPT-5","count":8},{"language":"default","tag":"Seedance 2.5","count":8},{"language":"default","tag":"Integrations","count":8},{"language":"default","tag":"Veo 3.1","count":7},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Image Series","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"errors","slug":"/errors","pageMetadata":{"title":"Errors","description":"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.","href":"/errors"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`FreeModel returns errors in the OpenAI-compatible envelope. `,_jsx(_components.code,{children:`error.code`}),` is the\nstable machine-readable value; `,_jsx(_components.code,{children:`error.type`}),` groups it.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Wallet balance is insufficient\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_request_error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"param\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"insufficient_funds\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Anthropic Messages (`,_jsx(_components.code,{children:`/v1/messages`}),`) and Gemini native (`,_jsx(_components.code,{children:`/v1beta/...`}),`) requests\nreturn the same HTTP status and message in their protocol’s own error shape\n(`,_jsx(_components.code,{children:`error.type`}),` for Anthropic, `,_jsx(_components.code,{children:`error.status`}),` for Gemini), without `,_jsx(_components.code,{children:`error.code`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`quick-reference`,children:`Quick reference`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`invalid_json`}),`, `,_jsx(_components.code,{children:`invalid_request`}),`, `,_jsx(_components.code,{children:`unsupported_seconds`}),`, `,_jsx(_components.code,{children:`unsupported_resolution`}),`, `,_jsx(_components.code,{children:`unsupported_aspect_ratio`}),`, `,_jsx(_components.code,{children:`unsupported_size`}),`, `,_jsx(_components.code,{children:`image_input_required`}),`, `,_jsx(_components.code,{children:`invalid_image_urls`}),`, `,_jsx(_components.code,{children:`too_many_image_urls`})]}),_jsx(_components.td,{children:`A field is missing or not supported by the selected model.`}),_jsx(_components.td,{children:`Use the values on the model page. Do not retry unchanged.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`invalid_api_key`}),`, `,_jsx(_components.code,{children:`api_key_disabled`}),`, `,_jsx(_components.code,{children:`api_key_revoked`}),`, `,_jsx(_components.code,{children:`api_key_expired`})]}),_jsx(_components.td,{children:`The key is missing, wrong, or no longer active.`}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`Authorization: Bearer \u003ckey>`}),` with an active key.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`insufficient_funds`}),`, `,_jsx(_components.code,{children:`api_key_spend_limit_exceeded`})]}),_jsx(_components.td,{children:`Balance or the key’s spend limit cannot cover the request.`}),_jsx(_components.td,{children:`Add balance or raise the key limit.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`api_key_model_not_allowed`})}),_jsx(_components.td,{children:`The key’s model allowlist excludes this model.`}),_jsx(_components.td,{children:`Edit the key or use an allowed model.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`model_not_available`})}),_jsx(_components.td,{children:`The model is unknown, disabled, or has no live route.`}),_jsxs(_components.td,{children:[`Call `,_jsx(_components.a,{href:`/api-reference/list-models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` and use a returned ID.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`409`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`idempotency_conflict`})}),_jsxs(_components.td,{children:[`An `,_jsx(_components.code,{children:`Idempotency-Key`}),` was reused with a different body.`]}),_jsx(_components.td,{children:`Use a new key for a new request.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`413`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`request_too_large`})}),_jsx(_components.td,{children:`The request body exceeds the size limit.`}),_jsx(_components.td,{children:`Send media as public URLs instead of inline data.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`rate_limit_exceeded`}),`, `,_jsx(_components.code,{children:`api_key_concurrency_exceeded`})]}),_jsx(_components.td,{children:`Too many requests, or too many in flight on one key.`}),_jsxs(_components.td,{children:[`Wait for `,_jsx(_components.code,{children:`Retry-After`}),`, then back off.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`4xx or 502`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`provider_http_error`}),`, `,_jsx(_components.code,{children:`provider_task_failed`})]}),_jsx(_components.td,{children:`The upstream model provider rejected or failed the job; a provider 4xx keeps its status.`}),_jsx(_components.td,{children:`Adjust the prompt or media for a 4xx; retry a 502 later.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`no_eligible_route`}),`, `,_jsx(_components.code,{children:`provider_route_unavailable`})]}),_jsx(_components.td,{children:`No healthy route can serve the model right now.`}),_jsx(_components.td,{children:`Retry with backoff or pick another model.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`400-bad-request`,children:`400 Bad Request`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` The body or parameters do not match the selected model’s contract.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Common causes:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`A `,_jsx(_components.code,{children:`seconds`}),`, `,_jsx(_components.code,{children:`resolution`}),`, `,_jsx(_components.code,{children:`aspect_ratio`}),`, or `,_jsx(_components.code,{children:`size`}),` value the model does not list`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`seconds`}),` sent to a model whose length follows a source clip`]}),`\n`,_jsxs(_components.li,{children:[`Missing required media, such as `,_jsx(_components.code,{children:`image_urls`}),` for an image-to-video model`]}),`\n`,_jsx(_components.li,{children:`Private, local, or non-HTTP media URLs`}),`\n`,_jsxs(_components.li,{children:[`Malformed JSON or a missing `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`messages`}),`, or `,_jsx(_components.code,{children:`prompt`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`How to fix:`}),` open the model page under `,_jsx(_components.strong,{children:`API Manual`}),`, match its allowed\nvalues, and resubmit. Do not blind-retry the same payload.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.freemodel.app/v1/videos`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$FREEMODEL_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gemini-omni-t2v\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"A paper airplane glides through a sunlit library\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seconds\": \"5\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Gemini Omni T2V only accepts `,_jsx(_components.code,{children:`\"10\"`}),`, so this returns `,_jsx(_components.code,{children:`400`}),` with\n`,_jsx(_components.code,{children:`error.code`}),` `,_jsx(_components.code,{children:`unsupported_seconds`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`401-unauthorized`,children:`401 Unauthorized`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` Authentication failed.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`How to fix:`})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Create or rotate a key under `,_jsx(_components.strong,{children:`Console > API Keys`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Send `,_jsx(_components.code,{children:`Authorization: Bearer \u003ckey>`}),` on every request, without quotes or extra whitespace.`]}),`\n`,_jsx(_components.li,{children:`Keep the key on the server only.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`402-payment-required`,children:`402 Payment Required`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` The gateway reserves the maximum possible charge before calling\nthe provider. `,_jsx(_components.code,{children:`insufficient_funds`}),` means your balance cannot cover that\nreservation; `,_jsx(_components.code,{children:`api_key_spend_limit_exceeded`}),` means the key’s own spend limit\nwould be exceeded.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`How to fix:`}),` add balance under `,_jsx(_components.strong,{children:`Console > Billing`}),`, or raise the key’s\nspend limit. For text models, a smaller `,_jsx(_components.code,{children:`max_tokens`}),` (or\n`,_jsx(_components.code,{children:`max_completion_tokens`}),`) lowers the reservation.`]}),`\n`,_jsx(Heading,{level:`2`,id:`404-not-found`,children:`404 Not Found`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` `,_jsx(_components.code,{children:`model_not_available`}),` — the model ID is unknown, disabled, or has\nno live route.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`How to fix:`}),` call `,_jsx(_components.a,{href:`/api-reference/list-models`,children:_jsx(_components.code,{children:`GET /v1/models`})}),` with the\nsame key and copy an ID exactly. Also confirm the protocol: a model is only\nserved on the protocols listed on its page (for example, Gemini models answer\n`,_jsx(_components.code,{children:`generateContent`}),`, GPT-5 models do not).`]}),`\n`,_jsx(Heading,{level:`2`,id:`429-too-many-requests`,children:`429 Too Many Requests`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` `,_jsx(_components.code,{children:`rate_limit_exceeded`}),` (request rate) or\n`,_jsx(_components.code,{children:`api_key_concurrency_exceeded`}),` (requests in flight on one key).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`How to fix:`}),` wait for the `,_jsx(_components.code,{children:`Retry-After`}),` header, then retry with exponential\nbackoff and jitter. Cap parallel video submissions.`]}),`\n`,_jsx(Heading,{level:`2`,id:`502-and-503`,children:`502 and 503`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Meaning:`}),` `,_jsx(_components.code,{children:`502`}),` means the upstream provider failed the request or task\n(`,_jsx(_components.code,{children:`provider_http_error`}),`, `,_jsx(_components.code,{children:`provider_task_failed`}),`). `,_jsx(_components.code,{children:`503`}),` means no healthy route\ncould take it (`,_jsx(_components.code,{children:`no_eligible_route`}),`, `,_jsx(_components.code,{children:`provider_route_unavailable`}),`).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`How to fix:`}),` retry with exponential backoff. For async tasks, check\n`,_jsx(_components.a,{href:`/api-reference/task-status`,children:`task status`}),` before resubmitting so you do not\npay for a duplicate. Contact support with the status, time, model ID, and the\n`,_jsx(_components.code,{children:`x-gateway-execution-id`}),` or task ID — never the API key.`]}),`\n`,_jsx(Heading,{level:`2`,id:`retry-safely`,children:`Retry safely`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Retry?`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400, 401, 403, 404, 409, 413`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Fix the request, key, or model first`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Add balance or raise the key limit`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`Yes`}),_jsxs(_components.td,{children:[`Honor `,_jsx(_components.code,{children:`Retry-After`}),`, then back off`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`502, 503`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`Exponential backoff; cap attempts`})]})]})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Log the HTTP status, `,_jsx(_components.code,{children:`x-gateway-execution-id`}),`, and the complete `,_jsx(_components.code,{children:`error`}),`\nobject. Do not log API keys or sensitive prompt content.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/rate-limits`,children:`Rate limits`}),` — throttle behaviour and backoff`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api-reference/task-status`,children:`Task status`}),` — poll async jobs`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/status`,children:`Service status`}),` — where to check availability`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Errors","description":"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.","href":"/errors"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Quick reference","slug":"quick-reference","depth":2,"children":[]},{"title":"400 Bad Request","slug":"400-bad-request","depth":2,"children":[]},{"title":"401 Unauthorized","slug":"401-unauthorized","depth":2,"children":[]},{"title":"402 Payment Required","slug":"402-payment-required","depth":2,"children":[]},{"title":"404 Not Found","slug":"404-not-found","depth":2,"children":[]},{"title":"429 Too Many Requests","slug":"429-too-many-requests","depth":2,"children":[]},{"title":"502 and 503","slug":"502-and-503","depth":2,"children":[]},{"title":"Retry safely","slug":"retry-safely","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"freemodel","siteName":"FreeModel","title":"Errors - FreeModel","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-26T17:25:13.701Z","originalFileLocation":"errors.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\">\u003cmeta data-mint-head name=\"application-name\" content=\"FreeModel\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Errors - FreeModel\">\u003cmeta data-mint-head property=\"og:description\" content=\"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"FreeModel\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.freemodel.app/errors\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://freemodel.mintlify.app/_mintlify/api/og/v2?division=Development+Guide\u0026amp;title=Errors\u0026amp;description=FreeModel+API+error+codes%3A+causes+and+fixes+for+400%2C+401%2C+402%2C+403%2C+404%2C+429%2C+502%2C+and+503+responses.\u0026amp;theme=bf4a5e80ac9223cc9f3c7019\u0026amp;signature=b7bd1745834568e9582f869a63a69afc00dba4d637239149e57bceb6cb359499\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Errors - FreeModel\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://freemodel.mintlify.app/_mintlify/api/og/v2?division=Development+Guide\u0026amp;title=Errors\u0026amp;description=FreeModel+API+error+codes%3A+causes+and+fixes+for+400%2C+401%2C+402%2C+403%2C+404%2C+429%2C+502%2C+and+503+responses.\u0026amp;theme=bf4a5e80ac9223cc9f3c7019\u0026amp;signature=b7bd1745834568e9582f869a63a69afc00dba4d637239149e57bceb6cb359499\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/freemodel/F9mArZ69D1lo8bcx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"FreeModel\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4F46E5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.freemodel.app/errors\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/errors.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.freemodel.app/#organization\",\"name\":\"FreeModel\",\"url\":\"https://docs.freemodel.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/freemodel/7w8_u0KneIRvUPMZ/logo/light.svg?fit=max\u0026auto=format\u0026n=7w8_u0KneIRvUPMZ\u0026q=85\u0026s=fcf236d6f35ffaaf9aeaf391b2fc3ffe\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.freemodel.app#website\",\"name\":\"FreeModel\",\"url\":\"https://docs.freemodel.app\",\"publisher\":{\"@id\":\"https://docs.freemodel.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.freemodel.app/errors#webpage\",\"url\":\"https://docs.freemodel.app/errors\",\"name\":\"Errors\",\"description\":\"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\",\"dateModified\":\"2026-09-26T17:25:13.701Z\",\"isPartOf\":{\"@id\":\"https://docs.freemodel.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.freemodel.app/errors#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.freemodel.app/errors#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Development Guide\",\"item\":\"https://docs.freemodel.app/guides/video-workflow\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Errors\",\"item\":\"https://docs.freemodel.app/errors\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.freemodel.app/errors#article\",\"headline\":\"Errors\",\"name\":\"Errors\",\"description\":\"FreeModel API error codes: causes and fixes for 400, 401, 402, 403, 404, 429, 502, and 503 responses.\",\"url\":\"https://docs.freemodel.app/errors\",\"mainEntityOfPage\":{\"@id\":\"https://docs.freemodel.app/errors#webpage\"},\"dateModified\":\"2026-09-26T17:25:13.701Z\",\"publisher\":{\"@id\":\"https://docs.freemodel.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.freemodel.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"FreeModel\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"FreeModel","nav":{"global":null,"tabs":[{"tab":"API Manual","pages":[{"title":"API Manual","href":""}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations"}]},{"tab":"Guides","groups":[{"group":"Getting Started","icon":"rocket","pages":[{"title":"Get Started with FreeModel in 5 Minutes (OpenAI-Compatible API)","sidebarTitle":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"}]},{"group":"Development Guide","icon":"book","pages":[{"title":"Build a reliable video workflow","href":"/guides/video-workflow"},{"title":"Billing","href":"/billing"},{"title":"Rate limits","description":"Build reliable clients when request limits apply.","href":"/rate-limits"},{"title":"Errors","href":"/errors"},{"title":"FreeModel Status","sidebarTitle":"Status","description":"How to check FreeModel service status, API health, and where to report outages.","href":"/status"}]}]},{"tab":"FAQs","pages":[{"title":"FAQs","href":"/faqs"}]}]},"title":"Errors - FreeModel","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":[],"chunks":[]}