[{"data":1,"prerenderedAt":340},["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":331,"extension":332,"eyebrow":333,"meta":334,"navTitle":333,"navigation":335,"path":336,"seo":337,"stem":338,"__hash__":339},"docs_en\u002Fauthentication.md",{"type":55,"value":56,"toc":323},"minimark",[57,66,71,74,146,156,171,175,182,186,189,220,224,227,289,300,304,311,319],[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,121],"code-group",{},[78,79,85],"pre",{"className":80,"code":81,"filename":82,"language":83,"meta":84,"style":84},"language-bash shiki shiki-themes github-dark-default github-light-default","curl https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fmodels \\\n  -H \"Authorization: Bearer $LARAS_API_KEY\"\n","Authorization","bash","",[62,86,87,104],{"__ignoreMap":84},[88,89,92,96,100],"span",{"class":90,"line":91},"line",1,[88,93,95],{"class":94},"sjwWW","curl",[88,97,99],{"class":98},"sHdZ9"," https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fmodels",[88,101,103],{"class":102},"s1PA9"," \\\n",[88,105,107,111,114,118],{"class":90,"line":106},2,[88,108,110],{"class":109},"sYnYM","  -H",[88,112,113],{"class":98}," \"Authorization: Bearer ",[88,115,117],{"class":116},"sUq8j","$LARAS_API_KEY",[88,119,120],{"class":98},"\"\n",[78,122,125],{"className":80,"code":123,"filename":124,"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,126,127,135],{"__ignoreMap":84},[88,128,129,131,133],{"class":90,"line":91},[88,130,95],{"class":94},[88,132,99],{"class":98},[88,134,103],{"class":102},[88,136,137,139,142,144],{"class":90,"line":106},[88,138,110],{"class":109},[88,140,141],{"class":98}," \"x-api-key: ",[88,143,117],{"class":116},[88,145,120],{"class":98},[58,147,148,149,152,153,155],{},"The OpenAI SDKs send ",[62,150,151],{},"Authorization: Bearer"," for you. Some tools only offer an ",[62,154,124],{}," field; that works too.",[58,157,158,159,162,163,166,167,170],{},"A request without a valid key fails with ",[62,160,161],{},"401 invalid_api_key",". A key that exists but lacks the ",[62,164,165],{},"chat:write"," scope fails with ",[62,168,169],{},"403 insufficient_scope",".",[67,172,174],{"id":173},"key-format","Key format",[58,176,177,178,181],{},"Production keys look like ",[62,179,180],{},"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,183,185],{"id":184},"environment-variables","Environment variables",[58,187,188],{},"The official OpenAI SDKs read these variables, so many tools work without code changes:",[78,190,192],{"className":80,"code":191,"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,193,194,208],{"__ignoreMap":84},[88,195,196,199,202,205],{"class":90,"line":91},[88,197,198],{"class":102},"export",[88,200,201],{"class":116}," OPENAI_BASE_URL",[88,203,204],{"class":102},"=",[88,206,207],{"class":98},"\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\"\n",[88,209,210,212,215,217],{"class":90,"line":106},[88,211,198],{"class":102},[88,213,214],{"class":116}," OPENAI_API_KEY",[88,216,204],{"class":102},[88,218,219],{"class":98},"\"lr_live_your_key_here\"\n",[67,221,223],{"id":222},"limits-on-a-key","Limits on a key",[58,225,226],{},"Each key has its own limits, independent of your other keys:",[228,229,230,246],"table",{},[231,232,233],"thead",{},[234,235,236,240,243],"tr",{},[237,238,239],"th",{},"Limit",[237,241,242],{},"Default",[237,244,245],{},"When exceeded",[247,248,249,263,276],"tbody",{},[234,250,251,255,258],{},[252,253,254],"td",{},"Requests per minute",[252,256,257],{},"300",[252,259,260],{},[62,261,262],{},"429 rate_limit_exceeded",[234,264,265,268,271],{},[252,266,267],{},"Concurrent requests",[252,269,270],{},"16",[252,272,273],{},[62,274,275],{},"429 concurrency_limit_exceeded",[234,277,278,281,284],{},[252,279,280],{},"Monthly budget (USD)",[252,282,283],{},"None",[252,285,286],{},[62,287,288],{},"402 key_budget_exceeded",[58,290,291,292,296,297,170],{},"Set a monthly budget on each key in the console so one environment cannot spend the whole wallet. See ",[293,294,10],"a",{"href":295},"\u002Fguides\u002Frate-limits"," and ",[293,298,7],{"href":299},"\u002Fguides\u002Fbilling#key-budgets",[67,301,303],{"id":302},"rotate-and-revoke","Rotate and revoke",[58,305,306,307,310],{},"To rotate a key, create the replacement, deploy it, then revoke the old key in the console. Revocation takes effect immediately: the next request with the old key fails with ",[62,308,309],{},"401",". Your usage history keeps the revoked key's name and prefix.",[312,313,316],"callout",{"title":314,"type":315},"Keep keys secret","warning",[58,317,318],{},"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.",[320,321,322],"style",{},"html pre.shiki code .sjwWW, html code.shiki .sjwWW{--shiki-default:#FFA657;--shiki-light:#953800}html pre.shiki code .sHdZ9, html code.shiki .sHdZ9{--shiki-default:#A5D6FF;--shiki-light:#0A3069}html pre.shiki code .s1PA9, html code.shiki .s1PA9{--shiki-default:#FF7B72;--shiki-light:#CF222E}html pre.shiki code .sYnYM, html code.shiki .sYnYM{--shiki-default:#79C0FF;--shiki-light:#0550AE}html pre.shiki code .sUq8j, html code.shiki .sUq8j{--shiki-default:#E6EDF3;--shiki-light:#1F2328}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 .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);}",{"title":84,"searchDepth":324,"depth":324,"links":325},3,[326,327,328,329,330],{"id":69,"depth":106,"text":70},{"id":173,"depth":106,"text":174},{"id":184,"depth":106,"text":185},{"id":222,"depth":106,"text":223},{"id":302,"depth":106,"text":303},"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":331},"authentication","W6t_K-Q6TMQCbajPgdX_IJCjN9hdtKDfdIB_y95RamI",1793333617462]