Understand the HTTP status codes the API returns and how to handle them.
The Hypercove API uses standard HTTP status codes. Errors return a JSON body with an error object describing what went wrong.
{ "error": { "message": "You have insufficient credits to complete this request.", "type": "insufficient_quota", "code": "insufficient_quota", "param": null }}
The code is a machine-readable string (for example invalid_api_key, model_not_found, or insufficient_quota), not the HTTP status, and it may be null. Match on the HTTP status code for routing, and on error.code for specifics.
Request rate limits depend on your plan and apply across all of your API keys together. If you exceed your limit, requests return 429 until the window resets, and the blocked request is not charged. Back off and retry with exponential backoff (see below), and upgrade your plan for a higher limit.
A few errors are specific to the image, video, and music APIs:
400 PROMPT_TOO_LONG: the prompt exceeds the model’s prompt_max_length. Each model’s limit is in GET /v1/models and on its model page. Shorten the prompt.
400 for unsupported parameters or values: for example a resolution or duration the model doesn’t offer. Check the model’s allowed values in GET /v1/models.
Video and music jobs fail differently from synchronous requests. Creating the job succeeds, and the failure appears later, when polling: a normal 200 response with status: "failed" and an error object.
{ "id": "vid_a1b2c3...", "object": "video", "status": "failed", "error": { "message": "A description of what went wrong" }}
Always check status when polling; an HTTP-level check alone won’t catch it. A failed job is not charged. To retry, fix whatever the error describes and create a new job.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hypercove API","colors":{"primary":"#3944FF","light":"#B6D2FF","dark":"#3944FF"},"logo":{"light":"https://mintcdn.com/evermindlabs/p_sXKDu5CAkrSu37/logo/light.svg?fit=max\u0026auto=format\u0026n=p_sXKDu5CAkrSu37\u0026q=85\u0026s=a21b83c75c0e3762f4265f993febeea5","dark":"https://mintcdn.com/evermindlabs/p_sXKDu5CAkrSu37/logo/dark.svg?fit=max\u0026auto=format\u0026n=p_sXKDu5CAkrSu37\u0026q=85\u0026s=14713104ca98e4720cbd734584919539","href":"https://deepshi.ai/"},"favicon":"https://mintcdn.com/evermindlabs/p_sXKDu5CAkrSu37/favicon.svg?fit=max\u0026auto=format\u0026n=p_sXKDu5CAkrSu37\u0026q=85\u0026s=ed87a1b3840659895b7af3f0b79420b5","appearance":{"default":"dark"},"background":{"color":{"light":"#FFFFFF","dark":"#0A0A0A"}},"navbar":{"primary":{"type":"button","label":"Get API key","href":"https://deepshi.ai/"}},"footer":{"socials":{"x":"https://x.com/deepshi_ai","discord":"https://discord.gg/xmMJRbcRKB","instagram":"https://www.instagram.com/deepshi.ai","youtube":"https://www.youtube.com/@deepshi_ai"}},"seo":{"metatags":{"og:site_name":"Hypercove API","og:type":"website","og:image":"/images/og.png","og:image:width":"1200","og:image:height":"630","twitter:card":"summary_large_image","twitter:image":"/images/og.png"},"indexing":"all"},"fonts":{"family":"Roboto"},"banner":{"content":"Unrestricted image \u0026 video generation is now live in the API. [Browse the models →](/models/overview)","dismissible":true,"color":{"light":"#3944FF","dark":"#3944FF"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","grok","aistudio","mcp","cursor","vscode","download-spec"],"display":"header"},"markdown":{"instructions":"The Hypercove API is an OpenAI-compatible gateway. Base URL: https://api.deepshi.ai/v1. API keys start with sk-bf- and go in the Authorization: Bearer header. Prefer the official OpenAI SDKs pointed at the Hypercove base URL. Model ids are clean with no provider prefix (e.g. deepshi-3.0, claude-opus-4.8, gpt-5.5). Chat and image requests are synchronous; video and music requests are asynchronous job APIs (create, then poll). Every synchronous response carries usage.cost.total_cost in USD. Do not reference the internal /api/* admin plane or virtual keys."},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"evermindlabs","hasAudioNarration":false,"actualSubdomain":"evermindlabs","customDomains":["docs.deepshi.ai"],"gitSource":{"type":"github","owner":"deepshi-ai","repo":"deepshi-api-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aecd3f720ef8f1b4c25f0d2","clientVersion":"0.0.4088","searchFilterCounts":[{"language":"default","tag":"Guides","count":18},{"language":"default","tag":"API reference","count":13},{"language":"default","tag":"Models","count":11},{"language":"default","tag":"Endpoints","count":11},{"language":"default","tag":"Documentation","count":8},{"language":"default","tag":"Integrations","count":8},{"language":"default","tag":"Chat","count":5},{"language":"default","tag":"Media","count":4},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Videos","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"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":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"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":"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":"turbopuffer-dual-write","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},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm3CWWoKC.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm3mWWoKC.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm36WWoKC.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm3KWWoKC.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm3OWWoKC.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: italic;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x7DF4xlVMF-BfR8bXMIjhOm32WWg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhGq3-OXg.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhPq3-OXg.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhIq3-OXg.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhEq3-OXg.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhFq3-OXg.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto Mono';\n font-style: normal;\n font-weight: 400 700;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotomono/v31/L0x5DF4xlVMF-BfR8bXMIjhLq38.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Roboto Serif';\n font-style: italic;\n font-weight: 400 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotoserif/v17/R705jywflP6FLr3gZx7K8UyEVQnyR1E7VN-f51xYuGCQepO9CRLLcmv0wAqC-w8kpEzi.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Roboto Serif';\n font-style: italic;\n font-weight: 400 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotoserif/v17/R705jywflP6FLr3gZx7K8UyEVQnyR1E7VN-f51xYuGCQepO9CRLLcmv0wAqC-wYkpEzi.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Roboto Serif';\n font-style: italic;\n font-weight: 400 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotoserif/v17/R705jywflP6FLr3gZx7K8UyEVQnyR1E7VN-f51xYuGCQepO9CRLLcmv0wAqC-w0kpEzi.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Roboto Serif';\n font-style: italic;\n font-weight: 400 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotoserif/v17/R705jywflP6FLr3gZx7K8UyEVQnyR1E7VN-f51xYuGCQepO9CRLLcmv0wAqC-wwkpEzi.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Roboto Serif';\n font-style: italic;\n font-weight: 400 600;\n font-stretch: 100%;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/robotoserif/v17/R705jywflP6FLr3gZx7K8UyEVQnyR1E7VN-f51xYuGCQepO9CRLLcmv0wAqC-wIkpA.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\ncode,pre,kbd,samp,.font-mono,.code-block,.code-block *{font-family:\"Roboto Mono\", ui-monospace, SFMono-Regular, Menlo, monospace!important}a:has(>img.nav-logo){display:flex;align-items:center;gap:0.5rem}.hc-title{font-family:\"Roboto\", sans-serif;font-size:1.25rem;font-weight:500;line-height:1;letter-spacing:-0.01em;white-space:nowrap;color:#161a22}.dark .hc-title{color:#ffffff}.hc-title-cove{font-family:\"Roboto Serif\", Georgia, serif;font-style:italic;font-weight:500}"}],"page":{"pagePath":"resources/errors","slug":"/resources/errors","pageMetadata":{"title":"Errors \u0026 status codes","description":"Understand the HTTP status codes the API returns and how to handle them.","icon":"triangle-exclamation","href":"/resources/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: \"Understand the HTTP status codes the API returns and how to handle them.\"\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`,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,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The Hypercove API uses standard HTTP status codes. Errors return a JSON body with an `,_jsx(_components.code,{children:`error`}),` object describing what went wrong.`]}),`\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:`\"You have insufficient credits to complete this request.\"`}),_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:`\"insufficient_quota\"`}),_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_quota\"`}),_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`})]}),`\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:[`The `,_jsx(_components.code,{children:`code`}),` is a machine-readable string (for example `,_jsx(_components.code,{children:`invalid_api_key`}),`, `,_jsx(_components.code,{children:`model_not_found`}),`, or `,_jsx(_components.code,{children:`insufficient_quota`}),`), not the HTTP status, and it may be `,_jsx(_components.code,{children:`null`}),`. Match on the HTTP status code for routing, and on `,_jsx(_components.code,{children:`error.code`}),` for specifics.`]}),`\n`,_jsx(Heading,{level:`2`,id:`status-codes`,children:`Status codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`200 OK`})}),_jsx(_components.td,{children:`Success`}),_jsx(_components.td,{children:`Nothing to do.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`400 Bad Request`})}),_jsx(_components.td,{children:`Malformed request, or a model id that doesn’t exist in the catalog`}),_jsxs(_components.td,{children:[`Check your JSON body and that `,_jsx(_components.code,{children:`model`}),` is a valid catalog id.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`401 Unauthorized`})}),_jsx(_components.td,{children:`Missing, malformed, or unknown API key`}),_jsxs(_components.td,{children:[`Verify the `,_jsx(_components.code,{children:`Authorization: Bearer YOUR_DEEPSHI_API_KEY`}),` header.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`402 Payment Required`})}),_jsx(_components.td,{children:`Out of credits`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/get-started/pricing-credits`,children:`Top up your balance.`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`403 Forbidden`})}),_jsx(_components.td,{children:`Key revoked or inactive, or not allowed to use the requested model`}),_jsxs(_components.td,{children:[`Use an active key, and check the model is one your key can call (`,_jsx(_components.code,{children:`GET /v1/models`}),`).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`429 Too Many Requests`})}),_jsx(_components.td,{children:`Rate limit exceeded`}),_jsx(_components.td,{children:`Back off and retry with exponential backoff.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`5xx`})}),_jsx(_components.td,{children:`Temporary server error`}),_jsx(_components.td,{children:`Retry with backoff.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsxs(_components.p,{children:[`Request rate limits depend on your `,_jsx(_components.strong,{children:`plan`}),` and apply across `,_jsx(_components.strong,{children:`all of your API keys`}),` together. If you exceed your limit, requests return `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`429`})}),` until the window resets, and the blocked request is `,_jsx(_components.strong,{children:`not charged`}),`. Back off and retry with exponential backoff (see below), and upgrade your plan for a higher limit.`]}),`\n`,_jsx(Heading,{level:`2`,id:`handling-errors-in-code`,children:`Handling errors in code`}),`\n`,_jsxs(_components.p,{children:[`Retry transient failures (`,_jsx(_components.code,{children:`429`}),` and `,_jsx(_components.code,{children:`5xx`}),`) with exponential backoff, and surface the others to the user:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI, APIStatusError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.deepshi.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_DEEPSHI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` chat_with_retry`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messages`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retries`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` attempt `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` range`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(retries):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"deepshi-3.0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`messages,`})]}),`\n`,_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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` APIStatusError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e.status_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`429`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`500`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`502`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`503`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`and`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` attempt `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` retries `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` **`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` attempt) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# backoff`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` continue`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Don’t retry `,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`401`}),`, `,_jsx(_components.code,{children:`402`}),`, or `,_jsx(_components.code,{children:`403`}),`. They won’t succeed on retry. Fix\nthe request, key, balance, or model access instead.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`media-specific-errors`,children:`Media-specific errors`}),`\n`,_jsx(_components.p,{children:`A few errors are specific to the image, video, and music APIs:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`400 PROMPT_TOO_LONG`})}),`: the prompt exceeds the model’s `,_jsx(_components.code,{children:`prompt_max_length`}),`. Each model’s limit is in `,_jsx(_components.code,{children:`GET /v1/models`}),` and on its `,_jsx(_components.a,{href:`/models/overview`,children:`model page`}),`. Shorten the prompt.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`400`}),` for unsupported parameters or values`]}),`: for example a `,_jsx(_components.code,{children:`resolution`}),` or `,_jsx(_components.code,{children:`duration`}),` the model doesn’t offer. Check the model’s allowed values in `,_jsx(_components.code,{children:`GET /v1/models`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`async-job-failures`,children:`Async job failures`}),`\n`,_jsxs(_components.p,{children:[`Video and music jobs fail differently from synchronous requests. Creating the job succeeds, and the failure appears later, when polling: a normal `,_jsx(_components.code,{children:`200`}),` response with `,_jsx(_components.code,{children:`status: \"failed\"`}),` and an `,_jsx(_components.code,{children:`error`}),` object.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"vid_a1b2c3...\"`}),_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:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"video\"`}),_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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"failed\"`}),_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:`: { `}),_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:`\"A description of what went wrong\"`}),_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:[`Always check `,_jsx(_components.code,{children:`status`}),` when polling; an HTTP-level check alone won’t catch it. A failed job is `,_jsx(_components.strong,{children:`not charged`}),`. To retry, fix whatever the `,_jsx(_components.code,{children:`error`}),` describes and create a new job.`]})]})}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 \u0026 status codes","description":"Understand the HTTP status codes the API returns and how to handle them.","icon":"triangle-exclamation","href":"/resources/errors"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Status codes","slug":"status-codes","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Handling errors in code","slug":"handling-errors-in-code","depth":2,"children":[]},{"title":"Media-specific errors","slug":"media-specific-errors","depth":2,"children":[]},{"title":"Async job failures","slug":"async-job-failures","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/evermindlabs/7620412dc2f55d5a/brand.js"],"subdomain":"evermindlabs","siteName":"Hypercove API","title":"Errors \u0026 status codes - Hypercove API","contextualStarterQuestions":[{"_id":"6ae50cc4a37ec26db9e1cdb4","deploymentId":"6a2a7bbbb64010c28d316271","questionText":"How do I fix 401 errors?","status":"active","generatedBy":"contextual","path":"resources/errors","createdAt":"2026-10-30T21:31:48.266Z","updatedAt":"2026-10-30T21:31:48.266Z","__v":0},{"_id":"6ae50cc4a37ec26db9e1cdb5","deploymentId":"6a2a7bbbb64010c28d316271","questionText":"What's a 429 status code?","status":"active","generatedBy":"contextual","path":"resources/errors","createdAt":"2026-10-30T21:31:48.266Z","updatedAt":"2026-10-30T21:31:48.266Z","__v":0},{"_id":"6ae50cc4a37ec26db9e1cdb3","deploymentId":"6a2a7bbbb64010c28d316271","questionText":"What do error codes mean?","status":"active","generatedBy":"contextual","path":"resources/errors","createdAt":"2026-10-30T21:31:48.266Z","updatedAt":"2026-10-30T21:31:48.266Z","__v":0}],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T21:31:43.731Z","originalFileLocation":"resources/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=\"dark\"}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=\"Understand the HTTP status codes the API returns and how to handle them.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hypercove API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_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/evermindlabs/FPC7T9BT8vHKfv2i/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Errors \u0026amp; status codes - Hypercove API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Understand the HTTP status codes the API returns and how to handle them.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hypercove API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.deepshi.ai/resources/errors\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://evermindlabs.mintlify.site/images/og.png\">\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 \u0026amp; status codes - Hypercove API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Understand the HTTP status codes the API returns and how to handle them.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://evermindlabs.mintlify.site/images/og.png\">\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/evermindlabs/FPC7T9BT8vHKfv2i/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hypercove API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3944FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.deepshi.ai/resources/errors\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/resources/errors.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.deepshi.ai/#organization\",\"name\":\"Hypercove API\",\"url\":\"https://docs.deepshi.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/evermindlabs/p_sXKDu5CAkrSu37/logo/light.svg?fit=max\u0026auto=format\u0026n=p_sXKDu5CAkrSu37\u0026q=85\u0026s=a21b83c75c0e3762f4265f993febeea5\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.deepshi.ai#website\",\"name\":\"Hypercove API\",\"url\":\"https://docs.deepshi.ai\",\"publisher\":{\"@id\":\"https://docs.deepshi.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.deepshi.ai/resources/errors#webpage\",\"url\":\"https://docs.deepshi.ai/resources/errors\",\"name\":\"Errors \u0026 status codes\",\"description\":\"Understand the HTTP status codes the API returns and how to handle them.\",\"dateModified\":\"2026-10-30T21:31:43.731Z\",\"isPartOf\":{\"@id\":\"https://docs.deepshi.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.deepshi.ai/resources/errors#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.deepshi.ai/resources/errors#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Reference\",\"item\":\"https://docs.deepshi.ai/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Errors \u0026 status codes\",\"item\":\"https://docs.deepshi.ai/resources/errors\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.deepshi.ai/resources/errors#article\",\"headline\":\"Errors \u0026 status codes\",\"name\":\"Errors \u0026 status codes\",\"description\":\"Understand the HTTP status codes the API returns and how to handle them.\",\"url\":\"https://docs.deepshi.ai/resources/errors\",\"mainEntityOfPage\":{\"@id\":\"https://docs.deepshi.ai/resources/errors#webpage\"},\"image\":\"https://docs.deepshi.ai/images/og.png\",\"dateModified\":\"2026-10-30T21:31:43.731Z\",\"publisher\":{\"@id\":\"https://docs.deepshi.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.deepshi.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hypercove API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hypercove API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/capabilities/text-and-chat"}]},{"tab":"Models","pages":[{"title":"Models","href":"/models/overview"}]},{"tab":"API reference","groups":[{"group":"Reference","pages":[{"title":"API reference","description":"Endpoints, request shapes, and conventions for the Hypercove API.","icon":"book-open","href":"/api-reference/introduction"},{"title":"Errors \u0026 status codes","icon":"triangle-exclamation","href":"/resources/errors"}]},{"group":"Endpoints","pages":[{"group":"Models","pages":[{"title":"List available models","description":"Lists the models the authenticated key is allowed to call. Each entry's `id` is the value to pass as `model` on a request.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/models","href":"/api-reference/models/list-available-models"}]},{"group":"Chat","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/chat/completions","href":"/api-reference/chat/create-a-chat-completion"}]},{"group":"Images","pages":[{"title":"Generate an image","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/images/generations","href":"/api-reference/images/generate-an-image"},{"title":"Edit an image","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/images/edits","href":"/api-reference/images/edit-an-image"}]},{"group":"Videos","pages":[{"title":"Create a video job","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/videos","href":"/api-reference/videos/create-a-video-job"},{"title":"Retrieve a video job","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/videos/{video_id}","href":"/api-reference/videos/retrieve-a-video-job"},{"title":"Cancel or delete a video job","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/videos/{video_id}","href":"/api-reference/videos/cancel-or-delete-a-video-job"},{"title":"Download the finished video","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/videos/{video_id}/content","href":"/api-reference/videos/download-the-finished-video"}]},{"group":"Music","pages":[{"title":"Create a music job","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/audio/generations","href":"/api-reference/music/create-a-music-job"},{"title":"Retrieve a music job","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/audio/generations/{audio_id}","href":"/api-reference/music/retrieve-a-music-job"},{"title":"Download the finished song","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/audio/generations/{audio_id}/content","href":"/api-reference/music/download-the-finished-song"}]}]}]}]},"basePath":"","title":"Errors \u0026 status codes - Hypercove API","buildId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","deploymentId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","dynamics":["10e4515597"],"chunks":["BannerMarkdown-Cj6eAYhz.js","dist-CdrJecqK.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-D-TRO5q5.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}