[{"data":1,"prerenderedAt":959},["ShallowReactive",2],{"navigation_docs_en":3,"-en-api-errors":78,"-en-api-errors-surround":956},[4,25,42,58],{"title":5,"path":6,"stem":7,"children":8,"page":24},"Quick Start","/en/quick-start","en/1.quick-start",[9,12,16,20],{"title":5,"path":10,"stem":11},"/en/quick-start/overview","en/1.quick-start/0.overview",{"title":13,"path":14,"stem":15},"Install and Download","/en/quick-start/install","en/1.quick-start/1.install",{"title":17,"path":18,"stem":19},"First Launch and First Message","/en/quick-start/first-run","en/1.quick-start/2.first-run",{"title":21,"path":22,"stem":23},"macOS Install Guide","/en/quick-start/macos-install","en/1.quick-start/3.macos-install",false,{"title":26,"path":27,"stem":28,"children":29,"page":24},"Manual","/en/manual","en/2.manual",[30,34,38],{"title":31,"path":32,"stem":33},"User Manual","/en/manual/overview","en/2.manual/0.overview",{"title":35,"path":36,"stem":37},"Provider and Model Configuration","/en/manual/providers","en/2.manual/1.providers",{"title":39,"path":40,"stem":41},"Conversation and Context Management","/en/manual/chat-and-context","en/2.manual/2.chat-and-context",{"title":43,"path":44,"stem":45,"children":46,"page":24},"FAQ","/en/faq","en/3.faq",[47,50,54],{"title":43,"path":48,"stem":49},"/en/faq/overview","en/3.faq/0.overview",{"title":51,"path":52,"stem":53},"Privacy Policy","/en/faq/privacy-policy","en/3.faq/1.privacy-policy",{"title":55,"path":56,"stem":57},"Account Deletion","/en/faq/account-deletion","en/3.faq/2.account-deletion",{"title":59,"path":60,"stem":61,"children":62,"page":24},"Developer API","/en/api","en/4.api",[63,66,70,74],{"title":59,"path":64,"stem":65},"/en/api/overview","en/4.api/0.overview",{"title":67,"path":68,"stem":69},"Chat and embeddings","/en/api/chat","en/4.api/1.chat",{"title":71,"path":72,"stem":73},"Images and video","/en/api/images","en/4.api/2.images",{"title":75,"path":76,"stem":77},"Errors, limits and billing","/en/api/errors","en/4.api/3.errors",{"id":79,"title":75,"body":80,"description":949,"extension":950,"links":951,"meta":952,"navigation":953,"path":76,"seo":954,"stem":77,"__hash__":955},"docs_en/en/4.api/3.errors.md",{"type":81,"value":82,"toc":941},"minimark",[83,88,92,322,339,343,570,574,577,655,662,668,672,675,711,721,725,732,752,759,767,856,862,866,869,937],[84,85,87],"h2",{"id":86},"error-shape","Error shape",[89,90,91],"p",{},"Every error uses OpenAI's format:",[93,94,99],"pre",{"className":95,"code":96,"language":97,"meta":98,"style":98},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"error\": {\n    \"message\": \"API key is missing the \\\"images\\\" scope (it has: chat, responses, embeddings). Grant it on the key, or create a new key with this scope.\",\n    \"type\": \"permission_error\",\n    \"code\": \"developer_api_scope_denied\",\n    \"param\": null,\n    \"detail\": {\n      \"requiredScope\": \"images\",\n      \"grantedScopes\": [\"chat\", \"responses\", \"embeddings\"]\n    }\n  }\n}\n","json","",[100,101,102,111,130,168,189,209,224,238,260,304,310,316],"code",{"__ignoreMap":98},[103,104,107],"span",{"class":105,"line":106},"line",1,[103,108,110],{"class":109},"sMK4o","{\n",[103,112,114,117,121,124,127],{"class":105,"line":113},2,[103,115,116],{"class":109},"  \"",[103,118,120],{"class":119},"spNyl","error",[103,122,123],{"class":109},"\"",[103,125,126],{"class":109},":",[103,128,129],{"class":109}," {\n",[103,131,133,136,140,142,144,147,151,155,158,160,163,165],{"class":105,"line":132},3,[103,134,135],{"class":109},"    \"",[103,137,139],{"class":138},"sBMFI","message",[103,141,123],{"class":109},[103,143,126],{"class":109},[103,145,146],{"class":109}," \"",[103,148,150],{"class":149},"sfazB","API key is missing the ",[103,152,154],{"class":153},"sTEyZ","\\\"",[103,156,157],{"class":149},"images",[103,159,154],{"class":153},[103,161,162],{"class":149}," scope (it has: chat, responses, embeddings). Grant it on the key, or create a new key with this scope.",[103,164,123],{"class":109},[103,166,167],{"class":109},",\n",[103,169,171,173,176,178,180,182,185,187],{"class":105,"line":170},4,[103,172,135],{"class":109},[103,174,175],{"class":138},"type",[103,177,123],{"class":109},[103,179,126],{"class":109},[103,181,146],{"class":109},[103,183,184],{"class":149},"permission_error",[103,186,123],{"class":109},[103,188,167],{"class":109},[103,190,192,194,196,198,200,202,205,207],{"class":105,"line":191},5,[103,193,135],{"class":109},[103,195,100],{"class":138},[103,197,123],{"class":109},[103,199,126],{"class":109},[103,201,146],{"class":109},[103,203,204],{"class":149},"developer_api_scope_denied",[103,206,123],{"class":109},[103,208,167],{"class":109},[103,210,212,214,217,219,221],{"class":105,"line":211},6,[103,213,135],{"class":109},[103,215,216],{"class":138},"param",[103,218,123],{"class":109},[103,220,126],{"class":109},[103,222,223],{"class":109}," null,\n",[103,225,227,229,232,234,236],{"class":105,"line":226},7,[103,228,135],{"class":109},[103,230,231],{"class":138},"detail",[103,233,123],{"class":109},[103,235,126],{"class":109},[103,237,129],{"class":109},[103,239,241,244,248,250,252,254,256,258],{"class":105,"line":240},8,[103,242,243],{"class":109},"      \"",[103,245,247],{"class":246},"sbssI","requiredScope",[103,249,123],{"class":109},[103,251,126],{"class":109},[103,253,146],{"class":109},[103,255,157],{"class":149},[103,257,123],{"class":109},[103,259,167],{"class":109},[103,261,263,265,268,270,272,275,277,280,282,285,287,290,292,294,296,299,301],{"class":105,"line":262},9,[103,264,243],{"class":109},[103,266,267],{"class":246},"grantedScopes",[103,269,123],{"class":109},[103,271,126],{"class":109},[103,273,274],{"class":109}," [",[103,276,123],{"class":109},[103,278,279],{"class":149},"chat",[103,281,123],{"class":109},[103,283,284],{"class":109},",",[103,286,146],{"class":109},[103,288,289],{"class":149},"responses",[103,291,123],{"class":109},[103,293,284],{"class":109},[103,295,146],{"class":109},[103,297,298],{"class":149},"embeddings",[103,300,123],{"class":109},[103,302,303],{"class":109},"]\n",[103,305,307],{"class":105,"line":306},10,[103,308,309],{"class":109},"    }\n",[103,311,313],{"class":105,"line":312},11,[103,314,315],{"class":109},"  }\n",[103,317,319],{"class":105,"line":318},12,[103,320,321],{"class":109},"}\n",[323,324,325,335,336,338],"tip",{},[326,327,328,329,331,332,334],"strong",{},"Read ",[100,330,139],{}," and ",[100,333,231],{}," first."," On 4xx responses those two fields say exactly what to do\nnext: which scope is missing, which task to poll, which parameter is wrong. Don't guess from ",[100,337,100],{},"\nalone.",[84,340,342],{"id":341},"common-error-codes","Common error codes",[344,345,346,363],"table",{},[347,348,349],"thead",{},[350,351,352,357,360],"tr",{},[353,354,355],"th",{},[100,356,100],{},[353,358,359],{},"HTTP",[353,361,362],{},"Meaning",[364,365,366,380,392,404,417,428,440,456,471,484,497,509,521,541,554],"tbody",{},[350,367,368,374,377],{},[369,370,371],"td",{},[100,372,373],{},"invalid_api_key",[369,375,376],{},"401",[369,378,379],{},"Wrong or revoked key. Check you copied all of it",[350,381,382,387,389],{},[369,383,384],{},[100,385,386],{},"api_key_disabled",[369,388,376],{},[369,390,391],{},"The key was disabled",[350,393,394,399,401],{},[369,395,396],{},[100,397,398],{},"api_key_expired",[369,400,376],{},[369,402,403],{},"The key expired",[350,405,406,411,414],{},[369,407,408],{},[100,409,410],{},"api_key_ip_not_allowed",[369,412,413],{},"403",[369,415,416],{},"Your egress IP is not on this key's IP allowlist",[350,418,419,423,425],{},[369,420,421],{},[100,422,204],{},[369,424,413],{},[369,426,427],{},"The key lacks the scope this endpoint needs — see below",[350,429,430,435,437],{},[369,431,432],{},[100,433,434],{},"model_not_allowed",[369,436,413],{},[369,438,439],{},"The key has a model allowlist that excludes this model",[350,441,442,447,450],{},[369,443,444],{},[100,445,446],{},"model_not_found",[369,448,449],{},"404",[369,451,452,453],{},"No such model, or your account cannot use it. Call ",[100,454,455],{},"GET /v1/models",[350,457,458,463,465],{},[369,459,460],{},[100,461,462],{},"insufficient_credits",[369,464,413],{},[369,466,467,468,470],{},"Not enough balance. ",[100,469,231],{}," carries the amount needed and your balance",[350,472,473,478,481],{},[369,474,475],{},[100,476,477],{},"model_pricing_required",[369,479,480],{},"503",[369,482,483],{},"The model has no price configured — contact an administrator",[350,485,486,491,494],{},[369,487,488],{},[100,489,490],{},"rate_limit_exceeded",[369,492,493],{},"429",[369,495,496],{},"A rate or quota limit was hit; back off and retry",[350,498,499,504,506],{},[369,500,501],{},[100,502,503],{},"daily_spend_limit_exceeded",[369,505,493],{},[369,507,508],{},"This key's daily spend cap was reached",[350,510,511,516,518],{},[369,512,513],{},[100,514,515],{},"monthly_spend_limit_exceeded",[369,517,493],{},[369,519,520],{},"This key's monthly spend cap was reached",[350,522,523,528,531],{},[369,524,525],{},[100,526,527],{},"image_generation_timeout",[369,529,530],{},"504",[369,532,533,534,537,538],{},"Image wait timed out, but ",[326,535,536],{},"the task is still running"," — use ",[100,539,540],{},"detail.taskId",[350,542,543,548,551],{},[369,544,545],{},[100,546,547],{},"upstream_unavailable",[369,549,550],{},"502 / 503",[369,552,553],{},"The upstream model provider failed; retryable",[350,555,556,561,564],{},[369,557,558],{},[100,559,560],{},"bad_request",[369,562,563],{},"400",[369,565,566,567,569],{},"Bad parameters; ",[100,568,139],{}," names the field",[84,571,573],{"id":572},"scopes","Scopes",[89,575,576],{},"Each key carries a set of scopes that decide which endpoints it can reach:",[344,578,579,589],{},[347,580,581],{},[350,582,583,586],{},[353,584,585],{},"Scope",[353,587,588],{},"Endpoints",[364,590,591,602,613,624,640],{},[350,592,593,597],{},[369,594,595],{},[100,596,279],{},[369,598,599],{},[100,600,601],{},"/v1/chat/completions",[350,603,604,608],{},[369,605,606],{},[100,607,289],{},[369,609,610],{},[100,611,612],{},"/v1/responses",[350,614,615,619],{},[369,616,617],{},[100,618,298],{},[369,620,621],{},[100,622,623],{},"/v1/embeddings",[350,625,626,630],{},[369,627,628],{},[100,629,157],{},[369,631,632,635,636,639],{},[100,633,634],{},"/v1/images/generations",", ",[100,637,638],{},"/v1/tasks"," (images)",[350,641,642,647],{},[369,643,644],{},[100,645,646],{},"videos",[369,648,649,635,652,654],{},[100,650,651],{},"/v1/videos",[100,653,638],{}," (video)",[89,656,657,658,661],{},"New keys get all of the above by default. The ",[100,659,660],{},"audio"," scope has no endpoint behind it yet.",[663,664,665,667],"note",{},[100,666,455],{}," is filtered by scope too — a chat-only key won't see image models in the list. So\n\"my model isn't in the list\" is usually a scope problem, not a missing model.",[84,669,671],{"id":670},"limits","Limits",[89,673,674],{},"Each key can carry its own:",[676,677,678,685,690,699,705],"ul",{},[679,680,681,684],"li",{},[326,682,683],{},"RPM"," — requests per minute",[679,686,687],{},[326,688,689],{},"Daily request count",[679,691,692,695,696],{},[326,693,694],{},"Daily spend cap"," / ",[326,697,698],{},"monthly spend cap",[679,700,701,704],{},[326,702,703],{},"Model allowlist"," — only the listed models",[679,706,707,710],{},[326,708,709],{},"IP allowlist"," — only calls from the listed addresses",[89,712,713,714,717,718,720],{},"Individual models may also carry daily quotas (request counts, image counts). Hitting one returns\n",[100,715,716],{},"429 rate_limit_exceeded","; the ",[100,719,139],{}," says which limit it was.",[84,722,724],{"id":723},"billing","Billing",[89,726,727,728,731],{},"Calls are charged against your ",[326,729,730],{},"account balance"," — the same balance the built-in AI uses in the\nBotHub apps.",[676,733,734,740,746],{},[679,735,736,739],{},[326,737,738],{},"Chat / embeddings"," — per token, with separate input, output and cache-hit rates",[679,741,742,745],{},[326,743,744],{},"Images"," — per image",[679,747,748,751],{},[326,749,750],{},"Video"," — per the model's configured billing unit (duration and so on)",[89,753,754,755,758],{},"Incoming requests ",[326,756,757],{},"reserve a deposit"," first, then settle against actual usage once finished;\nanything beyond the deposit is still charged. That's why the balance sometimes dips and then\npartially returns — it is working as intended.",[89,760,761,762,764,765,126],{},"When the balance is short you get ",[100,763,462],{},", with the required amount and your current\nbalance (in cents) in ",[100,766,231],{},[93,768,770],{"className":95,"code":769,"language":97,"meta":98,"style":98},"{\n  \"error\": {\n    \"code\": \"insufficient_credits\",\n    \"detail\": { \"requiredFen\": 320, \"balanceFen\": 95 }\n  }\n}\n",[100,771,772,776,788,806,848,852],{"__ignoreMap":98},[103,773,774],{"class":105,"line":106},[103,775,110],{"class":109},[103,777,778,780,782,784,786],{"class":105,"line":113},[103,779,116],{"class":109},[103,781,120],{"class":119},[103,783,123],{"class":109},[103,785,126],{"class":109},[103,787,129],{"class":109},[103,789,790,792,794,796,798,800,802,804],{"class":105,"line":132},[103,791,135],{"class":109},[103,793,100],{"class":138},[103,795,123],{"class":109},[103,797,126],{"class":109},[103,799,146],{"class":109},[103,801,462],{"class":149},[103,803,123],{"class":109},[103,805,167],{"class":109},[103,807,808,810,812,814,816,819,821,824,826,828,831,833,835,838,840,842,845],{"class":105,"line":170},[103,809,135],{"class":109},[103,811,231],{"class":138},[103,813,123],{"class":109},[103,815,126],{"class":109},[103,817,818],{"class":109}," {",[103,820,146],{"class":109},[103,822,823],{"class":246},"requiredFen",[103,825,123],{"class":109},[103,827,126],{"class":109},[103,829,830],{"class":246}," 320",[103,832,284],{"class":109},[103,834,146],{"class":109},[103,836,837],{"class":246},"balanceFen",[103,839,123],{"class":109},[103,841,126],{"class":109},[103,843,844],{"class":246}," 95",[103,846,847],{"class":109}," }\n",[103,849,850],{"class":105,"line":191},[103,851,315],{"class":109},[103,853,854],{"class":105,"line":211},[103,855,321],{"class":109},[89,857,858,861],{},[326,859,860],{},"The easiest place to check usage is the same screen where you created the key"," — \"External\nAccess\" in the app lists each key's request count, token count and spend over the last 7 days.",[84,863,865],{"id":864},"debugging-order","Debugging order",[89,867,868],{},"Work through this list — the first two steps catch most problems:",[870,871,872,888,900,909,918,931],"ol",{},[679,873,874,880],{},[326,875,876,877,879],{},"Does ",[100,878,455],{}," work?",[676,881,882,885],{},[679,883,884],{},"401 → a key problem (truncated, revoked, expired)",[679,886,887],{},"It works but your model isn't listed → a scope or account permission problem",[679,889,890,893,894,897,898],{},[326,891,892],{},"Model is listed but the call fails?"," Check its ",[100,895,896],{},"endpoints"," field — an image model will never\nanswer on ",[100,899,601],{},[679,901,902,905,906,908],{},[326,903,904],{},"403?"," Read ",[100,907,139],{},": it says whether the missing piece is a scope, the IP allowlist, or\nbalance",[679,910,911,914,915,917],{},[326,912,913],{},"429?"," Could be RPM, daily requests, a spend cap or a model quota; ",[100,916,139],{}," says which. Back\noff and retry",[679,919,920,923,924,926,927,930],{},[326,921,922],{},"504 on image generation?"," Nothing failed — fetch the result with ",[100,925,540],{}," via\n",[100,928,929],{},"GET /v1/tasks/{id}",", and raise your client timeout",[679,932,933,936],{},[326,934,935],{},"502 / 503?"," Upstream provider trouble; retry after a backoff",[938,939,940],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":98,"searchDepth":113,"depth":113,"links":942},[943,944,945,946,947,948],{"id":86,"depth":113,"text":87},{"id":341,"depth":113,"text":342},{"id":572,"depth":113,"text":573},{"id":670,"depth":113,"text":671},{"id":723,"depth":113,"text":724},{"id":864,"depth":113,"text":865},"Error codes, a debugging order, rate and spend limits, and how the balance is charged.","md",null,{},true,{"title":75,"description":949},"OogbhxgW2AGfZVbnmtRh-gClefwAtcO9G9J_wvbNPOM",[957,951],{"title":71,"path":72,"stem":73,"description":958},"Synchronous image generation, async tasks, editing and video.",1790522413617]