[{"data":1,"prerenderedAt":885},["ShallowReactive",2],{"page-docs_en-\u002Fquickstart":3,"docs-nav-titles":839},{"id":4,"title":5,"body":6,"description":830,"extension":831,"eyebrow":832,"meta":833,"navTitle":832,"navigation":192,"path":834,"seo":835,"stem":836,"updatedAt":837,"__hash__":838},"docs_en\u002Fquickstart.md","Quickstart",{"type":7,"value":8,"toc":819},"minimark",[9,26,643,648,651,753,760,764,786,790,815],[10,11,14],"callout",{"title":12,"type":13},"Before you start","info",[15,16,17,18,25],"p",{},"there is no free credit. Your first request needs a balance, from $1. Sign up in the ",[19,20,24],"a",{"href":21,"rel":22},"https:\u002F\u002Fconsole.larasrouter.com",[23],"nofollow","console"," with your email and a password, and confirm your email address from the link we send you.",[27,28,29,34,51,55,71,100,104,107,140,144,151,515,520,527,609,636],"steps",{},[30,31,33],"h3",{"id":32},"top-up-your-balance","Top up your balance",[15,35,36,37,41,42,45,46,50],{},"Open ",[38,39,40],"strong",{},"Billing"," in the ",[19,43,24],{"href":21,"rel":44},[23],", pick an amount between $1 and $100, and scan the QRIS code with any Indonesian bank or e-wallet app. Before you pay, the invoice shows the exchange rate, the 1% admin fee, and the total in Rupiah. Your USD balance updates as soon as the payment clears. See ",[19,47,49],{"href":48},"\u002Fguides\u002Ftop-up","Topping up with QRIS"," for the details.",[30,52,54],{"id":53},"create-an-api-key","Create an API key",[15,56,57,58,61,62,65,66,70],{},"In ",[38,59,60],{},"API keys",", choose ",[38,63,64],{},"Create API key",". Keys start with ",[67,68,69],"code",{},"lr_live_"," and are shown once. Store it as an environment variable:",[72,73,78],"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"language-bash shiki shiki-themes laras-ink","export LARAS_API_KEY=\"lr_live_your_key_here\"\n","bash","",[67,79,80],{"__ignoreMap":77},[81,82,85,89,93,96],"span",{"class":83,"line":84},"line",1,[81,86,88],{"class":87},"sifj9","export",[81,90,92],{"class":91},"snt3o"," LARAS_API_KEY",[81,94,95],{"class":87},"=",[81,97,99],{"class":98},"sIGQv","\"lr_live_your_key_here\"\n",[30,101,103],{"id":102},"install-the-openai-sdk","Install the OpenAI SDK",[15,105,106],{},"Laras Router speaks the OpenAI API, so the official SDK works as is.",[108,109,110,126],"code-group",{},[72,111,114],{"className":74,"code":112,"filename":113,"language":76,"meta":77,"style":77},"pip install openai\n","pip",[67,115,116],{"__ignoreMap":77},[81,117,118,120,123],{"class":83,"line":84},[81,119,113],{"class":98},[81,121,122],{"class":98}," install",[81,124,125],{"class":98}," openai\n",[72,127,130],{"className":74,"code":128,"filename":129,"language":76,"meta":77,"style":77},"npm install openai\n","npm",[67,131,132],{"__ignoreMap":77},[81,133,134,136,138],{"class":83,"line":84},[81,135,129],{"class":98},[81,137,122],{"class":98},[81,139,125],{"class":98},[30,141,143],{"id":142},"send-your-first-request","Send your first request",[15,145,146,147,150],{},"Set the base URL to ",[67,148,149],{},"https:\u002F\u002Fapi.larasrouter.com\u002Fv1"," and call any model by its ID.",[108,152,153,334,467],{},[72,154,163],{"className":155,"code":156,"filename":157,"highlights":158,"language":161,"meta":162,"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)\n\nresp = client.chat.completions.create(\n    model=\"deepseek-v4.1-flash\",\n    messages=[{\"role\": \"user\", \"content\": \"Halo!\"}],\n)\nprint(resp.choices[0].message.content)\n","Python",[159,160],5,6,"python","file=main.py",[67,164,165,173,187,194,208,223,240,246,251,267,280,314,319],{"__ignoreMap":77},[81,166,167,170],{"class":83,"line":84},[81,168,169],{"class":87},"import",[81,171,172],{"class":91}," os\n",[81,174,176,179,182,184],{"class":83,"line":175},2,[81,177,178],{"class":87},"from",[81,180,181],{"class":91}," openai ",[81,183,169],{"class":87},[81,185,186],{"class":91}," OpenAI\n",[81,188,190],{"class":83,"line":189},3,[81,191,193],{"emptyLinePlaceholder":192},true,"\n",[81,195,197,200,202,205],{"class":83,"line":196},4,[81,198,199],{"class":91},"client ",[81,201,95],{"class":87},[81,203,204],{"class":98}," OpenAI",[81,206,207],{"class":91},"(\n",[81,209,212,215,217,220],{"class":210,"line":159},[83,211],"highlight",[81,213,214],{"class":91},"    base_url",[81,216,95],{"class":87},[81,218,219],{"class":98},"\"https:\u002F\u002Fapi.larasrouter.com\u002Fv1\"",[81,221,222],{"class":91},",\n",[81,224,226,229,231,234,237],{"class":225,"line":160},[83,211],[81,227,228],{"class":91},"    api_key",[81,230,95],{"class":87},[81,232,233],{"class":91},"os.environ[",[81,235,236],{"class":98},"\"LARAS_API_KEY\"",[81,238,239],{"class":91},"],\n",[81,241,243],{"class":83,"line":242},7,[81,244,245],{"class":91},")\n",[81,247,249],{"class":83,"line":248},8,[81,250,193],{"emptyLinePlaceholder":192},[81,252,254,257,259,262,265],{"class":83,"line":253},9,[81,255,256],{"class":91},"resp ",[81,258,95],{"class":87},[81,260,261],{"class":91}," client.chat.completions.",[81,263,264],{"class":98},"create",[81,266,207],{"class":91},[81,268,270,273,275,278],{"class":83,"line":269},10,[81,271,272],{"class":91},"    model",[81,274,95],{"class":87},[81,276,277],{"class":98},"\"deepseek-v4.1-flash\"",[81,279,222],{"class":91},[81,281,283,286,288,291,294,297,300,303,306,308,311],{"class":83,"line":282},11,[81,284,285],{"class":91},"    messages",[81,287,95],{"class":87},[81,289,290],{"class":91},"[{",[81,292,293],{"class":98},"\"role\"",[81,295,296],{"class":91},": ",[81,298,299],{"class":98},"\"user\"",[81,301,302],{"class":91},", ",[81,304,305],{"class":98},"\"content\"",[81,307,296],{"class":91},[81,309,310],{"class":98},"\"Halo!\"",[81,312,313],{"class":91},"}],\n",[81,315,317],{"class":83,"line":316},12,[81,318,245],{"class":91},[81,320,322,325,328,331],{"class":83,"line":321},13,[81,323,324],{"class":87},"print",[81,326,327],{"class":91},"(resp.choices[",[81,329,330],{"class":98},"0",[81,332,333],{"class":91},"].message.content)\n",[72,335,342],{"className":336,"code":337,"filename":338,"highlights":339,"language":340,"meta":341,"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});\n\nconst resp = await client.chat.completions.create({\n  model: \"deepseek-v4.1-flash\",\n  messages: [{ role: \"user\", content: \"Halo!\" }],\n});\nconsole.log(resp.choices[0].message.content);\n","TypeScript",[196,159],"typescript","file=index.ts",[67,343,344,359,363,381,391,397,402,406,424,433,448,452],{"__ignoreMap":77},[81,345,346,348,351,353,356],{"class":83,"line":84},[81,347,169],{"class":87},[81,349,350],{"class":91}," OpenAI ",[81,352,178],{"class":87},[81,354,355],{"class":98}," \"openai\"",[81,357,358],{"class":91},";\n",[81,360,361],{"class":83,"line":175},[81,362,193],{"emptyLinePlaceholder":192},[81,364,365,368,371,373,376,378],{"class":83,"line":189},[81,366,367],{"class":87},"const",[81,369,370],{"class":91}," client ",[81,372,95],{"class":87},[81,374,375],{"class":87}," new",[81,377,204],{"class":98},[81,379,380],{"class":91},"({\n",[81,382,384,387,389],{"class":383,"line":196},[83,211],[81,385,386],{"class":91},"  baseURL: ",[81,388,219],{"class":98},[81,390,222],{"class":91},[81,392,394],{"class":393,"line":159},[83,211],[81,395,396],{"class":91},"  apiKey: process.env.LARAS_API_KEY,\n",[81,398,399],{"class":83,"line":160},[81,400,401],{"class":91},"});\n",[81,403,404],{"class":83,"line":242},[81,405,193],{"emptyLinePlaceholder":192},[81,407,408,410,413,415,418,420,422],{"class":83,"line":248},[81,409,367],{"class":87},[81,411,412],{"class":91}," resp ",[81,414,95],{"class":87},[81,416,417],{"class":87}," await",[81,419,261],{"class":91},[81,421,264],{"class":98},[81,423,380],{"class":91},[81,425,426,429,431],{"class":83,"line":253},[81,427,428],{"class":91},"  model: ",[81,430,277],{"class":98},[81,432,222],{"class":91},[81,434,435,438,440,443,445],{"class":83,"line":269},[81,436,437],{"class":91},"  messages: [{ role: ",[81,439,299],{"class":98},[81,441,442],{"class":91},", content: ",[81,444,310],{"class":98},[81,446,447],{"class":91}," }],\n",[81,449,450],{"class":83,"line":282},[81,451,401],{"class":91},[81,453,454,457,460,462,464],{"class":83,"line":316},[81,455,456],{"class":91},"console.",[81,458,459],{"class":98},"log",[81,461,327],{"class":91},[81,463,330],{"class":98},[81,465,466],{"class":91},"].message.content);\n",[72,468,473],{"className":74,"code":469,"filename":470,"highlights":471,"language":76,"meta":472,"style":77},"curl https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $LARAS_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"model\": \"deepseek-v4.1-flash\", \"messages\": [{\"role\": \"user\", \"content\": \"Halo!\"}]}'\n","cURL",[84,175],"file=terminal",[67,474,475,487,498,507],{"__ignoreMap":77},[81,476,478,481,484],{"class":477,"line":84},[83,211],[81,479,480],{"class":98},"curl",[81,482,483],{"class":98}," https:\u002F\u002Fapi.larasrouter.com\u002Fv1\u002Fchat\u002Fcompletions",[81,485,486],{"class":91}," \\\n",[81,488,490,493,496],{"class":489,"line":175},[83,211],[81,491,492],{"class":98},"  -H",[81,494,495],{"class":98}," \"Authorization: Bearer $LARAS_API_KEY\"",[81,497,486],{"class":91},[81,499,500,502,505],{"class":83,"line":189},[81,501,492],{"class":98},[81,503,504],{"class":98}," \"Content-Type: application\u002Fjson\"",[81,506,486],{"class":91},[81,508,509,512],{"class":83,"line":196},[81,510,511],{"class":98},"  -d",[81,513,514],{"class":98}," '{\"model\": \"deepseek-v4.1-flash\", \"messages\": [{\"role\": \"user\", \"content\": \"Halo!\"}]}'\n",[516,517,519],"h4",{"id":518},"response","Response",[15,521,522,523,526],{},"The ",[67,524,525],{},"usage"," object is what you are billed for. Cache hits and misses are priced separately.",[72,528,534],{"className":529,"code":530,"highlights":531,"language":532,"meta":533,"style":77},"language-json shiki shiki-themes laras-ink","\"usage\": {\n  \"prompt_tokens\": 12400,\n  \"prompt_cache_hit_tokens\": 8000,\n  \"prompt_cache_miss_tokens\": 4400,\n  \"completion_tokens\": 1800,\n  \"total_tokens\": 14200\n}\n",[189,196],"json","light",[67,535,536,544,556,569,582,594,604],{"__ignoreMap":77},[81,537,538,541],{"class":83,"line":84},[81,539,540],{"class":98},"\"usage\"",[81,542,543],{"class":91},": {\n",[81,545,546,549,551,554],{"class":83,"line":175},[81,547,548],{"class":91},"  \"prompt_tokens\"",[81,550,296],{"class":91},[81,552,553],{"class":98},"12400",[81,555,222],{"class":91},[81,557,559,562,564,567],{"class":558,"line":189},[83,211],[81,560,561],{"class":91},"  \"prompt_cache_hit_tokens\"",[81,563,296],{"class":91},[81,565,566],{"class":98},"8000",[81,568,222],{"class":91},[81,570,572,575,577,580],{"class":571,"line":196},[83,211],[81,573,574],{"class":91},"  \"prompt_cache_miss_tokens\"",[81,576,296],{"class":91},[81,578,579],{"class":98},"4400",[81,581,222],{"class":91},[81,583,584,587,589,592],{"class":83,"line":159},[81,585,586],{"class":91},"  \"completion_tokens\"",[81,588,296],{"class":91},[81,590,591],{"class":98},"1800",[81,593,222],{"class":91},[81,595,596,599,601],{"class":83,"line":160},[81,597,598],{"class":91},"  \"total_tokens\"",[81,600,296],{"class":91},[81,602,603],{"class":98},"14200\n",[81,605,606],{"class":83,"line":242},[81,607,608],{"class":91},"}\n",[15,610,611,612,615,616,619,620,623,624,627,628,631,632,635],{},"On ",[67,613,614],{},"deepseek-v4.1-flash"," this request costs ",[38,617,618],{},"$0.004720",": 8,000 cache-hit tokens at $0.010, 4,400 cache-miss tokens at $0.400, and 1,800 output tokens at $1.600 per 1M. The DeepSeek models report the split as ",[67,621,622],{},"prompt_cache_hit_tokens"," and ",[67,625,626],{},"prompt_cache_miss_tokens","; ",[67,629,630],{},"glm-5.3-flash"," reports cache hits as ",[67,633,634],{},"prompt_tokens_details.cached_tokens",".",[15,637,638,639,642],{},"Every response also carries an ",[67,640,641],{},"X-Laras-Request-ID"," header. Keep it if you need to ask us about a charge.",[644,645,647],"h2",{"id":646},"request-body","Request body",[15,649,650],{},"The body follows the OpenAI chat completions format. The fields you will use most:",[652,653,654,670],"table",{},[655,656,657],"thead",{},[658,659,660,664,667],"tr",{},[661,662,663],"th",{},"Field",[661,665,666],{},"Type",[661,668,669],{},"Description",[671,672,673,705,723,738],"tbody",{},[658,674,675,687,692],{},[676,677,678,681,682],"td",{},[67,679,680],{},"model"," ",[81,683,686],{"className":684},[685],"req","required",[676,688,689],{},[67,690,691],{},"string",[676,693,694,302,696,302,699,701,702,635],{},[67,695,614],{},[67,697,698],{},"deepseek-v4-pro",[67,700,630],{},", or ",[67,703,704],{},"glm-5.3",[658,706,707,715,720],{},[676,708,709,681,712],{},[67,710,711],{},"messages",[81,713,686],{"className":714},[685],[676,716,717],{},[67,718,719],{},"array",[676,721,722],{},"The conversation so far, as role and content pairs.",[658,724,725,730,735],{},[676,726,727],{},[67,728,729],{},"stream",[676,731,732],{},[67,733,734],{},"boolean",[676,736,737],{},"Return tokens as server-sent events while they generate.",[658,739,740,745,750],{},[676,741,742],{},[67,743,744],{},"max_tokens",[676,746,747],{},[67,748,749],{},"integer",[676,751,752],{},"Upper bound on output tokens, useful for capping cost.",[15,754,755,756,635],{},"Every field is described in the ",[19,757,759],{"href":758},"\u002Freference\u002Fchat-completions","Chat completions reference",[644,761,763],{"id":762},"limits","Limits",[765,766,767,774,780],"stats",{},[768,769,771],"stat",{"value":770},"300",[15,772,773],{},"requests per minute, per key",[768,775,777],{"value":776},"16",[15,778,779],{},"concurrent requests, per key",[768,781,783],{"value":782},"$1–$100",[15,784,785],{},"per QRIS top-up",[644,787,789],{"id":788},"next-steps","Next steps",[791,792,793,801,808],"cards",{"cols":189},[794,795,798],"card",{"title":796,"to":797},"Use with Claude Code","\u002Fintegrations\u002Fclaude-code",[15,799,800],{},"Point your coding agent at Laras Router.",[794,802,805],{"title":803,"to":804},"Spend controls","\u002Fguides\u002Fbilling#key-budgets",[15,806,807],{},"Set a monthly budget on each key.",[794,809,812],{"title":810,"to":811},"Errors","\u002Fguides\u002Ferrors",[15,813,814],{},"What each status code means and how to retry.",[816,817,818],"style",{},"html pre.shiki code .sifj9, html code.shiki .sifj9{--shiki-default:#8A8F98}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);}",{"title":77,"searchDepth":189,"depth":189,"links":820},[821,822,823,824,827,828,829],{"id":32,"depth":189,"text":33},{"id":53,"depth":189,"text":54},{"id":102,"depth":189,"text":103},{"id":142,"depth":189,"text":143,"children":825},[826],{"id":518,"depth":196,"text":519},{"id":646,"depth":175,"text":647},{"id":762,"depth":175,"text":763},{"id":788,"depth":175,"text":789},"Send your first request in about five minutes. If you already use the OpenAI SDK, you only change two lines.","md",null,{},"\u002Fquickstart",{"title":5,"description":830},"quickstart","2026-11-15","1r4qvTU35hWJOs3fH9MZEJRkHVHTTDezLsUdBZavvsc",{"en":840,"id":872},{"\u002Fauthentication":841,"\u002Fchangelog":842,"\u002Fguides\u002Fbilling":40,"\u002Fguides\u002Ferrors":843,"\u002Fguides\u002Fjson-output":844,"\u002Fguides\u002Frate-limits":845,"\u002Fguides\u002Freasoning":846,"\u002Fguides\u002Fstreaming":847,"\u002Fguides\u002Ftool-calling":848,"\u002Fguides\u002Ftop-up":49,"\u002F":849,"\u002Fintegrations\u002Faider":850,"\u002Fintegrations\u002Fclaude-code":851,"\u002Fintegrations\u002Fcline":852,"\u002Fintegrations\u002Fcontinue":853,"\u002Fintegrations\u002Fgoose":854,"\u002Fintegrations\u002Fhermes":855,"\u002Fintegrations":856,"\u002Fintegrations\u002Fkilo-code":857,"\u002Fintegrations\u002Flangchain":858,"\u002Fintegrations\u002Foh-my-pi":859,"\u002Fintegrations\u002Fopenai-sdk":860,"\u002Fintegrations\u002Fopenclaw":861,"\u002Fintegrations\u002Fopencode":862,"\u002Fintegrations\u002Fpi":863,"\u002Fintegrations\u002Fvercel-ai-sdk":864,"\u002Fintegrations\u002Fzed":865,"\u002Fmodels":866,"\u002Fquickstart":5,"\u002Freference\u002Fchat-completions":867,"\u002Freference":856,"\u002Freference\u002Fmessages":868,"\u002Freference\u002Fmodels":869,"\u002Freference\u002Fmodels-retrieve":870,"\u002Fsupport":871},"Authentication","Changelog","Errors & retries","JSON output","Rate limits","Reasoning content","Streaming","Tool calling","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","Chat completions","Messages","List models","Retrieve a model","Support",{"\u002Fauthentication":873,"\u002Fchangelog":842,"\u002Fguides\u002Fbilling":40,"\u002Fguides\u002Ferrors":874,"\u002Fguides\u002Fjson-output":875,"\u002Fguides\u002Frate-limits":876,"\u002Fguides\u002Freasoning":877,"\u002Fguides\u002Fstreaming":847,"\u002Fguides\u002Ftool-calling":848,"\u002Fguides\u002Ftop-up":878,"\u002F":879,"\u002Fintegrations\u002Faider":850,"\u002Fintegrations\u002Fclaude-code":851,"\u002Fintegrations\u002Fcline":852,"\u002Fintegrations\u002Fcontinue":853,"\u002Fintegrations\u002Fgoose":854,"\u002Fintegrations\u002Fhermes":855,"\u002Fintegrations":880,"\u002Fintegrations\u002Fkilo-code":857,"\u002Fintegrations\u002Flangchain":858,"\u002Fintegrations\u002Foh-my-pi":859,"\u002Fintegrations\u002Fopenai-sdk":881,"\u002Fintegrations\u002Fopenclaw":861,"\u002Fintegrations\u002Fopencode":862,"\u002Fintegrations\u002Fpi":863,"\u002Fintegrations\u002Fvercel-ai-sdk":864,"\u002Fintegrations\u002Fzed":865,"\u002Fmodels":882,"\u002Fquickstart":5,"\u002Freference\u002Fchat-completions":867,"\u002Freference":880,"\u002Freference\u002Fmessages":868,"\u002Freference\u002Fmodels":883,"\u002Freference\u002Fmodels-retrieve":884,"\u002Fsupport":871},"Autentikasi","Error & retry","Output JSON","Rate limit","Konten reasoning","Isi saldo dengan QRIS","Pengantar","Ringkasan","OpenAI SDK","Model","Daftar model","Ambil satu model",1796424410878]