[{"data":1,"prerenderedAt":301},["ShallowReactive",2],{"navigation_docs_en":3,"-en-guide-getting-started":31,"-en-guide-getting-started-surround":298},[4,14],{"title":5,"path":6,"stem":7,"children":8,"page":13},"Getting started","/en/guide","en/guide",[9],{"title":10,"path":11,"stem":12},"API Getting Started","/en/guide/getting-started","en/guide/getting-started",false,{"title":15,"path":16,"stem":17,"children":18,"page":13},"Terms and policies","/en/policies","en/policies",[19,23,27],{"title":20,"path":21,"stem":22},"Privacy policy","/en/policies/privacy-policy","en/policies/privacy-policy",{"title":24,"path":25,"stem":26},"Supported countries and regions","/en/policies/supported-regions","en/policies/supported-regions",{"title":28,"path":29,"stem":30},"User agreement","/en/policies/user-agreement","en/policies/user-agreement",{"id":32,"title":10,"body":33,"description":291,"extension":292,"links":293,"meta":294,"navigation":295,"path":11,"seo":296,"stem":12,"__hash__":297},"docs_en/en/guide/getting-started.md",{"type":34,"value":35,"toc":283},"minimark",[36,40,45,48,51,71,75,78,92,95,99,107,115,118,121,127,233,237,251,264,268],[37,38,39],"p",{},"Prepare an API Key and model name in the console, send your first request from an API client, then check usage records. This page contains examples and does not make API calls.",[41,42,44],"h2",{"id":43},"_1-prepare-your-request","1. Prepare your request",[37,46,47],{},"Choose an active API Key, check its groups and model restrictions, and obtain the API address provided by the platform.",[49,50],"docs-getting-started-main-handoff",{},[52,53,55],"div",{"dataTestid":54},"docs-getting-started-setup-steps",[56,57,58,62,65,68],"ol",{},[59,60,61],"li",{},"Open API Keys and create or choose an enabled Key.",[59,63,64],{},"Find the model name in the model catalog and check that the Key's groups and model restrictions allow it.",[59,66,67],{},"Use the platform's Base URL in your API client to send the non-streaming request below.",[59,69,70],{},"After the request, find its usage record by time, status, model, and Key suffix.",[41,72,74],{"id":73},"_2-send-the-first-request-from-your-api-client","2. Send the first request from your API client",[37,76,77],{},"Replace BASE_URL with the platform's API address, including /v1. Replace API_KEY with your Key and MODEL_ID with the model name, removing the surrounding angle brackets from each placeholder.",[52,79,81],{"dataTestid":80},"docs-getting-started-request-example",[82,83,89],"pre",{"className":84,"code":86,"language":87,"meta":88},[85],"language-bash","curl --request POST '\u003CBASE_URL>/chat/completions' \\\n  --header 'Authorization: Bearer \u003CAPI_KEY>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"model\": \"\u003CMODEL_ID>\",\n    \"messages\": [\n      { \"role\": \"user\", \"content\": \"Reply with a short connection confirmation.\" }\n    ],\n    \"stream\": false\n  }'\n","bash","",[90,91,86],"code",{"__ignoreMap":88},[37,93,94],{},"Replace these example values in your own client. Keep real Keys out of code repositories, chats, and shell history.",[41,96,98],{"id":97},"_3-read-the-response","3. Read the response",[37,100,101,102,106],{},"A successful call requires HTTP 200, parseable JSON, object = chat.completion, and a non-empty choices",[103,104,105],"span",{},"0",".message.content.",[82,108,113],{"className":109,"code":111,"language":112,"meta":88},[110],"language-json","{\n  \"id\": \"\u003CCOMPLETION_ID>\",\n  \"object\": \"chat.completion\",\n  \"created\": 0,\n  \"model\": \"\u003CMODEL_ID>\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": { \"role\": \"assistant\", \"content\": \"\u003CMODEL_OUTPUT>\" },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 0,\n    \"completion_tokens\": 0,\n    \"total_tokens\": 0\n  }\n}\n","json",[90,114,111],{"__ignoreMap":88},[37,116,117],{},"The JSON below illustrates the response structure. Check the actual HTTP status and content returned by your request.",[37,119,120],{},"Failures use the standard OpenAI-compatible error envelope:",[82,122,125],{"className":123,"code":124,"language":112,"meta":88},[110],"{\n  \"error\": {\n    \"message\": \"\u003CUSER_VISIBLE_MESSAGE>\",\n    \"type\": \"\u003CERROR_TYPE>\",\n    \"param\": \"\u003CRELATED_PARAMETER_OR_NULL>\",\n    \"code\": \"\u003CERROR_CODE>\"\n  }\n}\n",[90,126,124],{"__ignoreMap":88},[52,128,133],{"ariaLabel":129,"className":130,"role":132},"HTTP failure meaning and next action",[131],"docs-error-table","region",[134,135,136,152],"table",{},[137,138,139],"thead",{},[140,141,142,146,149],"tr",{},[143,144,145],"th",{},"HTTP status",[143,147,148],{},"Meaning",[143,150,151],{},"Next action",[153,154,155,167,178,189,200,211,222],"tbody",{},[140,156,157,161,164],{},[158,159,160],"td",{},"400",[158,162,163],{},"The JSON, model, or request fields are invalid",[158,165,166],{},"Check the request body, model name, and error.param/code.",[140,168,169,172,175],{},[158,170,171],{},"401",[158,173,174],{},"Bearer authentication is missing, malformed, or unusable",[158,176,177],{},"Check the Authorization header and Key status. Never send the full Key to support.",[140,179,180,183,186],{},[158,181,182],{},"403",[158,184,185],{},"The Key cannot use the selected model, group, or source",[158,187,188],{},"Check the Key's groups, model restrictions, and source restrictions.",[140,190,191,194,197],{},[158,192,193],{},"429",[158,195,196],{},"Quota, budget, or rate limiting rejected the call",[158,198,199],{},"Read error.code and Retry-After when present. Stop immediate retries.",[140,201,202,205,208],{},[158,203,204],{},"422",[158,206,207],{},"The server could not process the request",[158,209,210],{},"Correct the request using error.message and the relevant fields.",[140,212,213,216,219],{},[158,214,215],{},"503",[158,217,218],{},"The service is temporarily unavailable",[158,220,221],{},"Keep the time and error code, then retry later or contact support.",[140,223,224,227,230],{},[158,225,226],{},"No HTTP response",[158,228,229],{},"The request outcome is unknown",[158,231,232],{},"Check Console request history first. Do not immediately replay a request that may be billable.",[41,234,236],{"id":235},"_4-check-usage-records","4. Check usage records",[56,238,239,242,245,248],{},[59,240,241],{},"Open usage records and select a time range covering your request.",[59,243,244],{},"Find the record by time, status, model, and Key suffix, without entering the secret again.",[59,246,247],{},"Compare its status, model, Key suffix, and timestamp with the request you sent.",[59,249,250],{},"Records may appear after a short delay. Keep the response and refresh manually; do not resend a request just because the list is temporarily empty.",[252,253,257,261],"u-alert",{"color":254,"icon":255,"variant":256},"warning","i-lucide-circle-pause","subtle",[258,259,260],"template",{"v-slot:title":88},"If the outcome is unknown, check records first",[258,262,263],{"v-slot:description":88},"A lost connection does not mean the request was never processed. Check usage records before retrying. If records are unavailable, keep the response and timestamp and confirm the outcome after recovery to avoid duplicate charges.",[41,265,267],{"id":266},"protect-your-api-key","Protect your API Key",[269,270,271,274,277,280],"ul",{},[59,272,273],{},"Use the Key only in your own API client. This page does not read or store it.",[59,275,276],{},"Keep Keys out of URLs, public pages, and code repositories.",[59,278,279],{},"Remove Keys, Authorization headers, cookies, and other credentials before sharing screenshots, logs, or troubleshooting details.",[59,281,282],{},"If a Key may have leaked, disable or delete it in the console and update your client with a replacement.",{"title":88,"searchDepth":284,"depth":284,"links":285},2,[286,287,288,289,290],{"id":43,"depth":284,"text":44},{"id":73,"depth":284,"text":74},{"id":97,"depth":284,"text":98},{"id":235,"depth":284,"text":236},{"id":266,"depth":284,"text":267},"Prepare an API Key, send your first request, understand the response, and check usage records.","md",null,{},{"title":10},{"title":10,"description":291},"90yfUhAzRdX3BNp5kxbHOkXpAfCSKnbZcMQ2ebcHOc4",[293,299],{"title":20,"path":21,"stem":22,"description":300,"children":-1},"Code4AI Privacy policy.",1793640194203]