curl -X POST https://api-llm.sunra.ai/v1/chat/completions \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-2.5-flash", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is the capital of France?" } ] }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/chat/completions", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-2.5-flash", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"} ] })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-2.5-flash", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is the capital of France?" } ] })});const data = await response.json();console.log(data);
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1677652288, "model": "google/gemini-2.5-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is Paris.", "refusal": null }, "finish_reason": "stop", "logprobs": null } ], "system_fingerprint": "fp_44709d6fcb", "usage": { "prompt_tokens": 25, "completion_tokens": 8, "total_tokens": 33, "prompt_tokens_details": null, "completion_tokens_details": null }}
LLM
Create a chat completion
POST
/
v1
/
chat
/
completions
curl -X POST https://api-llm.sunra.ai/v1/chat/completions \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-2.5-flash", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is the capital of France?" } ] }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/chat/completions", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-2.5-flash", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"} ] })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-2.5-flash", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is the capital of France?" } ] })});const data = await response.json();console.log(data);
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1677652288, "model": "google/gemini-2.5-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is Paris.", "refusal": null }, "finish_reason": "stop", "logprobs": null } ], "system_fingerprint": "fp_44709d6fcb", "usage": { "prompt_tokens": 25, "completion_tokens": 8, "total_tokens": 33, "prompt_tokens_details": null, "completion_tokens_details": null }}
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes, text, images, audio, video, files, function calling, reasoning, and structured outputs. Compatible with the OpenAI Chat Completions API format.
If set to true, partial message deltas will be sent as server-sent events (SSE). Streams are subject to an idle timeout and a lifetime ceiling — see Output limits and stream lifetime. A non-streaming request is terminated at the edge if the response takes too long to arrive, so any request that may generate for more than ~90 seconds must set stream: true — see the edge timeout.
Maximum tokens in completion. Replaces max_tokens as the preferred parameter. On providers that do not honor this field the gateway translates it into max_tokens; when both are set, the smaller one applies. See Output limits.
Maximum tokens in completion. Deprecated — use max_completion_tokens instead. Note: some providers enforce a minimum of 16. A value above the model’s own output ceiling is rejected with 400 rather than reduced.
Sampling temperature between 0 and 2. Higher values like 0.8 make output more random, lower values like 0.2 make it more focused and deterministic. For OpenAI reasoning models (gpt-5.x, gpt-6-*) with reasoning enabled (reasoning_effort other than none), temperature and top_p are not supported upstream; the gateway drops them silently instead of returning 400, so the request still succeeds. Set reasoning_effort: "none" if you need sampling control.
Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.
Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position. logprobs must be set to true if this parameter is used.
Cross-vendor switch for extended thinking. For OpenAI-family reasoning models (gpt-5.x, gpt-6-*) the gateway maps it to reasoning_effort: {"type": "disabled"} becomes reasoning_effort: "none", {"type": "enabled"} leaves the model’s default effort, and an explicit reasoning_effort always wins.
If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Controls which (if any) tool is called by the model. none means no tool calls. auto means the model decides. required means the model must call a tool. Can also specify a particular function.
Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
A unique identifier for the chat completion. Currently the upstream model provider’s own id, forwarded as-is — its format varies by provider. This is switching to a Sunra-issued value (breaking change, date to be announced): see Response identifiers and tracking. The same id is always available via the x-sunra-prediction-id response header, unaffected by that change.
This fingerprint represents the backend configuration that the model runs with. Can be used with the seed parameter to understand when backend changes have been made.
curl -X POST https://api-llm.sunra.ai/v1/chat/completions \ -H "Authorization: Bearer <SUNRA_KEY>" \ -H "Content-Type: application/json" \ -d '{ "model": "google/gemini-2.5-flash", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "What is the capital of France?" } ] }'
import requestsresponse = requests.post( "https://api-llm.sunra.ai/v1/chat/completions", headers={ "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, json={ "model": "google/gemini-2.5-flash", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"} ] })print(response.json())
const response = await fetch("https://api-llm.sunra.ai/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer <SUNRA_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ model: "google/gemini-2.5-flash", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is the capital of France?" } ] })});const data = await response.json();console.log(data);
{ "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1677652288, "model": "google/gemini-2.5-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is Paris.", "refusal": null }, "finish_reason": "stop", "logprobs": null } ], "system_fingerprint": "fp_44709d6fcb", "usage": { "prompt_tokens": 25, "completion_tokens": 8, "total_tokens": 33, "prompt_tokens_details": null, "completion_tokens_details": null }}
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Sunra.ai","colors":{"primary":"#ff632f","light":"#ff632f","dark":"#ff632f"},"logo":{"light":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a","dark":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/dark.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=16e2ed4856376448550627daa81544b9"},"favicon":"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/favicon.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=c47b7db8e76fb19f94de55c161e2fcd1","api":{},"navbar":{"links":[{"href":"https://sunra.ai/about","label":"About"}],"primary":{"type":"button","label":"Go to sunra.ai","href":"https://sunra.ai"}},"footer":{"socials":{"x":"https://x.com/sunra_ai","discord":"https://discord.gg/897qCzvCcU","github":"https://github.com/sunra-ai"}},"integrations":{"amplitude":{"apiKey":"94a6621e5239157d3f0a392f6d5f8a21"}},"banner":{"content":"The developer site has moved to **platform.sunra.ai**. API endpoints, SDKs and keys are unchanged — you may just need to sign in again.","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","href":""},{"language":"zh-Hans","href":"zh-Hans"},{"language":"zh-Hant","href":"zh-Hant"},{"language":"fr","href":"fr"},{"language":"ja","href":"ja"},{"language":"es","href":"es"},{"language":"pt","href":"pt"},{"language":"hi","href":"hi"},{"language":"tr","href":"tr"},{"language":"de","href":"de"},{"language":"id","href":"id"},{"language":"it","href":"it"},{"language":"ko","href":"ko"},{"language":"ru","href":"ru"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sunraai","hasAudioNarration":false,"actualSubdomain":"sunraai","customDomains":["docs.sunra.ai"],"gitSource":{"type":"github","owner":"sunra-ai","repo":"sunra-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae46d92a3eed560d7e4c18a","collectionId":"4754d27b-94dc-45d7-b9f3-30dbad1abac8","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae46d92a3eed560d7e4c18a"},"entitlements":{},"buildId":"6ae46d92a3eed560d7e4c18a","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"en","tag":"Multimodal","count":10},{"language":"en","tag":"LLM","count":9},{"language":"de","tag":"Multimodal","count":9},{"language":"es","tag":"Multimodal","count":9},{"language":"fr","tag":"Multimodal","count":9},{"language":"hi","tag":"Multimodal","count":9},{"language":"id","tag":"Multimodal","count":9},{"language":"it","tag":"Multimodal","count":9},{"language":"ja","tag":"Multimodal","count":9},{"language":"ko","tag":"Multimodal","count":9},{"language":"pt","tag":"Multimodal","count":9},{"language":"ru","tag":"Multimodal","count":9},{"language":"tr","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"Multimodal","count":9},{"language":"zh-Hant","tag":"Multimodal","count":9},{"language":"zh-Hans","tag":"LLM","count":8},{"language":"en","tag":"Platform","count":6},{"language":"de","tag":"LLM","count":6},{"language":"es","tag":"LLM","count":6},{"language":"fr","tag":"LLM","count":6},{"language":"hi","tag":"LLM","count":6},{"language":"id","tag":"LLM","count":6},{"language":"it","tag":"LLM","count":6},{"language":"ja","tag":"LLM","count":6},{"language":"ko","tag":"LLM","count":6},{"language":"pt","tag":"LLM","count":6},{"language":"ru","tag":"LLM","count":6},{"language":"tr","tag":"LLM","count":6},{"language":"zh-Hant","tag":"LLM","count":6},{"language":"zh-Hans","tag":"平台","count":5},{"language":"en","tag":"Client Libraries","count":4},{"language":"de","tag":"Client-Bibliotheken","count":4},{"language":"es","tag":"Bibliotecas de cliente","count":4},{"language":"fr","tag":"Bibliothèques clientes","count":4},{"language":"hi","tag":"क्लाइंट लाइब्रेरी","count":4},{"language":"id","tag":"Pustaka Klien","count":4},{"language":"it","tag":"Librerie client","count":4},{"language":"ja","tag":"クライアントライブラリ","count":4},{"language":"ko","tag":"클라이언트 라이브러리","count":4},{"language":"pt","tag":"Bibliotecas de cliente","count":4},{"language":"ru","tag":"Клиентские библиотеки","count":4},{"language":"tr","tag":"İstemci Kütüphaneleri","count":4},{"language":"zh-Hans","tag":"客户端 SDK","count":4},{"language":"zh-Hant","tag":"客戶端 SDK","count":4},{"language":"en","tag":"Overview","count":1},{"language":"de","tag":"Überblick","count":1},{"language":"es","tag":"Descripción general","count":1},{"language":"fr","tag":"Aperçu","count":1},{"language":"hi","tag":"अवलोकन","count":1},{"language":"id","tag":"Ikhtisar","count":1},{"language":"it","tag":"Panoramica","count":1},{"language":"ja","tag":"概要","count":1},{"language":"ko","tag":"개요","count":1},{"language":"pt","tag":"Visão geral","count":1},{"language":"ru","tag":"Обзор","count":1},{"language":"tr","tag":"Genel Bakış","count":1},{"language":"zh-Hans","tag":"概述","count":1},{"language":"zh-Hant","tag":"概述","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navbar>div>div>div>div>div{border-bottom:0}.codeblock-light{background:#fafafa!important}.dark .codeblock-light{background:#0a0a0a!important}#search-bar-entry>span{font-weight:400!important}#assistant-entry>span{color:#000!important}.dark #assistant-entry>span{color:#fff!important}.rounded-2xl,.rounded-3xl,.rounded-\\[14px\\],.rounded-full,.rounded-lg,.rounded-md,.rounded-sm,.rounded-xl{border-radius:4px!important}"}],"page":{"pagePath":"llm/chat","slug":"/llm/chat","pageMetadata":{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","description":null,"href":"/llm/chat"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components},{Expandable,Heading,ParamField,ResponseField,Tab,Tabs}=_components;if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes, text, images, audio, video, files, function calling, reasoning, and structured outputs. Compatible with the OpenAI Chat Completions API format.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsx(_components.p,{children:`Bearer token. Use your API key as the bearer token in the Authorization header.`}),_jsxs(_components.p,{children:[`Format: `,_jsx(_components.code,{children:`Bearer \u003cSUNRA_KEY>`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(_components.p,{children:`This endpoint expects an object.`}),`\n`,_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsxs(_components.p,{children:[`List of messages for the conversation. Each message has a `,_jsx(_components.code,{children:`role`}),` and `,_jsx(_components.code,{children:`content`}),`.`]}),_jsx(Expandable,{title:`message types`,children:_jsxs(Tabs,{children:[_jsxs(Tab,{title:`SystemMessage`,id:`systemmessage`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`system`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content`,children:_jsx(_components.p,{children:`The system message content. Can be a string or array of text content parts.`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name`,children:_jsx(_components.p,{children:`Optional name for the system message.`})})]}),_jsxs(Tab,{title:`UserMessage`,id:`usermessage`,\"data-child-tab-ids\":`[\"text\",\"image_url\",\"input_audio\",\"video_url\",\"file\"]`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role-1`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`user`}),`.`]})}),_jsxs(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content-1`,children:[_jsx(_components.p,{children:`The user message content. Can be a string or array of content parts.`}),_jsx(Expandable,{title:`content part types`,children:_jsxs(Tabs,{children:[_jsxs(Tab,{title:`text`,id:`text`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`text`}),`.`]})}),_jsx(ParamField,{body:`text`,type:`string`,required:true,id:`param-text`,children:_jsx(_components.p,{children:`The text content.`})}),_jsxs(ParamField,{body:`cache_control`,type:`object`,id:`param-cache-control`,children:[_jsx(_components.p,{children:`Cache control for this content part.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-1`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`ephemeral`}),`.`]})}),_jsx(ParamField,{body:`ttl`,type:`string`,id:`param-ttl`,children:_jsxs(_components.p,{children:[`Cache TTL. Supported values: `,_jsx(_components.code,{children:`5m`}),`, `,_jsx(_components.code,{children:`1h`}),`.`]})})]})]})]}),_jsxs(Tab,{title:`image_url`,id:`image_url`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-2`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`image_url`}),`.`]})}),_jsxs(ParamField,{body:`image_url`,type:`object`,required:true,id:`param-image-url`,children:[_jsx(_components.p,{children:`Image URL object.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`url`,type:`string`,required:true,id:`param-url`,children:_jsxs(_components.p,{children:[`URL of the image. Supports `,_jsx(_components.code,{children:`data:`}),` URLs for base64 encoded images.`]})}),_jsx(ParamField,{body:`detail`,type:`string`,id:`param-detail`,children:_jsxs(_components.p,{children:[`Image detail level for vision models. Supported values: `,_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`high`}),`.`]})})]})]})]}),_jsxs(Tab,{title:`input_audio`,id:`input_audio`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-3`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`input_audio`}),`.`]})}),_jsxs(ParamField,{body:`input_audio`,type:`object`,required:true,id:`param-input-audio`,children:[_jsx(_components.p,{children:`Audio input data.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`data`,type:`string`,required:true,id:`param-data`,children:_jsx(_components.p,{children:`Base64 encoded audio data.`})}),_jsx(ParamField,{body:`format`,type:`string`,required:true,id:`param-format`,children:_jsxs(_components.p,{children:[`Audio format (e.g., `,_jsx(_components.code,{children:`wav`}),`, `,_jsx(_components.code,{children:`mp3`}),`, `,_jsx(_components.code,{children:`flac`}),`, `,_jsx(_components.code,{children:`m4a`}),`, `,_jsx(_components.code,{children:`ogg`}),`, `,_jsx(_components.code,{children:`aiff`}),`, `,_jsx(_components.code,{children:`aac`}),`). Supported formats vary by provider.`]})})]})]})]}),_jsxs(Tab,{title:`video_url`,id:`video_url`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-4`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`video_url`}),`.`]})}),_jsxs(ParamField,{body:`video_url`,type:`object`,required:true,id:`param-video-url`,children:[_jsx(_components.p,{children:`Video input object.`}),_jsx(Expandable,{title:`properties`,children:_jsx(ParamField,{body:`url`,type:`string`,required:true,id:`param-url-1`,children:_jsxs(_components.p,{children:[`URL of the video. Supports `,_jsx(_components.code,{children:`data:`}),` URLs for base64 encoded video.`]})})})]})]}),_jsxs(Tab,{title:`file`,id:`file`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-5`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`file`}),`.`]})}),_jsxs(ParamField,{body:`file`,type:`object`,required:true,id:`param-file`,children:[_jsx(_components.p,{children:`File content for document processing.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`file_data`,type:`string`,id:`param-file-data`,children:_jsx(_components.p,{children:`File content as base64 data URL or URL.`})}),_jsx(ParamField,{body:`file_id`,type:`string`,id:`param-file-id`,children:_jsx(_components.p,{children:`File ID for previously uploaded files.`})}),_jsx(ParamField,{body:`filename`,type:`string`,id:`param-filename`,children:_jsx(_components.p,{children:`Original filename.`})})]})]})]})]})})]}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name-1`,children:_jsx(_components.p,{children:`Optional name for the user.`})})]}),_jsxs(Tab,{title:`DeveloperMessage`,id:`developermessage`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role-2`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`developer`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content-2`,children:_jsx(_components.p,{children:`The developer message content. Can be a string or array of text content parts.`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name-2`,children:_jsx(_components.p,{children:`Optional name for the developer message.`})})]}),_jsxs(Tab,{title:`AssistantMessage`,id:`assistantmessage`,\"data-child-tab-ids\":`[\"summary\",\"encrypted\",\"text-2\"]`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role-3`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`assistant`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[] | null`,id:`param-content-3`,children:_jsx(_components.p,{children:`The assistant message content. Can be a string, array of content parts, or null (when tool_calls are present).`})}),_jsx(ParamField,{body:`name`,type:`string`,id:`param-name-3`,children:_jsx(_components.p,{children:`Optional name for the assistant.`})}),_jsxs(ParamField,{body:`tool_calls`,type:`object[]`,id:`param-tool-calls`,children:[_jsx(_components.p,{children:`Tool calls made by the assistant.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`Tool call identifier.`})}),_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-6`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`function`}),`.`]})}),_jsxs(ParamField,{body:`function`,type:`object`,required:true,id:`param-function`,children:[_jsx(_components.p,{children:`The function called.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-4`,children:_jsx(_components.p,{children:`Function name.`})}),_jsx(ParamField,{body:`arguments`,type:`string`,required:true,id:`param-arguments`,children:_jsx(_components.p,{children:`Function arguments as JSON string.`})})]})]})]})]}),_jsx(ParamField,{body:`refusal`,type:`string | null`,id:`param-refusal`,children:_jsx(_components.p,{children:`Refusal message if content was refused.`})}),_jsx(ParamField,{body:`reasoning`,type:`string | null`,id:`param-reasoning`,children:_jsx(_components.p,{children:`Reasoning output text.`})}),_jsxs(ParamField,{body:`reasoning_details`,type:`object[]`,id:`param-reasoning-details`,children:[_jsx(_components.p,{children:`Detailed reasoning information for extended thinking models.`}),_jsx(Expandable,{title:`reasoning detail types`,children:_jsxs(Tabs,{children:[_jsxs(Tab,{title:`summary`,id:`summary`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-7`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.summary`}),`.`]})}),_jsx(ParamField,{body:`summary`,type:`string`,required:true,id:`param-summary`,children:_jsx(_components.p,{children:`The reasoning summary text.`})}),_jsx(ParamField,{body:`id`,type:`string | null`,id:`param-id-1`,children:_jsx(_components.p,{children:`Reasoning detail ID.`})}),_jsx(ParamField,{body:`format`,type:`string | null`,id:`param-format-1`,children:_jsxs(_components.p,{children:[`Format. Supported values: `,_jsx(_components.code,{children:`unknown`}),`, `,_jsx(_components.code,{children:`openai-responses-v1`}),`, `,_jsx(_components.code,{children:`azure-openai-responses-v1`}),`, `,_jsx(_components.code,{children:`xai-responses-v1`}),`, `,_jsx(_components.code,{children:`anthropic-claude-v1`}),`, `,_jsx(_components.code,{children:`google-gemini-v1`}),`.`]})})]}),_jsxs(Tab,{title:`encrypted`,id:`encrypted`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-8`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.encrypted`}),`.`]})}),_jsx(ParamField,{body:`data`,type:`string`,required:true,id:`param-data-1`,children:_jsx(_components.p,{children:`Encrypted reasoning data.`})}),_jsx(ParamField,{body:`id`,type:`string | null`,id:`param-id-2`,children:_jsx(_components.p,{children:`Reasoning detail ID.`})}),_jsx(ParamField,{body:`format`,type:`string | null`,id:`param-format-2`,children:_jsx(_components.p,{children:`Format identifier.`})})]}),_jsxs(Tab,{title:`text`,id:`text-2`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-9`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.text`}),`.`]})}),_jsx(ParamField,{body:`text`,type:`string | null`,id:`param-text-1`,children:_jsx(_components.p,{children:`The reasoning text content.`})}),_jsx(ParamField,{body:`signature`,type:`string | null`,id:`param-signature`,children:_jsx(_components.p,{children:`Signature for verification.`})}),_jsx(ParamField,{body:`id`,type:`string | null`,id:`param-id-3`,children:_jsx(_components.p,{children:`Reasoning detail ID.`})}),_jsx(ParamField,{body:`format`,type:`string | null`,id:`param-format-3`,children:_jsx(_components.p,{children:`Format identifier.`})})]})]})})]}),_jsx(ParamField,{body:`images`,type:`object[]`,id:`param-images`,children:_jsxs(_components.p,{children:[`Generated images from image generation models. Each item has `,_jsx(_components.code,{children:`image_url.url`}),`.`]})}),_jsxs(ParamField,{body:`audio`,type:`object`,id:`param-audio`,children:[_jsx(_components.p,{children:`Audio output data.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`id`,type:`string`,id:`param-id-4`,children:_jsx(_components.p,{children:`Audio output identifier.`})}),_jsx(ParamField,{body:`data`,type:`string`,id:`param-data-2`,children:_jsx(_components.p,{children:`Base64 encoded audio data.`})}),_jsx(ParamField,{body:`transcript`,type:`string`,id:`param-transcript`,children:_jsx(_components.p,{children:`Audio transcript.`})}),_jsx(ParamField,{body:`expires_at`,type:`number`,id:`param-expires-at`,children:_jsx(_components.p,{children:`Audio expiration timestamp.`})})]})]})]}),_jsxs(Tab,{title:`ToolResponseMessage`,id:`toolresponsemessage`,children:[_jsx(ParamField,{body:`role`,type:`string`,required:true,id:`param-role-4`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`tool`}),`.`]})}),_jsx(ParamField,{body:`content`,type:`string | object[]`,required:true,id:`param-content-4`,children:_jsx(_components.p,{children:`Tool response content. Can be a string or array of content parts (text, image, audio, video, file).`})}),_jsx(ParamField,{body:`tool_call_id`,type:`string`,required:true,id:`param-tool-call-id`,children:_jsx(_components.p,{children:`ID of the assistant message tool call this message responds to.`})})]})]})})]}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,required:true,id:`param-model`,children:_jsxs(_components.p,{children:[`The model to use for the completion. Browse available models at `,_jsx(_components.a,{href:`https://sunra.ai/models`,children:`sunra.ai/models`}),`.`]})}),`\n`,_jsx(ParamField,{body:`provider`,type:`object`,id:`param-provider`,children:_jsxs(_components.p,{children:[`Optional provider routing preferences. Omit for automatic routing. See `,_jsx(_components.a,{href:`/llm/provider-routing`,children:`Provider routing`}),` for supported fields and provider discovery.`]})}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,default:false,id:`param-stream`,children:_jsxs(_components.p,{children:[`If set to `,_jsx(_components.code,{children:`true`}),`, partial message deltas will be sent as server-sent events (SSE). Streams are subject to an idle timeout and a lifetime ceiling — see `,_jsx(_components.a,{href:`/llm/limits#stream-lifetime`,children:`Output limits and stream lifetime`}),`. A non-streaming request is terminated at the edge if the response takes too long to arrive, so any request that may generate for more than ~90 seconds must set `,_jsx(_components.code,{children:`stream: true`}),` — see `,_jsx(_components.a,{href:`/llm/limits#non-streaming-requests-the-edge-timeout`,children:`the edge timeout`}),`.`]})}),`\n`,_jsx(ParamField,{body:`max_completion_tokens`,type:`number | null`,id:`param-max-completion-tokens`,children:_jsxs(_components.p,{children:[`Maximum tokens in completion. Replaces `,_jsx(_components.code,{children:`max_tokens`}),` as the preferred parameter. On providers that do not honor this field the gateway translates it into `,_jsx(_components.code,{children:`max_tokens`}),`; when both are set, the smaller one applies. See `,_jsx(_components.a,{href:`/llm/limits`,children:`Output limits`}),`.`]})}),`\n`,_jsx(ParamField,{body:`max_tokens`,type:`number | null`,id:`param-max-tokens`,children:_jsxs(_components.p,{children:[`Maximum tokens in completion. Deprecated — use `,_jsx(_components.code,{children:`max_completion_tokens`}),` instead. Note: some providers enforce a minimum of 16. A value above the model’s own output ceiling is rejected with `,_jsx(_components.code,{children:`400`}),` rather than reduced.`]})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number | null`,default:1,id:`param-temperature`,children:_jsxs(_components.p,{children:[`Sampling temperature between 0 and 2. Higher values like 0.8 make output more random, lower values like 0.2 make it more focused and deterministic. For OpenAI reasoning models (`,_jsx(_components.code,{children:`gpt-5.x`}),`, `,_jsx(_components.code,{children:`gpt-6-*`}),`) with reasoning enabled (`,_jsx(_components.code,{children:`reasoning_effort`}),` other than `,_jsx(_components.code,{children:`none`}),`), `,_jsx(_components.code,{children:`temperature`}),` and `,_jsx(_components.code,{children:`top_p`}),` are not supported upstream; the gateway drops them silently instead of returning `,_jsx(_components.code,{children:`400`}),`, so the request still succeeds. Set `,_jsx(_components.code,{children:`reasoning_effort: \"none\"`}),` if you need sampling control.`]})}),`\n`,_jsx(ParamField,{body:`top_p`,type:`number | null`,default:1,id:`param-top-p`,children:_jsx(_components.p,{children:`Nucleus sampling parameter (0-1). An alternative to temperature sampling where the model considers the tokens with top_p probability mass.`})}),`\n`,_jsx(ParamField,{body:`frequency_penalty`,type:`number | null`,default:0,id:`param-frequency-penalty`,children:_jsx(_components.p,{children:`Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim.`})}),`\n`,_jsx(ParamField,{body:`presence_penalty`,type:`number | null`,default:0,id:`param-presence-penalty`,children:_jsx(_components.p,{children:`Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics.`})}),`\n`,_jsx(ParamField,{body:`stop`,type:`string | string[]`,id:`param-stop`,children:_jsx(_components.p,{children:`Up to 4 sequences where the API will stop generating further tokens.`})}),`\n`,_jsx(ParamField,{body:`n`,type:`integer`,default:1,id:`param-n`,children:_jsx(_components.p,{children:`How many chat completion choices to generate for each input message.`})}),`\n`,_jsx(ParamField,{body:`logprobs`,type:`boolean | null`,default:false,id:`param-logprobs`,children:_jsx(_components.p,{children:`Whether to return log probabilities of the output tokens.`})}),`\n`,_jsx(ParamField,{body:`top_logprobs`,type:`number | null`,id:`param-top-logprobs`,children:_jsxs(_components.p,{children:[`An integer between 0 and 20 specifying the number of most likely tokens to return at each token position. `,_jsx(_components.code,{children:`logprobs`}),` must be set to `,_jsx(_components.code,{children:`true`}),` if this parameter is used.`]})}),`\n`,_jsx(ParamField,{body:`logit_bias`,type:`object | null`,id:`param-logit-bias`,children:_jsx(_components.p,{children:`Token logit bias adjustments. Modify the likelihood of specified tokens appearing in the completion. Maps token IDs to bias values from -100 to 100.`})}),`\n`,_jsxs(ParamField,{body:`reasoning`,type:`object`,id:`param-reasoning-1`,children:[_jsx(_components.p,{children:`Configuration options for reasoning models.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`effort`,type:`string | null`,id:`param-effort`,children:_jsxs(_components.p,{children:[`Constrains effort on reasoning. Supported values: `,_jsx(_components.code,{children:`xhigh`}),`, `,_jsx(_components.code,{children:`high`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`minimal`}),`, `,_jsx(_components.code,{children:`none`}),`.`]})}),_jsx(ParamField,{body:`summary`,type:`string`,id:`param-summary-1`,children:_jsxs(_components.p,{children:[`Controls reasoning summary verbosity. Supported values: `,_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`concise`}),`, `,_jsx(_components.code,{children:`detailed`}),`.`]})})]})]}),`\n`,_jsx(ParamField,{body:`thinking`,type:`object`,id:`param-thinking`,children:_jsxs(_components.p,{children:[`Cross-vendor switch for extended thinking. For OpenAI-family reasoning models (`,_jsx(_components.code,{children:`gpt-5.x`}),`, `,_jsx(_components.code,{children:`gpt-6-*`}),`) the gateway maps it to `,_jsx(_components.code,{children:`reasoning_effort`}),`: `,_jsx(_components.code,{children:`{\"type\": \"disabled\"}`}),` becomes `,_jsx(_components.code,{children:`reasoning_effort: \"none\"`}),`, `,_jsx(_components.code,{children:`{\"type\": \"enabled\"}`}),` leaves the model’s default effort, and an explicit `,_jsx(_components.code,{children:`reasoning_effort`}),` always wins.`]})}),`\n`,_jsxs(ParamField,{body:`response_format`,type:`object`,id:`param-response-format`,children:[_jsx(_components.p,{children:`An object specifying the format that the model must output.`}),_jsx(Expandable,{title:`format types`,children:_jsxs(Tabs,{children:[_jsx(Tab,{title:`text`,id:`text-3`,children:_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-10`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`text`}),`.`]})})}),_jsx(Tab,{title:`json_object`,id:`json_object`,children:_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-11`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`json_object`}),`.`]})})}),_jsxs(Tab,{title:`json_schema`,id:`json_schema`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-12`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`json_schema`}),`.`]})}),_jsxs(ParamField,{body:`json_schema`,type:`object`,required:true,id:`param-json-schema`,children:[_jsx(_components.p,{children:`JSON Schema configuration.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-5`,children:_jsx(_components.p,{children:`Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars).`})}),_jsx(ParamField,{body:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`Schema description for the model.`})}),_jsx(ParamField,{body:`schema`,type:`object`,id:`param-schema`,children:_jsx(_components.p,{children:`JSON Schema object.`})}),_jsx(ParamField,{body:`strict`,type:`boolean | null`,id:`param-strict`,children:_jsx(_components.p,{children:`Enable strict schema adherence.`})})]})]})]}),_jsxs(Tab,{title:`grammar`,id:`grammar`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-13`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`grammar`}),`.`]})}),_jsx(ParamField,{body:`grammar`,type:`string`,required:true,id:`param-grammar`,children:_jsx(_components.p,{children:`Custom grammar for text generation.`})})]})]})})]}),`\n`,_jsx(ParamField,{body:`seed`,type:`integer | null`,id:`param-seed`,children:_jsx(_components.p,{children:`If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.`})}),`\n`,_jsxs(ParamField,{body:`tools`,type:`object[]`,id:`param-tools`,children:[_jsx(_components.p,{children:`A list of tools the model may call.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-14`,children:_jsxs(_components.p,{children:[`The type of the tool. Value: `,_jsx(_components.code,{children:`function`}),`.`]})}),_jsxs(ParamField,{body:`function`,type:`object`,required:true,id:`param-function-1`,children:[_jsx(_components.p,{children:`The function definition.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-6`,children:_jsx(_components.p,{children:`Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars).`})}),_jsx(ParamField,{body:`description`,type:`string`,id:`param-description-1`,children:_jsx(_components.p,{children:`A description of what the function does.`})}),_jsx(ParamField,{body:`parameters`,type:`object`,id:`param-parameters`,children:_jsx(_components.p,{children:`The parameters the function accepts, described as a JSON Schema object.`})}),_jsx(ParamField,{body:`strict`,type:`boolean | null`,id:`param-strict-1`,children:_jsx(_components.p,{children:`Whether to enable strict schema adherence.`})})]})]}),_jsxs(ParamField,{body:`cache_control`,type:`object`,id:`param-cache-control-1`,children:[_jsx(_components.p,{children:`Cache control for this tool definition.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-15`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`ephemeral`}),`.`]})}),_jsx(ParamField,{body:`ttl`,type:`string`,id:`param-ttl-1`,children:_jsxs(_components.p,{children:[`Cache TTL. Supported values: `,_jsx(_components.code,{children:`5m`}),`, `,_jsx(_components.code,{children:`1h`}),`.`]})})]})]})]})]}),`\n`,_jsxs(ParamField,{body:`tool_choice`,type:`string | object`,id:`param-tool-choice`,children:[_jsxs(_components.p,{children:[`Controls which (if any) tool is called by the model. `,_jsx(_components.code,{children:`none`}),` means no tool calls. `,_jsx(_components.code,{children:`auto`}),` means the model decides. `,_jsx(_components.code,{children:`required`}),` means the model must call a tool. Can also specify a particular function.`]}),_jsxs(Expandable,{title:`object variant`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-16`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`function`}),`.`]})}),_jsx(ParamField,{body:`function`,type:`object`,required:true,id:`param-function-2`,children:_jsx(Expandable,{title:`properties`,children:_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name-7`,children:_jsx(_components.p,{children:`The name of the function to call.`})})})})]})]}),`\n`,_jsx(ParamField,{body:`parallel_tool_calls`,type:`boolean | null`,default:true,id:`param-parallel-tool-calls`,children:_jsx(_components.p,{children:`Whether to enable parallel function calling during tool use.`})}),`\n`,_jsx(ParamField,{body:`modalities`,type:`string[]`,id:`param-modalities`,children:_jsxs(_components.p,{children:[`Output modalities for the response. Supported values: `,_jsx(_components.code,{children:`text`}),`, `,_jsx(_components.code,{children:`image`}),`, `,_jsx(_components.code,{children:`audio`}),`.`]})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsx(_components.p,{children:`Key-value pairs for additional object information. Maximum 16 pairs, 64 character keys, 512 character values.`})}),`\n`,_jsxs(ParamField,{body:`cache_control`,type:`object`,id:`param-cache-control-2`,children:[_jsx(_components.p,{children:`Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ParamField,{body:`type`,type:`string`,required:true,id:`param-type-17`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`ephemeral`}),`.`]})}),_jsx(ParamField,{body:`ttl`,type:`string`,id:`param-ttl-2`,children:_jsxs(_components.p,{children:[`Cache TTL. Supported values: `,_jsx(_components.code,{children:`5m`}),`, `,_jsx(_components.code,{children:`1h`}),`.`]})})]})]}),`\n`,_jsx(ParamField,{body:`user`,type:`string`,id:`param-user`,children:_jsx(_components.p,{children:`A unique identifier representing your end-user, which can help monitor and detect abuse.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(_components.p,{children:`Successful chat completion response.`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-5`,children:_jsxs(_components.p,{children:[`A unique identifier for the chat completion. Currently the upstream model provider’s own id, forwarded as-is — its format varies by provider. This is switching to a Sunra-issued value (breaking change, date to be announced): see `,_jsx(_components.a,{href:`/llm/response-tracking#the-id-field-is-switching-to-a-sunra-issued-value`,children:`Response identifiers and tracking`}),`. The same id is always available via the `,_jsxs(_components.a,{href:`/llm/response-tracking#the-x-sunra-prediction-id-header`,children:[_jsx(_components.code,{children:`x-sunra-prediction-id`}),` response header`]}),`, unaffected by that change.`]})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`The object type. Always `,_jsx(_components.code,{children:`chat.completion`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`created`,type:`number`,id:`param-created`,children:_jsx(_components.p,{children:`The Unix timestamp (in seconds) of when the chat completion was created.`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model used for the chat completion.`})}),`\n`,_jsxs(ResponseField,{name:`choices`,type:`object[]`,id:`param-choices`,children:[_jsxs(_components.p,{children:[`A list of chat completion choices. Can be more than one if `,_jsx(_components.code,{children:`n`}),` is greater than 1.`]}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`index`,type:`number`,id:`param-index`,children:_jsx(_components.p,{children:`The index of the choice in the list of choices.`})}),_jsx(ResponseField,{name:`finish_reason`,type:`string`,id:`param-finish-reason`,children:_jsxs(_components.p,{children:[`The reason the model stopped generating tokens. Possible values: `,_jsx(_components.code,{children:`stop`}),`, `,_jsx(_components.code,{children:`length`}),`, `,_jsx(_components.code,{children:`tool_calls`}),`, `,_jsx(_components.code,{children:`content_filter`}),`, `,_jsx(_components.code,{children:`error`}),`.`]})}),_jsxs(ResponseField,{name:`message`,type:`object`,id:`param-message`,children:[_jsx(_components.p,{children:`A chat completion message generated by the model.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`role`,type:`string`,id:`param-role-5`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`assistant`}),`.`]})}),_jsx(ResponseField,{name:`content`,type:`string | null`,id:`param-content-5`,children:_jsx(_components.p,{children:`The text contents of the message. Null when tool_calls are present.`})}),_jsxs(ResponseField,{name:`tool_calls`,type:`object[]`,id:`param-tool-calls-1`,children:[_jsx(_components.p,{children:`The tool calls generated by the model.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-6`,children:_jsx(_components.p,{children:`The ID of the tool call.`})}),_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-18`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`function`}),`.`]})}),_jsxs(ResponseField,{name:`function`,type:`object`,id:`param-function-3`,children:[_jsx(_components.p,{children:`The function that the model called.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name-8`,children:_jsx(_components.p,{children:`The name of the function to call.`})}),_jsx(ResponseField,{name:`arguments`,type:`string`,id:`param-arguments-1`,children:_jsx(_components.p,{children:`The arguments in JSON string format.`})})]})]})]})]}),_jsx(ResponseField,{name:`refusal`,type:`string | null`,id:`param-refusal-1`,children:_jsx(_components.p,{children:`Refusal message if the content was refused.`})}),_jsx(ResponseField,{name:`reasoning`,type:`string | null`,id:`param-reasoning-2`,children:_jsx(_components.p,{children:`Reasoning output text.`})}),_jsxs(ResponseField,{name:`reasoning_details`,type:`object[]`,id:`param-reasoning-details-1`,children:[_jsx(_components.p,{children:`Detailed reasoning information for extended thinking models.`}),_jsx(Expandable,{title:`reasoning detail types`,children:_jsxs(Tabs,{children:[_jsxs(Tab,{title:`summary`,id:`summary-2`,children:[_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-19`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.summary`}),`.`]})}),_jsx(ResponseField,{name:`summary`,type:`string`,id:`param-summary-2`,children:_jsx(_components.p,{children:`The reasoning summary text.`})}),_jsx(ResponseField,{name:`id`,type:`string | null`,id:`param-id-7`,children:_jsx(_components.p,{children:`Detail ID.`})}),_jsx(ResponseField,{name:`format`,type:`string | null`,id:`param-format-4`,children:_jsx(_components.p,{children:`Format identifier.`})})]}),_jsxs(Tab,{title:`encrypted`,id:`encrypted-2`,children:[_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-20`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.encrypted`}),`.`]})}),_jsx(ResponseField,{name:`data`,type:`string`,id:`param-data-3`,children:_jsx(_components.p,{children:`Encrypted reasoning data.`})}),_jsx(ResponseField,{name:`id`,type:`string | null`,id:`param-id-8`,children:_jsx(_components.p,{children:`Detail ID.`})}),_jsx(ResponseField,{name:`format`,type:`string | null`,id:`param-format-5`,children:_jsx(_components.p,{children:`Format identifier.`})})]}),_jsxs(Tab,{title:`text`,id:`text-4`,children:[_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type-21`,children:_jsxs(_components.p,{children:[`Value: `,_jsx(_components.code,{children:`reasoning.text`}),`.`]})}),_jsx(ResponseField,{name:`text`,type:`string | null`,id:`param-text-2`,children:_jsx(_components.p,{children:`The reasoning text.`})}),_jsx(ResponseField,{name:`signature`,type:`string | null`,id:`param-signature-1`,children:_jsx(_components.p,{children:`Verification signature.`})}),_jsx(ResponseField,{name:`id`,type:`string | null`,id:`param-id-9`,children:_jsx(_components.p,{children:`Detail ID.`})}),_jsx(ResponseField,{name:`format`,type:`string | null`,id:`param-format-6`,children:_jsx(_components.p,{children:`Format identifier.`})})]})]})})]}),_jsx(ResponseField,{name:`images`,type:`object[]`,id:`param-images-1`,children:_jsxs(_components.p,{children:[`Generated images. Each item contains `,_jsx(_components.code,{children:`image_url.url`}),`.`]})}),_jsxs(ResponseField,{name:`audio`,type:`object`,id:`param-audio-1`,children:[_jsx(_components.p,{children:`Audio output data.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-10`,children:_jsx(_components.p,{children:`Audio output identifier.`})}),_jsx(ResponseField,{name:`data`,type:`string`,id:`param-data-4`,children:_jsx(_components.p,{children:`Base64 encoded audio data.`})}),_jsx(ResponseField,{name:`transcript`,type:`string`,id:`param-transcript-1`,children:_jsx(_components.p,{children:`Audio transcript.`})}),_jsx(ResponseField,{name:`expires_at`,type:`number`,id:`param-expires-at-1`,children:_jsx(_components.p,{children:`Audio expiration timestamp.`})})]})]})]})]}),_jsxs(ResponseField,{name:`logprobs`,type:`object | null`,id:`param-logprobs-1`,children:[_jsx(_components.p,{children:`Log probability information for the choice.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`content`,type:`object[] | null`,id:`param-content-6`,children:_jsxs(_components.p,{children:[`Log probabilities for content tokens. Each item contains `,_jsx(_components.code,{children:`token`}),`, `,_jsx(_components.code,{children:`logprob`}),`, `,_jsx(_components.code,{children:`bytes`}),`, and `,_jsx(_components.code,{children:`top_logprobs`}),`.`]})}),_jsx(ResponseField,{name:`refusal`,type:`object[] | null`,id:`param-refusal-2`,children:_jsx(_components.p,{children:`Log probabilities for refusal tokens.`})})]})]})]})]}),`\n`,_jsxs(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:[_jsx(_components.p,{children:`Usage statistics for the completion request.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`prompt_tokens`,type:`number`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`Number of tokens in the prompt.`})}),_jsx(ResponseField,{name:`completion_tokens`,type:`number`,id:`param-completion-tokens`,children:_jsx(_components.p,{children:`Number of tokens in the generated completion.`})}),_jsx(ResponseField,{name:`total_tokens`,type:`number`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`Total number of tokens used in the request (prompt + completion).`})}),_jsxs(ResponseField,{name:`prompt_tokens_details`,type:`object | null`,id:`param-prompt-tokens-details`,children:[_jsx(_components.p,{children:`Detailed prompt token usage.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`cached_tokens`,type:`number`,id:`param-cached-tokens`,children:_jsx(_components.p,{children:`Number of cached prompt tokens.`})}),_jsx(ResponseField,{name:`cache_write_tokens`,type:`number`,id:`param-cache-write-tokens`,children:_jsx(_components.p,{children:`Tokens written to cache. Only returned for models with explicit caching.`})}),_jsx(ResponseField,{name:`audio_tokens`,type:`number`,id:`param-audio-tokens`,children:_jsx(_components.p,{children:`Audio input tokens.`})}),_jsx(ResponseField,{name:`video_tokens`,type:`number`,id:`param-video-tokens`,children:_jsx(_components.p,{children:`Video input tokens.`})})]})]}),_jsxs(ResponseField,{name:`completion_tokens_details`,type:`object | null`,id:`param-completion-tokens-details`,children:[_jsx(_components.p,{children:`Detailed completion token usage.`}),_jsxs(Expandable,{title:`properties`,children:[_jsx(ResponseField,{name:`reasoning_tokens`,type:`number | null`,id:`param-reasoning-tokens`,children:_jsx(_components.p,{children:`Tokens used for reasoning.`})}),_jsx(ResponseField,{name:`audio_tokens`,type:`number | null`,id:`param-audio-tokens-1`,children:_jsx(_components.p,{children:`Tokens used for audio output.`})}),_jsx(ResponseField,{name:`accepted_prediction_tokens`,type:`number | null`,id:`param-accepted-prediction-tokens`,children:_jsx(_components.p,{children:`Accepted prediction tokens.`})}),_jsx(ResponseField,{name:`rejected_prediction_tokens`,type:`number | null`,id:`param-rejected-prediction-tokens`,children:_jsx(_components.p,{children:`Rejected prediction tokens.`})})]})]})]})]}),`\n`,_jsx(ResponseField,{name:`system_fingerprint`,type:`string | null`,id:`param-system-fingerprint`,children:_jsxs(_components.p,{children:[`This fingerprint represents the backend configuration that the model runs with. Can be used with the `,_jsx(_components.code,{children:`seed`}),` parameter to understand when backend changes have been made.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","description":null,"href":"/llm/chat"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[205,329,"pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Tab,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandab"],[482,494,"questExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)"],[39914,40342,",`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`16`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api-llm.sunra.ai/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"google/gemini-2.5-flash\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"system\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"You are a helpful assistant.\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"What is the capital of France?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`17`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api-llm.sunra.ai/v1/chat/completions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"google/gemini-2.5-flash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of France?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api-llm.sunra.ai/v1/chat/completions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Bearer \u003cSUNRA_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"google/gemini-2.5-flash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a helpful assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What is the capital of France?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200`,numberOfLines:`26`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`26`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1677652288`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"google/gemini-2.5-flash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The capital of France is Paris.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"refusal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"logprobs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"system_fingerprint\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fp_44709d6fcb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`25`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`33`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens_details\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens_details\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}"]]},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Request","slug":"request","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://api-llm.sunra.ai/v1/chat/completions\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization: Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\": \"google/gemini-2.5-flash\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"messages\": [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"role\": \"system\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content\": \"You are a helpful assistant.\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"role\": \"user\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content\": \"What is the capital of France?\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"17\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api-llm.sunra.ai/v1/chat/completions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"google/gemini-2.5-flash\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"messages\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"system\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"You are a helpful assistant.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"What is the capital of France?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(response.json())\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"16\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api-llm.sunra.ai/v1/chat/completions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"POST\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Bearer \u0026#x3C;SUNRA_KEY>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> model:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"google/gemini-2.5-flash\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> messages:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">role:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"system\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">content:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"You are a helpful assistant.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">role:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"user\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">content:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"What is the capital of France?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> })\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"26\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chatcmpl-abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"object\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"chat.completion\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1677652288\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"google/gemini-2.5-flash\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"choices\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"index\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">0\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"role\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"assistant\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"content\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"The capital of France is Paris.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"refusal\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"finish_reason\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"stop\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"logprobs\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"system_fingerprint\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"fp_44709d6fcb\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">25\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">8\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">33\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens_details\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens_details\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Create a chat completion","path":"/v1/chat/completions","servers":[{"url":"https://api-llm.sunra.ai"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{"Authorization":{"schema":[{"type":"string","description":"Bearer token. Use your API key as the bearer token in the Authorization header. Format: `Bearer \u003cSUNRA_KEY>`","required":true}]}},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"messages":[{"type":"array","items":[{"type":"object","properties":{"role":[{"type":"string","description":"Value: `tool` .","required":true}],"content":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Tool response content. Can be a string or array of content parts (text, image, audio, video, file).","required":true}],"name":[{"type":"string","description":"Optional name for the assistant."}],"tool_calls":[{"type":"array","items":[{"type":"object","properties":{"id":[{"type":"string","description":"Tool call identifier.","required":true}],"type":[{"type":"string","description":"Value: `function` .","required":true}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"Function name.","required":true}],"arguments":[{"type":"string","description":"Function arguments as JSON string.","required":true}]},"description":"The function called.","required":true}]}}],"description":"Tool calls made by the assistant."}],"refusal":[{"type":"object","properties":{},"description":"Refusal message if content was refused."}],"reasoning":[{"type":"object","properties":{},"description":"Reasoning output text."}],"reasoning_details":[{"type":"array","items":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `reasoning.text` .","required":true}],"summary":[{"type":"string","description":"The reasoning summary text.","required":true}],"id":[{"type":"object","properties":{},"description":"Reasoning detail ID."}],"format":[{"type":"object","properties":{},"description":"Format identifier."}],"data":[{"type":"string","description":"Encrypted reasoning data.","required":true}],"text":[{"type":"object","properties":{},"description":"The reasoning text content."}],"signature":[{"type":"object","properties":{},"description":"Signature for verification."}]}}],"description":"Detailed reasoning information for extended thinking models."}],"images":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Generated images from image generation models. Each item has `image_url.url` ."}],"audio":[{"type":"object","properties":{"id":[{"type":"string","description":"Audio output identifier."}],"data":[{"type":"string","description":"Base64 encoded audio data."}],"transcript":[{"type":"string","description":"Audio transcript."}],"expires_at":[{"type":"number","description":"Audio expiration timestamp."}]},"description":"Audio output data."}],"tool_call_id":[{"type":"string","description":"ID of the assistant message tool call this message responds to.","required":true}]}}],"description":"List of messages for the conversation. Each message has a `role` and `content` .","required":true}],"model":[{"type":"string","description":"The model to use for the completion. Browse available models at sunra.ai/models .","required":true}],"provider":[{"type":"object","properties":{},"description":"Optional provider routing preferences. Omit for automatic routing. See Provider routing for supported fields and provider discovery."}],"stream":[{"type":"boolean","description":"If set to `true` , partial message deltas will be sent as server-sent events (SSE). Streams are subject to an idle timeout and a lifetime ceiling — see Output limits and stream lifetime . A non-streaming request is terminated at the edge if the response takes too long to arrive, so any request that may generate for more than ~90 seconds must set `stream: true` — see the edge timeout ."}],"max_completion_tokens":[{"type":"object","properties":{},"description":"Maximum tokens in completion. Replaces `max_tokens` as the preferred parameter. On providers that do not honor this field the gateway translates it into `max_tokens` ; when both are set, the smaller one applies. See Output limits ."}],"max_tokens":[{"type":"object","properties":{},"description":"Maximum tokens in completion. Deprecated — use `max_completion_tokens` instead. Note: some providers enforce a minimum of 16. A value above the model’s own output ceiling is rejected with `400` rather than reduced."}],"temperature":[{"type":"object","properties":{},"description":"Sampling temperature between 0 and 2. Higher values like 0.8 make output more random, lower values like 0.2 make it more focused and deterministic. For OpenAI reasoning models ( `gpt-5.x` , `gpt-6-*` ) with reasoning enabled ( `reasoning_effort` other than `none` ), `temperature` and `top_p` are not supported upstream; the gateway drops them silently instead of returning `400` , so the request still succeeds. Set `reasoning_effort: \"none\"` if you need sampling control."}],"top_p":[{"type":"object","properties":{},"description":"Nucleus sampling parameter (0-1). An alternative to temperature sampling where the model considers the tokens with top_p probability mass."}],"frequency_penalty":[{"type":"object","properties":{},"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim."}],"presence_penalty":[{"type":"object","properties":{},"description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics."}],"stop":[{"type":"array","items":[{"type":"string"}],"description":"Up to 4 sequences where the API will stop generating further tokens."}],"n":[{"type":"integer","description":"How many chat completion choices to generate for each input message."}],"logprobs":[{"type":"object","properties":{},"description":"Whether to return log probabilities of the output tokens."}],"top_logprobs":[{"type":"object","properties":{},"description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position. `logprobs` must be set to `true` if this parameter is used."}],"logit_bias":[{"type":"object","properties":{},"description":"Token logit bias adjustments. Modify the likelihood of specified tokens appearing in the completion. Maps token IDs to bias values from -100 to 100."}],"reasoning":[{"type":"object","properties":{"effort":[{"type":"object","properties":{},"description":"Constrains effort on reasoning. Supported values: `xhigh` , `high` , `medium` , `low` , `minimal` , `none` ."}],"summary":[{"type":"string","description":"Controls reasoning summary verbosity. Supported values: `auto` , `concise` , `detailed` ."}]},"description":"Configuration options for reasoning models."}],"thinking":[{"type":"object","properties":{},"description":"Cross-vendor switch for extended thinking. For OpenAI-family reasoning models ( `gpt-5.x` , `gpt-6-*` ) the gateway maps it to `reasoning_effort` : `{\"type\": \"disabled\"}` becomes `reasoning_effort: \"none\"` , `{\"type\": \"enabled\"}` leaves the model’s default effort, and an explicit `reasoning_effort` always wins."}],"response_format":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `grammar` .","required":true}],"json_schema":[{"type":"object","properties":{"name":[{"type":"string","description":"Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars).","required":true}],"description":[{"type":"string","description":"Schema description for the model."}],"schema":[{"type":"object","properties":{},"description":"JSON Schema object."}],"strict":[{"type":"object","properties":{},"description":"Enable strict schema adherence."}]},"description":"JSON Schema configuration.","required":true}],"grammar":[{"type":"string","description":"Custom grammar for text generation.","required":true}]},"description":"An object specifying the format that the model must output."}],"seed":[{"type":"object","properties":{},"description":"If specified, the system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result."}],"tools":[{"type":"array","items":[{"type":"object","properties":{"type":[{"type":"string","description":"The type of the tool. Value: `function` .","required":true}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars).","required":true}],"description":[{"type":"string","description":"A description of what the function does."}],"parameters":[{"type":"object","properties":{},"description":"The parameters the function accepts, described as a JSON Schema object."}],"strict":[{"type":"object","properties":{},"description":"Whether to enable strict schema adherence."}]},"description":"The function definition.","required":true}],"cache_control":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `ephemeral` .","required":true}],"ttl":[{"type":"string","description":"Cache TTL. Supported values: `5m` , `1h` ."}]},"description":"Cache control for this tool definition."}]}}],"description":"A list of tools the model may call."}],"tool_choice":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `function` .","required":true}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"The name of the function to call.","required":true}]},"required":true}]},"description":"Controls which (if any) tool is called by the model. `none` means no tool calls. `auto` means the model decides. `required` means the model must call a tool. Can also specify a particular function."}],"parallel_tool_calls":[{"type":"object","properties":{},"description":"Whether to enable parallel function calling during tool use."}],"modalities":[{"type":"array","items":[{"type":"string"}],"description":"Output modalities for the response. Supported values: `text` , `image` , `audio` ."}],"metadata":[{"type":"object","properties":{},"description":"Key-value pairs for additional object information. Maximum 16 pairs, 64 character keys, 512 character values."}],"cache_control":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `ephemeral` .","required":true}],"ttl":[{"type":"string","description":"Cache TTL. Supported values: `5m` , `1h` ."}]},"description":"Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models."}],"user":[{"type":"string","description":"A unique identifier representing your end-user, which can help monitor and detect abuse."}]}}],"examples":{"example":{"value":{"messages":[{"role":"\u003cstring>","content":[{}],"name":"\u003cstring>","tool_calls":[{"id":"\u003cstring>","type":"\u003cstring>","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}],"refusal":{},"reasoning":{},"reasoning_details":[{"type":"\u003cstring>","summary":"\u003cstring>","id":{},"format":{},"data":"\u003cstring>","text":{},"signature":{}}],"images":[{}],"audio":{"id":"\u003cstring>","data":"\u003cstring>","transcript":"\u003cstring>","expires_at":123},"tool_call_id":"\u003cstring>"}],"model":"\u003cstring>","provider":{},"stream":true,"max_completion_tokens":{},"max_tokens":{},"temperature":{},"top_p":{},"frequency_penalty":{},"presence_penalty":{},"stop":["\u003cstring>"],"n":123,"logprobs":{},"top_logprobs":{},"logit_bias":{},"reasoning":{"effort":{},"summary":"\u003cstring>"},"thinking":{},"response_format":{"type":"\u003cstring>","json_schema":{"name":"\u003cstring>","description":"\u003cstring>","schema":{},"strict":{}},"grammar":"\u003cstring>"},"seed":{},"tools":[{"type":"\u003cstring>","function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{},"strict":{}},"cache_control":{"type":"\u003cstring>","ttl":"\u003cstring>"}}],"tool_choice":{"type":"\u003cstring>","function":{"name":"\u003cstring>"}},"parallel_tool_calls":{},"modalities":["\u003cstring>"],"metadata":{},"cache_control":{"type":"\u003cstring>","ttl":"\u003cstring>"},"user":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"A unique identifier for the chat completion. Currently the upstream model provider’s own id, forwarded as-is — its format varies by provider. This is switching to a Sunra-issued value (breaking change, date to be announced): see Response identifiers and tracking . The same id is always available via the `x-sunra-prediction-id` response header , unaffected by that change."}],"object":[{"type":"string","description":"The object type. Always `chat.completion` ."}],"created":[{"type":"number","description":"The Unix timestamp (in seconds) of when the chat completion was created."}],"model":[{"type":"string","description":"The model used for the chat completion."}],"choices":[{"type":"array","items":[{"type":"object","properties":{"index":[{"type":"number","description":"The index of the choice in the list of choices."}],"finish_reason":[{"type":"string","description":"The reason the model stopped generating tokens. Possible values: `stop` , `length` , `tool_calls` , `content_filter` , `error` ."}],"message":[{"type":"object","properties":{"role":[{"type":"string","description":"Always `assistant` ."}],"content":[{"type":"object","properties":{},"description":"The text contents of the message. Null when tool_calls are present."}],"tool_calls":[{"type":"array","items":[{"type":"object","properties":{"id":[{"type":"string","description":"The ID of the tool call."}],"type":[{"type":"string","description":"Value: `function` ."}],"function":[{"type":"object","properties":{"name":[{"type":"string","description":"The name of the function to call."}],"arguments":[{"type":"string","description":"The arguments in JSON string format."}]},"description":"The function that the model called."}]}}],"description":"The tool calls generated by the model."}],"refusal":[{"type":"object","properties":{},"description":"Refusal message if the content was refused."}],"reasoning":[{"type":"object","properties":{},"description":"Reasoning output text."}],"reasoning_details":[{"type":"array","items":[{"type":"object","properties":{"type":[{"type":"string","description":"Value: `reasoning.text` ."}],"summary":[{"type":"string","description":"The reasoning summary text."}],"id":[{"type":"object","properties":{},"description":"Detail ID."}],"format":[{"type":"object","properties":{},"description":"Format identifier."}],"data":[{"type":"string","description":"Encrypted reasoning data."}],"text":[{"type":"object","properties":{},"description":"The reasoning text."}],"signature":[{"type":"object","properties":{},"description":"Verification signature."}]}}],"description":"Detailed reasoning information for extended thinking models."}],"images":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Generated images. Each item contains `image_url.url` ."}],"audio":[{"type":"object","properties":{"id":[{"type":"string","description":"Audio output identifier."}],"data":[{"type":"string","description":"Base64 encoded audio data."}],"transcript":[{"type":"string","description":"Audio transcript."}],"expires_at":[{"type":"number","description":"Audio expiration timestamp."}]},"description":"Audio output data."}]},"description":"A chat completion message generated by the model."}],"logprobs":[{"type":"object","properties":{"content":[{"type":"object","properties":{},"description":"Log probabilities for content tokens. Each item contains `token` , `logprob` , `bytes` , and `top_logprobs` ."}],"refusal":[{"type":"object","properties":{},"description":"Log probabilities for refusal tokens."}]},"description":"Log probability information for the choice."}]}}],"description":"A list of chat completion choices. Can be more than one if `n` is greater than 1."}],"usage":[{"type":"object","properties":{"prompt_tokens":[{"type":"number","description":"Number of tokens in the prompt."}],"completion_tokens":[{"type":"number","description":"Number of tokens in the generated completion."}],"total_tokens":[{"type":"number","description":"Total number of tokens used in the request (prompt + completion)."}],"prompt_tokens_details":[{"type":"object","properties":{"cached_tokens":[{"type":"number","description":"Number of cached prompt tokens."}],"cache_write_tokens":[{"type":"number","description":"Tokens written to cache. Only returned for models with explicit caching."}],"audio_tokens":[{"type":"number","description":"Audio input tokens."}],"video_tokens":[{"type":"number","description":"Video input tokens."}]},"description":"Detailed prompt token usage."}],"completion_tokens_details":[{"type":"object","properties":{"reasoning_tokens":[{"type":"object","properties":{},"description":"Tokens used for reasoning."}],"audio_tokens":[{"type":"object","properties":{},"description":"Tokens used for audio output."}],"accepted_prediction_tokens":[{"type":"object","properties":{},"description":"Accepted prediction tokens."}],"rejected_prediction_tokens":[{"type":"object","properties":{},"description":"Rejected prediction tokens."}]},"description":"Detailed completion token usage."}]},"description":"Usage statistics for the completion request."}],"system_fingerprint":[{"type":"object","properties":{},"description":"This fingerprint represents the backend configuration that the model runs with. Can be used with the `seed` parameter to understand when backend changes have been made."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","object":"\u003cstring>","created":123,"model":"\u003cstring>","choices":[{"index":123,"finish_reason":"\u003cstring>","message":{"role":"\u003cstring>","content":{},"tool_calls":[{"id":"\u003cstring>","type":"\u003cstring>","function":{"name":"\u003cstring>","arguments":"\u003cstring>"}}],"refusal":{},"reasoning":{},"reasoning_details":[{"type":"\u003cstring>","summary":"\u003cstring>","id":{},"format":{},"data":"\u003cstring>","text":{},"signature":{}}],"images":[{}],"audio":{"id":"\u003cstring>","data":"\u003cstring>","transcript":"\u003cstring>","expires_at":123}},"logprobs":{"content":{},"refusal":{}}}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123,"prompt_tokens_details":{"cached_tokens":123,"cache_write_tokens":123,"audio_tokens":123,"video_tokens":123},"completion_tokens_details":{"reasoning_tokens":{},"audio_tokens":{},"accepted_prediction_tokens":{},"rejected_prediction_tokens":{}}},"system_fingerprint":{}}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"sunraai","siteName":"Sunra.ai","title":"Create a chat completion - Sunra.ai","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/llm/chat","matchLevel":0},"zh-Hans":{"href":"/zh-Hans/llm/chat","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/llm/chat","matchLevel":1},"fr":{"href":"/fr/llm/chat","matchLevel":1},"ja":{"href":"/ja/llm/chat","matchLevel":1},"es":{"href":"/es/llm/chat","matchLevel":1},"pt":{"href":"/pt/llm/chat","matchLevel":1},"hi":{"href":"/hi/llm/chat","matchLevel":1},"tr":{"href":"/tr/llm/chat","matchLevel":1},"de":{"href":"/de/llm/chat","matchLevel":1},"id":{"href":"/id/llm/chat","matchLevel":1},"it":{"href":"/it/llm/chat","matchLevel":1},"ko":{"href":"/ko/llm/chat","matchLevel":1},"ru":{"href":"/ru/llm/chat","matchLevel":1}}},"lastModified":"2026-09-19T11:27:31.026Z","originalFileLocation":"llm/chat.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a chat completion - Sunra.ai\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Sunra.ai\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sunra.ai/llm/chat\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sunraai.mintlify.app/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+a+chat+completion\u0026amp;theme=bd1a022ff2457f18109208ab\u0026amp;signature=83c1199f4df77e8931a3187c0967ee0b6fbe9aec822103bf1d36a23782043d7a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a chat completion - Sunra.ai\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sunraai.mintlify.app/_mintlify/api/og/v2?division=LLM\u0026amp;title=Create+a+chat+completion\u0026amp;theme=bd1a022ff2457f18109208ab\u0026amp;signature=83c1199f4df77e8931a3187c0967ee0b6fbe9aec822103bf1d36a23782043d7a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/sunraai/LRMCLsYjFvskNvgC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Sunra.ai\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff632f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sunra.ai/llm/chat\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/llm/chat.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.sunra.ai/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.sunra.ai/zh-Hans/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.sunra.ai/zh-Hant/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.sunra.ai/fr/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.sunra.ai/ja/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.sunra.ai/es/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.sunra.ai/pt/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"hi\" href=\"https://docs.sunra.ai/hi/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"tr\" href=\"https://docs.sunra.ai/tr/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.sunra.ai/de/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"id\" href=\"https://docs.sunra.ai/id/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://docs.sunra.ai/it/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.sunra.ai/ko/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.sunra.ai/ru/llm/chat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.sunra.ai/llm/chat\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sunra.ai/#organization\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sunraai/U2o8uzmv75no70tM/logo/light.svg?fit=max\u0026auto=format\u0026n=U2o8uzmv75no70tM\u0026q=85\u0026s=520c0afb29ad1fddc46fec66c975eb2a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sunra.ai#website\",\"name\":\"Sunra.ai\",\"url\":\"https://docs.sunra.ai\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sunra.ai/llm/chat#webpage\",\"url\":\"https://docs.sunra.ai/llm/chat\",\"name\":\"Create a chat completion\",\"dateModified\":\"2026-09-19T11:27:31.026Z\",\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sunra.ai/llm/chat#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sunra.ai/llm/chat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"LLM\",\"item\":\"https://docs.sunra.ai/llm/llm-quickstart\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a chat completion\",\"item\":\"https://docs.sunra.ai/llm/chat\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sunra.ai/llm/chat#apireference\",\"headline\":\"Create a chat completion\",\"name\":\"Create a chat completion\",\"url\":\"https://docs.sunra.ai/llm/chat\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sunra.ai/llm/chat#webpage\"},\"dateModified\":\"2026-09-19T11:27:31.026Z\",\"publisher\":{\"@id\":\"https://docs.sunra.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sunra.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Sunra.ai\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Sunra.ai","nav":{"global":{"anchors":[{"anchor":"X (Twitter)","icon":"x-twitter","href":"https://x.com/sunra_ai"},{"anchor":"Discord","icon":"discord","href":"https://discord.gg/897qCzvCcU"},{"anchor":"GitHub","icon":"github","href":"https://github.com/sunra-ai"}]},"languages":[{"language":"en","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":""}]},{"group":"Platform","pages":[{"title":"Authentication","href":"/platform/authentication"},{"title":"Budget keys","href":"/platform/budget-keys"},{"title":"Shared budget pools","href":"/platform/budget-pools"},{"title":"File Upload","href":"/platform/file-upload"},{"title":"Pricing","href":"/platform/pricing"},{"title":"Errors","href":"/platform/errors"}]},{"group":"Multimodal","pages":[{"title":"Quickstart","href":"/multimodal/quickstart"},{"title":"Text to Image","href":"/multimodal/text-to-image"},{"title":"Text to Video","href":"/multimodal/text-to-video"},{"title":"Image to Video","href":"/multimodal/image-to-video"},{"title":"Speech to Text","href":"/multimodal/speech-to-text"},{"title":"ElevenLabs Voices","href":"/multimodal/elevenlabs-voices"},{"title":"Canonical Model Endpoints","href":"/multimodal/canonical-model-endpoints"},{"title":"MCP Server","href":"/multimodal/mcp-server-setup"},{"title":"Queue","href":"/multimodal/queue"},{"title":"Server-Side Integration","href":"/multimodal/server-side-integration"}]},{"group":"LLM","pages":[{"title":"LLM Quickstart","href":"/llm/llm-quickstart"},{"title":"Provider routing","href":"/llm/provider-routing"},{"title":"Token usage","href":"/llm/token-usage"},{"title":"Output limits and stream lifetime","href":"/llm/limits"},{"title":"Response identifiers and tracking","description":null,"href":"/llm/response-tracking"},{"title":"Create a chat completion","api":"POST https://api-llm.sunra.ai/v1/chat/completions","href":"/llm/chat"},{"title":"Create a message","api":"POST https://api-llm.sunra.ai/v1/messages","description":null,"href":"/llm/messages"},{"title":"Create a response","api":"POST https://api-llm.sunra.ai/v1/responses","href":"/llm/responses"},{"title":"Create embeddings","api":"POST https://api-llm.sunra.ai/v1/embeddings","href":"/llm/embeddings"}]},{"group":"Client Libraries","pages":[{"title":"JavaScript / TypeScript","href":"/client-libraries/javascript"},{"title":"Python","href":"/client-libraries/python"},{"title":"Java","href":"/client-libraries/java"},{"title":"Request New Client","href":"/client-libraries/request-new-client"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/zh-Hans/llm/chat"}]},{"language":"zh-Hant","pages":[{"title":"zh-Hant","href":"/zh-Hant/llm/chat"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/llm/chat"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/llm/chat"}]},{"language":"es","pages":[{"title":"es","href":"/es/llm/chat"}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/llm/chat"}]},{"language":"hi","pages":[{"title":"hi","href":"/hi/llm/chat"}]},{"language":"tr","pages":[{"title":"tr","href":"/tr/llm/chat"}]},{"language":"de","pages":[{"title":"de","href":"/de/llm/chat"}]},{"language":"id","pages":[{"title":"id","href":"/id/llm/chat"}]},{"language":"it","pages":[{"title":"it","href":"/it/llm/chat"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/llm/chat"}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/llm/chat"}]}]},"basePath":"","title":"Create a chat completion - Sunra.ai","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["BannerMarkdown-DHaG7hr_.js","dist-DKZWslLH.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BIWXJmsZ.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js"]}