[{"data":1,"prerenderedAt":358},["ShallowReactive",2],{"docs-nav-titles":3,"page-docs_en-\u002Fauthentication":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":5,"body":54,"description":348,"extension":349,"eyebrow":350,"meta":351,"navTitle":350,"navigation":352,"path":353,"seo":354,"stem":355,"updatedAt":356,"__hash__":357},"docs_en\u002Fauthentication.md",{"type":55,"value":56,"toc":340},"minimark",[57,66,71,74,133,143,158,162,169,173,176,208,212,215,277,288,292,304,325,328,336],[58,59,60,61,65],"p",{},"Every request to ",[62,63,64],"code",{},"https:\u002F\u002Fapi.larasrouter.com\u002Fv1"," must carry an API key. Keys belong to your organization, and every request made with a key is charged to the organization's wallet.",[67,68,70],"h2",{"id":69},"send-the-key","Send the key",[58,72,73],{},"Use either header. Both are accepted on every endpoint:",[75,76,77,112],"code-group",{},[78,79,85],"pre",{"className":80,"code":81,"filename":82,"language":83,"meta":84,"style":84},"language-bash shiki shiki-themes laras-ink","curl https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fmodels \\\n  -H \"Authorization: Bearer $LARAS_API_KEY\"\n","Authorization","bash","",[62,86,87,103],{"__ignoreMap":84},[88,89,92,96,99],"span",{"class":90,"line":91},"line",1,[88,93,95],{"class":94},"sIGQv","curl",[88,97,98],{"class":94}," https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fmodels",[88,100,102],{"class":101},"snt3o"," \\\n",[88,104,106,109],{"class":90,"line":105},2,[88,107,108],{"class":94},"  -H",[88,110,111],{"class":94}," \"Authorization: Bearer $LARAS_API_KEY\"\n",[78,113,116],{"className":80,"code":114,"filename":115,"language":83,"meta":84,"style":84},"curl https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fmodels \\\n  -H \"x-api-key: $LARAS_API_KEY\"\n","x-api-key",[62,117,118,126],{"__ignoreMap":84},[88,119,120,122,124],{"class":90,"line":91},[88,121,95],{"class":94},[88,123,98],{"class":94},[88,125,102],{"class":101},[88,127,128,130],{"class":90,"line":105},[88,129,108],{"class":94},[88,131,132],{"class":94}," \"x-api-key: $LARAS_API_KEY\"\n",[58,134,135,136,139,140,142],{},"The OpenAI SDKs send ",[62,137,138],{},"Authorization: Bearer"," for you. Some tools only offer an ",[62,141,115],{}," field; that works too.",[58,144,145,146,149,150,153,154,157],{},"A request without a valid key fails with ",[62,147,148],{},"401 invalid_api_key",". A key that exists but lacks the ",[62,151,152],{},"chat:write"," scope fails with ",[62,155,156],{},"403 insufficient_scope",".",[67,159,161],{"id":160},"key-format","Key format",[58,163,164,165,168],{},"Production keys look like ",[62,166,167],{},"lr_live_\u003Cprefix>_\u003Csecret>",". The console shows the full key once, when you create it. Afterwards it shows only the prefix, so you can tell keys apart without exposing them. We store a one-way hash of the secret and cannot recover a lost key — create a new one instead.",[67,170,172],{"id":171},"environment-variables","Environment variables",[58,174,175],{},"The official OpenAI SDKs read these variables, so many tools work without code changes:",[78,177,179],{"className":80,"code":178,"language":83,"meta":84,"style":84},"export OPENAI_BASE_URL=\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\"\nexport OPENAI_API_KEY=\"lr_live_your_key_here\"\n",[62,180,181,196],{"__ignoreMap":84},[88,182,183,187,190,193],{"class":90,"line":91},[88,184,186],{"class":185},"sifj9","export",[88,188,189],{"class":101}," OPENAI_BASE_URL",[88,191,192],{"class":185},"=",[88,194,195],{"class":94},"\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\"\n",[88,197,198,200,203,205],{"class":90,"line":105},[88,199,186],{"class":185},[88,201,202],{"class":101}," OPENAI_API_KEY",[88,204,192],{"class":185},[88,206,207],{"class":94},"\"lr_live_your_key_here\"\n",[67,209,211],{"id":210},"limits-on-a-key","Limits on a key",[58,213,214],{},"Each key has its own limits, independent of your other keys:",[216,217,218,234],"table",{},[219,220,221],"thead",{},[222,223,224,228,231],"tr",{},[225,226,227],"th",{},"Limit",[225,229,230],{},"Default",[225,232,233],{},"When exceeded",[235,236,237,251,264],"tbody",{},[222,238,239,243,246],{},[240,241,242],"td",{},"Requests per minute",[240,244,245],{},"300",[240,247,248],{},[62,249,250],{},"429 rate_limit_exceeded",[222,252,253,256,259],{},[240,254,255],{},"Concurrent requests",[240,257,258],{},"16",[240,260,261],{},[62,262,263],{},"429 concurrency_limit_exceeded",[222,265,266,269,272],{},[240,267,268],{},"Monthly budget (USD)",[240,270,271],{},"None",[240,273,274],{},[62,275,276],{},"402 key_budget_exceeded",[58,278,279,280,284,285,157],{},"Set a monthly budget on each key in the console so one environment cannot spend the whole wallet. See ",[281,282,10],"a",{"href":283},"\u002Fguides\u002Frate-limits"," and ",[281,286,7],{"href":287},"\u002Fguides\u002Fbilling#key-budgets",[67,289,291],{"id":290},"rotate-and-revoke","Rotate and revoke",[58,293,294,295,299,300,303],{},"To rotate a key, open its menu in the console's ",[296,297,298],"strong",{},"API keys"," page and choose ",[296,301,302],{},"Rotate key",". You get a new secret with the same name, budget and limits, shown once. Choose what happens to the old key:",[305,306,307,317],"ul",{},[308,309,310,313,314,157],"li",{},[296,311,312],{},"Keep the old key working for 24 hours"," (recommended): there is no downtime while you deploy the new key. After 24 hours the old key fails with ",[62,315,316],{},"401",[308,318,319,322,323,157],{},[296,320,321],{},"Revoke the old key now",": use this when the key leaked. The next request with the old key fails with ",[62,324,316],{},[58,326,327],{},"During the 24 hours both keys work, and each counts its own month-to-date spend against the budget. To stop a key without a replacement, delete it: that takes effect immediately. Your usage history keeps the name and prefix of every key.",[329,330,333],"callout",{"title":331,"type":332},"Keep keys secret","warning",[58,334,335],{},"Never put an API key in client-side code, a mobile app, a public repository, or a frontend bundle. Anyone holding the key can spend your balance, up to the key's monthly budget if you set one. Revoke a leaked key immediately.",[337,338,339],"style",{},"html pre.shiki code .sIGQv, html code.shiki .sIGQv{--shiki-default:#F7F8F8}html pre.shiki code .snt3o, html code.shiki .snt3o{--shiki-default:#B4B8BF}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}",{"title":84,"searchDepth":341,"depth":341,"links":342},3,[343,344,345,346,347],{"id":69,"depth":105,"text":70},{"id":160,"depth":105,"text":161},{"id":171,"depth":105,"text":172},{"id":210,"depth":105,"text":211},{"id":290,"depth":105,"text":291},"Authenticate every request with an API key from the console, in the Authorization or x-api-key header.","md",null,{},true,"\u002Fauthentication",{"title":5,"description":348},"authentication","2026-11-13","z5xXyyko9uP3nzoVKrcIWVdEpF7uw5MhoVb53vA-16Y",1796424410880]