[{"data":1,"prerenderedAt":1254},["ShallowReactive",2],{"docs-nav-titles":3,"page-docs_en-\u002Fguides\u002Ferrors":52},{"en":4,"id":39},{"\u002Fauthentication":5,"\u002Fchangelog":6,"\u002Fguides\u002Fbilling":7,"\u002Fguides\u002Ferrors":8,"\u002Fguides\u002Fjson-output":9,"\u002Fguides\u002Frate-limits":10,"\u002Fguides\u002Freasoning":11,"\u002Fguides\u002Fstreaming":12,"\u002Fguides\u002Ftool-calling":13,"\u002Fguides\u002Ftop-up":14,"\u002F":15,"\u002Fintegrations\u002Faider":16,"\u002Fintegrations\u002Fclaude-code":17,"\u002Fintegrations\u002Fcline":18,"\u002Fintegrations\u002Fcontinue":19,"\u002Fintegrations\u002Fgoose":20,"\u002Fintegrations\u002Fhermes":21,"\u002Fintegrations":22,"\u002Fintegrations\u002Fkilo-code":23,"\u002Fintegrations\u002Flangchain":24,"\u002Fintegrations\u002Foh-my-pi":25,"\u002Fintegrations\u002Fopenai-sdk":26,"\u002Fintegrations\u002Fopenclaw":27,"\u002Fintegrations\u002Fopencode":28,"\u002Fintegrations\u002Fpi":29,"\u002Fintegrations\u002Fvercel-ai-sdk":30,"\u002Fintegrations\u002Fzed":31,"\u002Fmodels":32,"\u002Fquickstart":33,"\u002Freference\u002Fchat-completions":34,"\u002Freference":22,"\u002Freference\u002Fmessages":35,"\u002Freference\u002Fmodels":36,"\u002Freference\u002Fmodels-retrieve":37,"\u002Fsupport":38},"Authentication","Changelog","Billing","Errors & retries","JSON output","Rate limits","Reasoning content","Streaming","Tool calling","Topping up with QRIS","Introduction","Aider","Claude Code","Cline","Continue","Goose","Hermes Agent","Overview","Kilo Code","LangChain (Python)","Oh My Pi","OpenAI SDKs","OpenClaw","OpenCode","Pi","Vercel AI SDK","Zed","Models","Quickstart","Chat completions","Messages","List models","Retrieve a model","Support",{"\u002Fauthentication":40,"\u002Fchangelog":6,"\u002Fguides\u002Fbilling":7,"\u002Fguides\u002Ferrors":41,"\u002Fguides\u002Fjson-output":42,"\u002Fguides\u002Frate-limits":43,"\u002Fguides\u002Freasoning":44,"\u002Fguides\u002Fstreaming":12,"\u002Fguides\u002Ftool-calling":13,"\u002Fguides\u002Ftop-up":45,"\u002F":46,"\u002Fintegrations\u002Faider":16,"\u002Fintegrations\u002Fclaude-code":17,"\u002Fintegrations\u002Fcline":18,"\u002Fintegrations\u002Fcontinue":19,"\u002Fintegrations\u002Fgoose":20,"\u002Fintegrations\u002Fhermes":21,"\u002Fintegrations":47,"\u002Fintegrations\u002Fkilo-code":23,"\u002Fintegrations\u002Flangchain":24,"\u002Fintegrations\u002Foh-my-pi":25,"\u002Fintegrations\u002Fopenai-sdk":48,"\u002Fintegrations\u002Fopenclaw":27,"\u002Fintegrations\u002Fopencode":28,"\u002Fintegrations\u002Fpi":29,"\u002Fintegrations\u002Fvercel-ai-sdk":30,"\u002Fintegrations\u002Fzed":31,"\u002Fmodels":49,"\u002Fquickstart":33,"\u002Freference\u002Fchat-completions":34,"\u002Freference":47,"\u002Freference\u002Fmessages":35,"\u002Freference\u002Fmodels":50,"\u002Freference\u002Fmodels-retrieve":51,"\u002Fsupport":38},"Autentikasi","Error & retry","Output JSON","Rate limit","Konten reasoning","Isi saldo dengan QRIS","Pengantar","Ringkasan","OpenAI SDK","Model","Daftar model","Ambil satu model",{"id":53,"title":8,"body":54,"description":1245,"extension":1246,"eyebrow":1247,"meta":1248,"navTitle":8,"navigation":851,"path":1249,"seo":1250,"stem":1251,"updatedAt":1252,"__hash__":1253},"docs_en\u002Fguides\u002Ferrors.md",{"type":55,"value":56,"toc":1238},"minimark",[57,70,163,181,186,743,749,753,768,800,814,985,989,1169,1173,1215,1219,1234],[58,59,60,61,65,66,69],"p",{},"Errors use the OpenAI error shape, so the OpenAI SDKs raise them as normal exceptions. Branch on ",[62,63,64],"code",{},"error.code"," (and ",[62,67,68],{},"error.type","), never on the message text.",[71,72,78],"pre",{"className":73,"code":74,"filename":75,"language":76,"meta":77,"style":77},"language-json shiki shiki-themes laras-ink","{\n  \"error\": {\n    \"message\": \"Insufficient balance. Top up to continue.\",\n    \"type\": \"insufficient_quota\",\n    \"code\": \"insufficient_credit\",\n    \"param\": null\n  }\n}\n","402 Payment Required","json","",[62,79,80,89,98,114,127,140,151,157],{"__ignoreMap":77},[81,82,85],"span",{"class":83,"line":84},"line",1,[81,86,88],{"class":87},"snt3o","{\n",[81,90,92,95],{"class":83,"line":91},2,[81,93,94],{"class":87},"  \"error\"",[81,96,97],{"class":87},": {\n",[81,99,101,104,107,111],{"class":83,"line":100},3,[81,102,103],{"class":87},"    \"message\"",[81,105,106],{"class":87},": ",[81,108,110],{"class":109},"sIGQv","\"Insufficient balance. Top up to continue.\"",[81,112,113],{"class":87},",\n",[81,115,117,120,122,125],{"class":83,"line":116},4,[81,118,119],{"class":87},"    \"type\"",[81,121,106],{"class":87},[81,123,124],{"class":109},"\"insufficient_quota\"",[81,126,113],{"class":87},[81,128,130,133,135,138],{"class":83,"line":129},5,[81,131,132],{"class":87},"    \"code\"",[81,134,106],{"class":87},[81,136,137],{"class":109},"\"insufficient_credit\"",[81,139,113],{"class":87},[81,141,143,146,148],{"class":83,"line":142},6,[81,144,145],{"class":87},"    \"param\"",[81,147,106],{"class":87},[81,149,150],{"class":109},"null\n",[81,152,154],{"class":83,"line":153},7,[81,155,156],{"class":87},"  }\n",[81,158,160],{"class":83,"line":159},8,[81,161,162],{"class":87},"}\n",[58,164,165,166,169,170,173,174,176,177,180],{},"The ",[62,167,168],{},"message"," is in English by default. Send ",[62,171,172],{},"Accept-Language: id"," to receive it in Bahasa Indonesia. ",[62,175,62],{}," and ",[62,178,179],{},"type"," are the same in every language.",[182,183,185],"h2",{"id":184},"error-codes","Error codes",[187,188,189,211],"table",{},[190,191,192],"thead",{},[193,194,195,199,202,205,208],"tr",{},[196,197,198],"th",{},"Status",[196,200,201],{},"Code",[196,203,204],{},"Type",[196,206,207],{},"Meaning",[196,209,210],{},"What to do",[212,213,214,236,262,297,320,340,371,395,420,444,467,494,514,534,558,579,599,620,639,664,686,705,725],"tbody",{},[193,215,216,220,225,230,233],{},[217,218,219],"td",{},"400",[217,221,222],{},[62,223,224],{},"invalid_request",[217,226,227],{},[62,228,229],{},"invalid_request_error",[217,231,232],{},"The body is not valid JSON or names no model.",[217,234,235],{},"Fix the request. Don't retry.",[193,237,238,240,245,249,259],{},[217,239,219],{},[217,241,242],{},[62,243,244],{},"max_tokens_exceeded",[217,246,247],{},[62,248,229],{},[217,250,251,254,255,258],{},[62,252,253],{},"max_tokens"," or ",[62,256,257],{},"max_completion_tokens"," is above 384,000.",[217,260,261],{},"Lower it. Don't retry.",[193,263,264,266,271,275,286],{},[217,265,219],{},[217,267,268],{},[62,269,270],{},"unsupported_content",[217,272,273],{},[62,274,229],{},[217,276,277,278,281,282,285],{},"The model does not accept this input or feature: an image sent to a model without vision, or reasoning (",[62,279,280],{},"reasoning_effort",", ",[62,283,284],{},"thinking","), tools, or JSON output asked of a model without it.",[217,287,288,289,292,293,296],{},"Check the model's ",[62,290,291],{},"capabilities"," in ",[62,294,295],{},"GET \u002Fv1\u002Fmodels",", then remove the image or parameter or choose another model. Don't retry.",[193,298,299,301,306,310,313],{},[217,300,219],{},[217,302,303],{},[62,304,305],{},"unsupported_image_url",[217,307,308],{},[62,309,229],{},[217,311,312],{},"An image was sent as a URL instead of inline base64 data.",[217,314,315,316,319],{},"Send it as a data URL (",[62,317,318],{},"data:image\u002Fpng;base64,...","). Don't retry.",[193,321,322,325,330,334,337],{},[217,323,324],{},"401",[217,326,327],{},[62,328,329],{},"invalid_api_key",[217,331,332],{},[62,333,229],{},[217,335,336],{},"The key is missing, malformed, revoked, or unknown.",[217,338,339],{},"Check the header and the key. Don't retry.",[193,341,342,345,350,355,364],{},[217,343,344],{},"402",[217,346,347],{},[62,348,349],{},"insufficient_credit",[217,351,352],{},[62,353,354],{},"insufficient_quota",[217,356,357,358,363],{},"Your available balance is $0.00 or below, or what is left is ",[359,360,362],"a",{"href":361},"\u002Fguides\u002Fbilling#holds","held"," by your requests still running (the message says which).",[217,365,366,370],{},[359,367,369],{"href":368},"\u002Fguides\u002Ftop-up","Top up",", then retry. If your balance is held, retry once your running requests finish.",[193,372,373,375,380,384,392],{},[217,374,344],{},[217,376,377],{},[62,378,379],{},"key_budget_exceeded",[217,381,382],{},[62,383,354],{},[217,385,386,387,391],{},"The key has used its ",[359,388,390],{"href":389},"\u002Fguides\u002Fbilling#key-budgets","monthly budget",". The message names the budget.",[217,393,394],{},"Raise or clear the budget in the console, or wait for the next month (WIB).",[193,396,397,400,405,410,417],{},[217,398,399],{},"403",[217,401,402],{},[62,403,404],{},"insufficient_scope",[217,406,407],{},[62,408,409],{},"insufficient_permissions",[217,411,412,413,416],{},"The key lacks the ",[62,414,415],{},"chat:write"," scope.",[217,418,419],{},"Use a key with the right scope. Don't retry.",[193,421,422,425,430,434,437],{},[217,423,424],{},"404",[217,426,427],{},[62,428,429],{},"model_not_found",[217,431,432],{},[62,433,229],{},[217,435,436],{},"The model ID is not served.",[217,438,439,440,443],{},"Use ",[62,441,442],{},"deepseek-v4.1-flash",". Don't retry.",[193,445,446,448,453,457,460],{},[217,447,424],{},[217,449,450],{},[62,451,452],{},"not_found",[217,454,455],{},[62,456,229],{},[217,458,459],{},"Unknown endpoint.",[217,461,462,463,466],{},"Check the path; the base URL ends in ",[62,464,465],{},"\u002Fv1",".",[193,468,469,472,477,481,484],{},[217,470,471],{},"405",[217,473,474],{},[62,475,476],{},"method_not_allowed",[217,478,479],{},[62,480,229],{},[217,482,483],{},"Wrong HTTP method for the endpoint.",[217,485,439,486,489,490,493],{},[62,487,488],{},"POST"," for chat completions, ",[62,491,492],{},"GET"," for models.",[193,495,496,499,504,508,511],{},[217,497,498],{},"408",[217,500,501],{},[62,502,503],{},"request_timeout",[217,505,506],{},[62,507,229],{},[217,509,510],{},"The request body stopped arriving for 30 seconds, uploaded slower than 16 KB\u002Fs on average, or took longer than 2 minutes. Nothing was charged.",[217,512,513],{},"Retry. If it repeats, check the connection.",[193,515,516,519,524,528,531],{},[217,517,518],{},"413",[217,520,521],{},[62,522,523],{},"request_too_large",[217,525,526],{},[62,527,229],{},[217,529,530],{},"The body is over the 16 MB request size limit. Base64 images count toward it.",[217,532,533],{},"Compact the conversation or send fewer images. Don't retry unchanged.",[193,535,536,539,544,548,551],{},[217,537,538],{},"429",[217,540,541],{},[62,542,543],{},"rate_limit_exceeded",[217,545,546],{},[62,547,543],{},[217,549,550],{},"More than 300 requests in a minute on this key.",[217,552,553,554,557],{},"Wait for ",[62,555,556],{},"Retry-After",", then retry.",[193,559,560,562,567,571,574],{},[217,561,538],{},[217,563,564],{},[62,565,566],{},"concurrency_limit_exceeded",[217,568,569],{},[62,570,543],{},[217,572,573],{},"More than 16 requests in flight on this key.",[217,575,553,576,578],{},[62,577,556],{}," or for a request to finish.",[193,580,581,583,588,592,595],{},[217,582,538],{},[217,584,585],{},[62,586,587],{},"ip_rate_limited",[217,589,590],{},[62,591,543],{},[217,593,594],{},"Too many requests from one IP address.",[217,596,553,597,557],{},[62,598,556],{},[193,600,601,604,609,614,617],{},[217,602,603],{},"500",[217,605,606],{},[62,607,608],{},"internal_error",[217,610,611],{},[62,612,613],{},"api_error",[217,615,616],{},"Unexpected server error.",[217,618,619],{},"Retry with backoff.",[193,621,622,625,630,634,637],{},[217,623,624],{},"502",[217,626,627],{},[62,628,629],{},"provider_unavailable",[217,631,632],{},[62,633,613],{},[217,635,636],{},"The model provider failed after your request was sent, and the request could not be moved to another provider (for example, it reached its generation time limit).",[217,638,619],{},[193,640,641,644,648,652,658],{},[217,642,643],{},"503",[217,645,646],{},[62,647,629],{},[217,649,650],{},[62,651,613],{},[217,653,654,655,657],{},"No model provider can serve the request right now: every provider for the model failed or is temporarily unavailable. ",[62,656,556],{}," is the seconds until a supplier is expected back, at most 60.",[217,659,660,661,663],{},"Retry after ",[62,662,556],{},". You were not charged.",[193,665,666,668,672,676,682],{},[217,667,643],{},[217,669,670],{},[62,671,629],{},[217,673,674],{},[62,675,613],{},[217,677,678,679,681],{},"The model provider could not be reached before your request was sent. ",[62,680,556],{}," is 1 second.",[217,683,660,684,663],{},[62,685,556],{},[193,687,688,690,695,699,702],{},[217,689,643],{},[217,691,692],{},[62,693,694],{},"billing_unavailable",[217,696,697],{},[62,698,613],{},[217,700,701],{},"Billing is temporarily unavailable; the request was not run.",[217,703,704],{},"Retry with backoff. You were not charged.",[193,706,707,709,714,718,721],{},[217,708,643],{},[217,710,711],{},[62,712,713],{},"overloaded",[217,715,716],{},[62,717,613],{},[217,719,720],{},"Too many large requests (for example, image-heavy agent turns) are running at once. The request was not run.",[217,722,660,723,663],{},[62,724,556],{},[193,726,727,729,734,738,741],{},[217,728,643],{},[217,730,731],{},[62,732,733],{},"service_unavailable",[217,735,736],{},[62,737,613],{},[217,739,740],{},"The service is temporarily unavailable.",[217,742,619],{},[58,744,745,746,748],{},"Other errors returned by the model provider — for example a ",[62,747,219],{}," for a parameter combination it does not support — are forwarded with the provider's own error body.",[182,750,752],{"id":751},"when-to-retry","When to retry",[58,754,755,756,281,758,281,760,281,762,764,765,767],{},"Retry only ",[62,757,498],{},[62,759,538],{},[62,761,603],{},[62,763,624],{},", and ",[62,766,643],{},". Everything else needs a change to the request, the key, or your balance first.",[769,770,771,779,788,794],"ul",{},[772,773,774,778],"li",{},[775,776,777],"strong",{},"408:"," the upload did not finish. Retry it; if it keeps failing, the connection is too slow for the request's size.",[772,780,781,784,785,787],{},[775,782,783],{},"429:"," wait for the number of seconds in the ",[62,786,556],{}," header before trying again.",[772,789,790,793],{},[775,791,792],{},"5xx:"," use exponential backoff with jitter, for example 1 s, 2 s, 4 s, and give up after a few attempts.",[772,795,796,799],{},[775,797,798],{},"Each retry is a new request."," It is held, metered, and billed on its own.",[58,801,802,803,281,805,764,807,810,811,813],{},"The official OpenAI SDKs already retry ",[62,804,498],{},[62,806,538],{},[62,808,809],{},"5xx"," responses a couple of times with backoff, and honour ",[62,812,556],{},". You can raise the limit:",[815,816,817,912],"code-group",{},[71,818,823],{"className":819,"code":820,"filename":821,"language":822,"meta":77,"style":77},"language-python shiki shiki-themes laras-ink","import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\",\n    api_key=os.environ[\"LARAS_API_KEY\"],\n    max_retries=4,\n)\n","Python","python",[62,824,825,834,847,853,867,879,895,907],{"__ignoreMap":77},[81,826,827,831],{"class":83,"line":84},[81,828,830],{"class":829},"sifj9","import",[81,832,833],{"class":87}," os\n",[81,835,836,839,842,844],{"class":83,"line":91},[81,837,838],{"class":829},"from",[81,840,841],{"class":87}," openai ",[81,843,830],{"class":829},[81,845,846],{"class":87}," OpenAI\n",[81,848,849],{"class":83,"line":100},[81,850,852],{"emptyLinePlaceholder":851},true,"\n",[81,854,855,858,861,864],{"class":83,"line":116},[81,856,857],{"class":87},"client ",[81,859,860],{"class":829},"=",[81,862,863],{"class":109}," OpenAI",[81,865,866],{"class":87},"(\n",[81,868,869,872,874,877],{"class":83,"line":129},[81,870,871],{"class":87},"    base_url",[81,873,860],{"class":829},[81,875,876],{"class":109},"\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\"",[81,878,113],{"class":87},[81,880,881,884,886,889,892],{"class":83,"line":142},[81,882,883],{"class":87},"    api_key",[81,885,860],{"class":829},[81,887,888],{"class":87},"os.environ[",[81,890,891],{"class":109},"\"LARAS_API_KEY\"",[81,893,894],{"class":87},"],\n",[81,896,897,900,902,905],{"class":83,"line":153},[81,898,899],{"class":87},"    max_retries",[81,901,860],{"class":829},[81,903,904],{"class":109},"4",[81,906,113],{"class":87},[81,908,909],{"class":83,"line":159},[81,910,911],{"class":87},")\n",[71,913,918],{"className":914,"code":915,"filename":916,"language":917,"meta":77,"style":77},"language-typescript shiki shiki-themes laras-ink","import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  baseURL: \"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\",\n  apiKey: process.env.LARAS_API_KEY,\n  maxRetries: 4,\n});\n","Node.js","typescript",[62,919,920,935,939,957,966,971,980],{"__ignoreMap":77},[81,921,922,924,927,929,932],{"class":83,"line":84},[81,923,830],{"class":829},[81,925,926],{"class":87}," OpenAI ",[81,928,838],{"class":829},[81,930,931],{"class":109}," \"openai\"",[81,933,934],{"class":87},";\n",[81,936,937],{"class":83,"line":91},[81,938,852],{"emptyLinePlaceholder":851},[81,940,941,944,947,949,952,954],{"class":83,"line":100},[81,942,943],{"class":829},"const",[81,945,946],{"class":87}," client ",[81,948,860],{"class":829},[81,950,951],{"class":829}," new",[81,953,863],{"class":109},[81,955,956],{"class":87},"({\n",[81,958,959,962,964],{"class":83,"line":116},[81,960,961],{"class":87},"  baseURL: ",[81,963,876],{"class":109},[81,965,113],{"class":87},[81,967,968],{"class":83,"line":129},[81,969,970],{"class":87},"  apiKey: process.env.LARAS_API_KEY,\n",[81,972,973,976,978],{"class":83,"line":142},[81,974,975],{"class":87},"  maxRetries: ",[81,977,904],{"class":109},[81,979,113],{"class":87},[81,981,982],{"class":83,"line":153},[81,983,984],{"class":87},"});\n",[182,986,988],{"id":987},"handle-errors-by-code","Handle errors by code",[71,990,992],{"className":819,"code":991,"filename":821,"language":822,"meta":77,"style":77},"import openai\n\ntry:\n    response = client.chat.completions.create(\n        model=\"deepseek-v4.1-flash\",\n        messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n    )\nexcept openai.APIStatusError as e:\n    # The SDK exposes error.code from the response body as e.code.\n    if e.code == \"insufficient_credit\":\n        notify_owner(\"Laras Router balance is empty — top up to resume.\")\n    elif e.code == \"key_budget_exceeded\":\n        notify_owner(\"This key reached its monthly budget.\")\n    else:\n        raise\n",[62,993,994,1001,1005,1013,1028,1040,1071,1076,1090,1097,1114,1128,1143,1155,1163],{"__ignoreMap":77},[81,995,996,998],{"class":83,"line":84},[81,997,830],{"class":829},[81,999,1000],{"class":87}," openai\n",[81,1002,1003],{"class":83,"line":91},[81,1004,852],{"emptyLinePlaceholder":851},[81,1006,1007,1010],{"class":83,"line":100},[81,1008,1009],{"class":829},"try",[81,1011,1012],{"class":87},":\n",[81,1014,1015,1018,1020,1023,1026],{"class":83,"line":116},[81,1016,1017],{"class":87},"    response ",[81,1019,860],{"class":829},[81,1021,1022],{"class":87}," client.chat.completions.",[81,1024,1025],{"class":109},"create",[81,1027,866],{"class":87},[81,1029,1030,1033,1035,1038],{"class":83,"line":129},[81,1031,1032],{"class":87},"        model",[81,1034,860],{"class":829},[81,1036,1037],{"class":109},"\"deepseek-v4.1-flash\"",[81,1039,113],{"class":87},[81,1041,1042,1045,1047,1050,1053,1055,1058,1060,1063,1065,1068],{"class":83,"line":142},[81,1043,1044],{"class":87},"        messages",[81,1046,860],{"class":829},[81,1048,1049],{"class":87},"[{",[81,1051,1052],{"class":109},"\"role\"",[81,1054,106],{"class":87},[81,1056,1057],{"class":109},"\"user\"",[81,1059,281],{"class":87},[81,1061,1062],{"class":109},"\"content\"",[81,1064,106],{"class":87},[81,1066,1067],{"class":109},"\"Hello\"",[81,1069,1070],{"class":87},"}],\n",[81,1072,1073],{"class":83,"line":153},[81,1074,1075],{"class":87},"    )\n",[81,1077,1078,1081,1084,1087],{"class":83,"line":159},[81,1079,1080],{"class":829},"except",[81,1082,1083],{"class":87}," openai.APIStatusError ",[81,1085,1086],{"class":829},"as",[81,1088,1089],{"class":87}," e:\n",[81,1091,1093],{"class":83,"line":1092},9,[81,1094,1096],{"class":1095},"sMtyq","    # The SDK exposes error.code from the response body as e.code.\n",[81,1098,1100,1103,1106,1109,1112],{"class":83,"line":1099},10,[81,1101,1102],{"class":829},"    if",[81,1104,1105],{"class":87}," e.code ",[81,1107,1108],{"class":829},"==",[81,1110,1111],{"class":109}," \"insufficient_credit\"",[81,1113,1012],{"class":87},[81,1115,1117,1120,1123,1126],{"class":83,"line":1116},11,[81,1118,1119],{"class":109},"        notify_owner",[81,1121,1122],{"class":87},"(",[81,1124,1125],{"class":109},"\"Laras Router balance is empty — top up to resume.\"",[81,1127,911],{"class":87},[81,1129,1131,1134,1136,1138,1141],{"class":83,"line":1130},12,[81,1132,1133],{"class":829},"    elif",[81,1135,1105],{"class":87},[81,1137,1108],{"class":829},[81,1139,1140],{"class":109}," \"key_budget_exceeded\"",[81,1142,1012],{"class":87},[81,1144,1146,1148,1150,1153],{"class":83,"line":1145},13,[81,1147,1119],{"class":109},[81,1149,1122],{"class":87},[81,1151,1152],{"class":109},"\"This key reached its monthly budget.\"",[81,1154,911],{"class":87},[81,1156,1158,1161],{"class":83,"line":1157},14,[81,1159,1160],{"class":829},"    else",[81,1162,1012],{"class":87},[81,1164,1166],{"class":83,"line":1165},15,[81,1167,1168],{"class":829},"        raise\n",[182,1170,1172],{"id":1171},"failed-requests","Failed requests and charges",[769,1174,1175,1199,1206,1212],{},[772,1176,1177,1178,1181,1182,281,1184,281,1186,281,1188,281,1190,281,1192,281,1194,281,1196,1198],{},"A request rejected ",[775,1179,1180],{},"before"," it reaches the model — any ",[62,1183,219],{},[62,1185,324],{},[62,1187,344],{},[62,1189,399],{},[62,1191,424],{},[62,1193,498],{},[62,1195,518],{},[62,1197,538],{}," from Laras Router — is never charged.",[772,1200,1201,1202,1205],{},"A request the model provider rejects with a ",[62,1203,1204],{},"4xx"," is not charged; its hold is released.",[772,1207,1208,1209,1211],{},"A request that fails before any of the answer reaches you — a ",[62,1210,809],{},", a timeout, or a provider that cannot be reached — is not charged; its hold is released at once.",[772,1213,1214],{},"A stream interrupted after part of the answer reached you keeps its hold while we reconcile it. You may be charged for usage the provider reports for it; otherwise the hold is released without a charge.",[182,1216,1218],{"id":1217},"request-id","Request ID",[58,1220,1221,1222,1225,1226,1230,1231,1233],{},"Responses to requests that reached billing carry an ",[62,1223,1224],{},"X-Laras-Request-ID"," header. It identifies the charge and the hold for that request. Include it when you ",[359,1227,1229],{"href":1228},"\u002Fsupport","contact support"," about a charge. Requests rejected before a hold is placed — for example a ",[62,1232,324],{}," — may not carry it.",[1235,1236,1237],"style",{},"html pre.shiki code .snt3o, html code.shiki .snt3o{--shiki-default:#B4B8BF}html pre.shiki code .sIGQv, html code.shiki .sIGQv{--shiki-default:#F7F8F8}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 pre.shiki code .sifj9, html code.shiki .sifj9{--shiki-default:#8A8F98}html pre.shiki code .sMtyq, html code.shiki .sMtyq{--shiki-default:#767B84;--shiki-default-font-style:italic}",{"title":77,"searchDepth":100,"depth":100,"links":1239},[1240,1241,1242,1243,1244],{"id":184,"depth":91,"text":185},{"id":751,"depth":91,"text":752},{"id":987,"depth":91,"text":988},{"id":1171,"depth":91,"text":1172},{"id":1217,"depth":91,"text":1218},"Every error code the API returns, what it means, and whether to retry.","md",null,{},"\u002Fguides\u002Ferrors",{"title":8,"description":1245},"guides\u002Ferrors","2026-11-15","DT1JcuMdQX8hkvVmIfZkcmewB9hBQjJlLGtAEqwGEuE",1796424410886]