Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.
POST
https://api.naga.ac
/
v1
/
chat
/
completions
openai-python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NAGA_API_KEY"],
base_url="https://api.naga.ac/v1",
)
result = client.chat.completions.create(
model="anthropic/claude-haiku-5.5",
messages=[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Say hello in one word."
}
],
)
print(result)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NAGA_API_KEY,
baseURL: "https://api.naga.ac/v1",
});
const result = await client.chat.completions.create({
model: "anthropic/claude-haiku-5.5",
messages: [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Say hello in one word."
}
],
});
console.log(result);
curl https://api.naga.ac/v1/chat/completions \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-haiku-5.5",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Say hello in one word."
}
]
}'
The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension.
The order in which NagaAI tries the providers that serve a model. A NagaAI extension.
Available options:
reliability,
balanced,
latency,
throughput,
cache
Body
application/json
The OpenAI-compatible Chat Completions request. The gateway takes an unrecognized key and drops it.
How NagaAI picks the providers for this request. strategy reorders them and never removes one; max_price removes the ones above it and can fail the request. A NagaAI extension.
The most this request may pay per unit, keyed by a meter of the model's pricing in GET /v1/models: {"output_token": "0.000004"} caps output at 4 credits per million tokens. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose base price is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.
flex sends the request only to providers that sell at the model's base price in GET /v1/models, and fails it when none of them can serve it. Every other value, an unknown one included, and no value let NagaAI use any provider, at the price of the one that serves it.
Fallback models, tried in order when model cannot answer: none of its providers served it, or the request does not fit it. At most 3; the answer's model names the one that answered, and only that one is billed. A NagaAI extension in OpenRouter's shape.
Turns on the built-in web search for this request. A model none of whose providers can search right now answers without it, and the reply says so in x-naga-dropped-tools.
auto lets NagaAI drop whole turns from the middle of a conversation that does not fit the model's context window, keeping the system prompt, the first and the latest turn; disabled, the default, refuses it with context_length_exceeded. A NagaAI extension, the same key as in the Responses API.
Available options:
auto,
disabled
Response
The completion. application/json carries one chat.completion object when stream is false; text/event-stream carries one chat.completion.chunk per event, then the data: [DONE] sentinel, when it is true.
Option 1
Option 2
The completion. The gateway answers a request it does not forward with the second shape, which omits logprobs and refusal.
How many generated tokens were image output. A NagaAI extension.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NagaAI Documentation","colors":{"primary":"#5a5ae5","light":"#8893fa","dark":"#5351da"},"logo":{"light":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393","dark":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-dark.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=f4927df5611f5a22c6984a3e7b91b6a0"},"favicon":"https://mintcdn.com/nagaai-60f8697b/nbl1KDrtw3_cqedh/static/img/favicon.ico?fit=max\u0026auto=format\u0026n=nbl1KDrtw3_cqedh\u0026q=85\u0026s=a8361945277b5cce4de483745aa5c21c","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["python","javascript","curl","go"],"prefill":true},"url":"full"},"appearance":{"default":"system"},"background":{"color":{"light":"#ffffff","dark":"#09090b"}},"navbar":{"links":[{"href":"https://naga.ac/models","label":"Models"},{"href":"https://naga.ac/pricing","label":"Pricing"},{"href":"https://naga.ac/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://naga.ac/dashboard"}},"footer":{"socials":{"discord":"https://discord.naga.ac","github":"https://github.com/naga-ai-hub","x":"https://x.com/NagaAIProject","reddit":"https://www.reddit.com/r/NagaAI"},"links":[{"header":"Community","items":[{"label":"Status","href":"https://status.naga.ac"},{"label":"Announcements","href":"https://naga.ac/announcements"},{"label":"Support","href":"https://discord.naga.ac"}]},{"header":"Resources","items":[{"label":"Models","href":"https://naga.ac/models"},{"label":"Playground","href":"https://naga.ac/playground"},{"label":"Chat","href":"https://chat.naga.ac"}]},{"header":"Legal","items":[{"label":"Privacy","href":"https://naga.ac/legal/privacy"},{"label":"Terms","href":"https://naga.ac/legal/terms"}]}]},"fonts":{"family":"Geist"},"styling":{"codeblocks":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"latex":true},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nagaai-60f8697b","hasAudioNarration":false,"actualSubdomain":"nagaai-60f8697b","customDomains":["docs.naga.ac"],"gitSource":{"type":"github","owner":"naga-ai-hub","repo":"naga-ai","deployBranch":"master","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af6fffc5dcd64e14d2ea729","clientVersion":"0.0.4124","searchFilterCounts":[{"language":"default","tag":"Docs","count":32},{"language":"default","tag":"API Reference","count":24},{"language":"default","tag":"Endpoints","count":23},{"language":"default","tag":"Guides","count":14},{"language":"default","tag":"Integrations","count":13},{"language":"default","tag":"Account","count":11},{"language":"default","tag":"Coding agents","count":8},{"language":"default","tag":"How NagaAI works","count":5},{"language":"default","tag":"API Keys","count":5},{"language":"default","tag":"Get started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/chat-completions/create-a-chat-completion","slug":"/api-reference/chat-completions/create-a-chat-completion","pageMetadata":{"title":"Create a chat completion","description":"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. `/v1/responses` and `/v1/messages` serve the same models in the other two dialects.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. \", _jsx(_components.code, {\n children: \"/v1/responses\"\n }), \" and \", _jsx(_components.code, {\n children: \"/v1/messages\"\n }), \" serve the same models in the other two dialects.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"config":{},"pageMetadata":{"title":"Create a chat completion","description":"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. `/v1/responses` and `/v1/messages` serve the same models in the other two dialects.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat Completions"],"summary":"Create a chat completion","description":"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. `/v1/responses` and `/v1/messages` serve the same models in the other two dialects.","operationId":"create_chat_completion","externalDocs":{"url":"https://platform.openai.com/docs/api-reference/chat","description":"The OpenAI reference for this dialect."},"parameters":["38591eef-3161-43b2-bdbb-ea4759fa25e2"],"requestBody":"63863e4b-0570-48d2-a219-1c68377764b3","responses":{"200":"903dc264-9def-4ee4-8673-6c2f60d3b4a0","400":"1ba268e9-725a-4d5d-8c12-703055e9ccbb","401":"ae4b6fff-acd5-4df5-afc8-cb26d52b988b","402":"4748995e-8925-4ed2-9b7d-1eca83626bfd","403":"4b37fd53-4175-4d48-b582-fdf7ae2fac2f","404":"5bc3276a-c5bf-470c-ae91-b069ba1823c6","408":"7c9866ed-a205-4f0a-af10-4e0b998b40b6","410":"cc91eb86-2bfe-4169-b004-dcc207f936c0","413":"93a18413-f7f7-426f-be48-e357704f2787","422":"3caca85b-67a9-4a3f-8c1a-714597431460","429":"cab9ee2f-6fff-4417-a95f-c3baf21393fe","500":"771bc07d-5945-4710-98d9-67da926d3f58","503":"24154ffc-7f7b-4669-ac75-275f8f61c0f9"},"security":["cc849358-6a14-4419-8fc7-56a691bea547","68c9bf1a-807e-4fc5-bbde-8057060f816b"],"x-codeSamples":[{"lang":"bash","label":"curl","source":"curl https://api.naga.ac/v1/chat/completions \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"anthropic/claude-haiku-5.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ]\n}'"},{"lang":"python","label":"openai-python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.chat.completions.create(\n model=\"anthropic/claude-haiku-5.5\",\n messages=[\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ],\n)\nprint(result)\n"},{"lang":"javascript","label":"openai-node","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.chat.completions.create({\n model: \"anthropic/claude-haiku-5.5\",\n messages: [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ],\n});\nconsole.log(result);\n"}],"x-mcp":{"name":"naga_create_chat_completion","annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},"method":"post","type":"path","servers":["42fb540d-6e7f-41a7-a1b9-5a3fbd325768"],"path":"/v1/chat/completions","baseUrlOptions":["https://api.naga.ac"],"title":"Create a chat completion","codeSamples":[{"label":"curl","lang":"bash","source":"curl https://api.naga.ac/v1/chat/completions \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"anthropic/claude-haiku-5.5\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ]\n}'"},{"label":"openai-python","lang":"python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.chat.completions.create(\n model=\"anthropic/claude-haiku-5.5\",\n messages=[\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ],\n)\nprint(result)\n"},{"label":"openai-node","lang":"javascript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.chat.completions.create({\n model: \"anthropic/claude-haiku-5.5\",\n messages: [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Say hello in one word.\"\n }\n ],\n});\nconsole.log(result);\n"}],"requestExampleLanguages":["python","javascript","bash","go"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"anthropic/claude-haiku-5.5","body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.1":"You are a helpful assistant.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.1":"Say hello in one word."},{"body.model":"deepseek/deepseek-v4.1-flash","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.1":"What is 2+2?","body.reasoning_effort.oneOf.0":"medium"},{"body.model":"anthropic/claude-haiku-5.5","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.1":"Say hello in one word.","body.stream.oneOf.0":true,"body.stream_options.oneOf.0.include_usage":true},{"body.model":"anthropic/claude-sonnet-5.5","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.1":"What's the weather in NYC?","body.tools.oneOf.0.items.0.oneOf.0.function.name":"get_weather","body.tools.oneOf.0.items.0.oneOf.0.function.description.oneOf.0":"Get current weather","body.tools.oneOf.0.items.0.oneOf.0.function.parameters.oneOf.0.type":"object","body.tools.oneOf.0.items.0.oneOf.0.function.parameters.oneOf.0.properties":{"city":{"type":"string"}},"body.tools.oneOf.0.items.0.oneOf.0.function.parameters.oneOf.0.required":["city"],"body.tools.oneOf.0.items.0.oneOf.0.type":"function"}],"urlDisplay":"full"},"dependencies":{"parameters":{"38591eef-3161-43b2-bdbb-ea4759fa25e2":{"name":"x-naga-routing-strategy","in":"header","description":"The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension.","required":false,"schema":{"type":"string","description":"The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension.\nThe order in which NagaAI tries the providers that serve a model. A NagaAI extension.","enum":["reliability","balanced","latency","throughput","cache"],"isRequired":false,"uniqueKey":"","typeLabel":"enum\u003cstring>"}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The OpenAI-compatible Chat Completions request. The gateway takes an unrecognized key and drops it.","required":["model","messages"],"properties":{"model":{"type":"string","description":"The model to run, named by an id or alias from NagaAI's catalog. An entry without the `chat.completions` capability draws a refusal.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","items":{"type":"object","description":"One message of the conversation.","required":["role"],"properties":{"role":{"type":"string","description":"Who the message is from.","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"string"},"content":{"oneOf":[{"type":"array","items":{"oneOf":[{"type":"object","description":"One entry of a message's `content`. The role decides which kinds it admits.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text of this part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `text`.","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One entry of a message's `content`. The role decides which kinds it admits.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image reference and its detail level.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: an `http(s)` URL, or a `data:` URI under 20 MiB.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"type":"string","description":"How much detail to spend on this image.","default":"auto","enum":["low","high","auto"],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `image_url`.","enum":["image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"One entry of a message's `content`. The role decides which kinds it admits.","required":["type","file"],"properties":{"file":{"type":"object","description":"The file and the reference that names it.","properties":{"filename":{"oneOf":[{"type":"string","description":"The name the file is presented under when it reaches the model.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.filename.oneOf.0","typeLabel":"string"},{"type":"null","description":"The name the file is presented under when it reaches the model.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.filename.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.filename","typeLabel":"string | null"},"file_data":{"oneOf":[{"type":"string","description":"The file inline as a `data:` URI, or an `http(s)` URL, under 20 MiB.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_data.oneOf.0","typeLabel":"string"},{"type":"null","description":"The file inline as a `data:` URI, or an `http(s)` URL, under 20 MiB.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_data.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_data","typeLabel":"string | null"},"file_url":{"oneOf":[{"type":"string","description":"An `http(s)` URL naming the file. A NagaAI extension, dropped where a provider takes no URL.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_url.oneOf.0","typeLabel":"string"},{"type":"null","description":"An `http(s)` URL naming the file. A NagaAI extension, dropped where a provider takes no URL.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_url.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_url","typeLabel":"string | null"},"file_id":{"oneOf":[{"type":"string","description":"The id of a file uploaded earlier.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The id of a file uploaded earlier.","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file.file_id","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.file","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `file`.","enum":["file"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2","typeLabel":"object"},{"type":"object","description":"One entry of a message's `content`. The role decides which kinds it admits.","required":["type","input_audio"],"properties":{"input_audio":{"type":"object","description":"The audio payload and its format.","required":["data","format"],"properties":{"data":{"type":"string","description":"The audio as bare base64, under 20 MiB.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.3.input_audio.data","typeLabel":"string"},"format":{"type":"string","description":"The encoding of the base64 payload.","enum":["wav","mp3","aiff","aac","ogg","flac","m4a","pcm16","pcm24"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.3.input_audio.format","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.3.input_audio","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `input_audio`.","enum":["input_audio"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.3","typeLabel":"object"},{"type":"object","description":"One entry of a message's `content`. The role decides which kinds it admits.","required":["type","refusal"],"properties":{"refusal":{"type":"string","description":"The refusal text the model produced.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.4.refusal","typeLabel":"string"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `refusal`.","enum":["refusal"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.4.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.4","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX]","typeLabel":"object"},"title":"List of content parts","description":"The contents of the message. Optional only on an `assistant` message.","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"List of content parts · object[]"},{"type":"string","title":"Plain text","description":"The contents of the message. Optional only on an `assistant` message.","uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"string"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"List of content parts · object[] | string | null"},"images":{"oneOf":[{"type":"array","items":{"type":"object","description":"One entry of a message's `images`. A NagaAI extension carrying images beside `content`.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image reference and its detail level.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: an `http(s)` URL, or a `data:` URI under 20 MiB.","isRequired":true,"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].image_url.url","typeLabel":"string"},"detail":{"type":"string","description":"How much detail to spend on this image.","default":"auto","enum":["low","high","auto"],"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].image_url.detail","typeLabel":"enum\u003cstring>"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].image_url","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `image_url`.","enum":["image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn.","uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].signature.oneOf.0","typeLabel":"string"},{"type":"null","description":"The token that continues this image on a later turn.","uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].signature.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].signature","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in.","uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which vocabulary the token is written in.","uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].format.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX].format","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].images.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"Image references carried beside `content`. A NagaAI extension.","uniqueKey":"messages.items.[INDEX].images.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One entry of a message's `images`. A NagaAI extension carrying images beside `content`.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image reference and its detail level.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: an `http(s)` URL, or a `data:` URI under 20 MiB."},"detail":{"type":"string","description":"How much detail to spend on this image.","default":"auto","enum":["low","high","auto"]}}},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn."},{"type":"null","description":"The token that continues this image on a later turn."}]},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in."},{"type":"null","description":"Which vocabulary the token is written in."}]},"type":{"type":"string","description":"The tag that selects this branch: `type` is `image_url`.","enum":["image_url"]}}},"description":"Image references carried beside `content`. A NagaAI extension.","uniqueKey":"messages.items.[INDEX].images.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].images","typeLabel":"object[] | null"},"reasoning_details":{"oneOf":[{"type":"array","items":{"oneOf":[{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type","summary"],"properties":{"summary":{"type":"string","description":"The recap text.","isRequired":true,"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.summary","typeLabel":"string"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.summary`.","enum":["reasoning.summary"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"id":{"oneOf":[{"type":"string","description":"An identifier travelling with the entry, never routed onto a tool call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"An identifier travelling with the entry, never routed onto a tool call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type","data"],"properties":{"data":{"type":"string","description":"The sealed continuation token the provider issued for this reasoning.","isRequired":true,"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.data","typeLabel":"string"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.encrypted`.","enum":["reasoning.encrypted"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"id":{"oneOf":[{"type":"string","description":"An `id` matching one of `tool_calls[].id` binds `data` to that call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"An `id` matching one of `tool_calls[].id` binds `data` to that call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type"],"properties":{"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.text`.","enum":["reasoning.text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"id":{"oneOf":[{"type":"string","description":"An `id` matching one of `tool_calls[].id` binds `signature` to that call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"An `id` matching one of `tool_calls[].id` binds `signature` to that call.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index","typeLabel":"integer\u003cint64> | null"},"text":{"oneOf":[{"type":"string","description":"The reasoning text, absent on a signature-only entry.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text.oneOf.0","typeLabel":"string"},{"type":"null","description":"The reasoning text, absent on a signature-only entry.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text","typeLabel":"string | null"},"signature":{"oneOf":[{"type":"string","description":"The continuation token for this reasoning, replayed unchanged.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature.oneOf.0","typeLabel":"string"},{"type":"null","description":"The continuation token for this reasoning, replayed unchanged.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX].oneOf.2","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"Reasoning items of an earlier assistant turn, echoed back. A NagaAI extension that wins over `reasoning_content`.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"oneOf":[{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type","summary"],"properties":{"id":{"oneOf":[{"type":"string","description":"An identifier travelling with the entry, never routed onto a tool call."},{"type":"null","description":"An identifier travelling with the entry, never routed onto a tool call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string."},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."}]},"summary":{"type":"string","description":"The recap text."},"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.summary`.","enum":["reasoning.summary"]}}},{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type","data"],"properties":{"id":{"oneOf":[{"type":"string","description":"An `id` matching one of `tool_calls[].id` binds `data` to that call."},{"type":"null","description":"An `id` matching one of `tool_calls[].id` binds `data` to that call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string."},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."}]},"data":{"type":"string","description":"The sealed continuation token the provider issued for this reasoning."},"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.encrypted`.","enum":["reasoning.encrypted"]}}},{"type":"object","description":"One entry of a message's `reasoning_details`. A NagaAI extension.","required":["type"],"properties":{"id":{"oneOf":[{"type":"string","description":"An `id` matching one of `tool_calls[].id` binds `signature` to that call."},{"type":"null","description":"An `id` matching one of `tool_calls[].id` binds `signature` to that call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning dialect produced the entry, as an open string."},{"type":"null","description":"Which model family's reasoning dialect produced the entry, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Answers only."}]},"text":{"oneOf":[{"type":"string","description":"The reasoning text, absent on a signature-only entry."},{"type":"null","description":"The reasoning text, absent on a signature-only entry."}]},"signature":{"oneOf":[{"type":"string","description":"The continuation token for this reasoning, replayed unchanged."},{"type":"null","description":"The continuation token for this reasoning, replayed unchanged."}]},"type":{"type":"string","description":"The tag that selects this branch: `type` is `reasoning.text`.","enum":["reasoning.text"]}}}]},"description":"Reasoning items of an earlier assistant turn, echoed back. A NagaAI extension that wins over `reasoning_content`.","uniqueKey":"messages.items.[INDEX].reasoning_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_details","typeLabel":"object[] | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"The plain-text reasoning of an earlier assistant turn. A NagaAI extension.","uniqueKey":"messages.items.[INDEX].reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The plain-text reasoning of an earlier assistant turn. A NagaAI extension.","uniqueKey":"messages.items.[INDEX].reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning_content","typeLabel":"string | null"},"reasoning":{"oneOf":[{"type":"string","description":"An alias of `reasoning_content`, read last of the three.","uniqueKey":"messages.items.[INDEX].reasoning.oneOf.0","typeLabel":"string"},{"type":"null","description":"An alias of `reasoning_content`, read last of the three.","uniqueKey":"messages.items.[INDEX].reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].reasoning","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","description":"A name for the participant. The gateway drops it.","uniqueKey":"messages.items.[INDEX].name.oneOf.0","typeLabel":"string"},{"type":"null","description":"A name for the participant. The gateway drops it.","uniqueKey":"messages.items.[INDEX].name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].name","typeLabel":"string | null"},"tool_call_id":{"oneOf":[{"type":"string","description":"On a `tool` message, the id of the call it answers. Required there.","uniqueKey":"messages.items.[INDEX].tool_call_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"On a `tool` message, the id of the call it answers. Required there.","uniqueKey":"messages.items.[INDEX].tool_call_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].tool_call_id","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"The tool calls an assistant made, echoed back so results can follow.","uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"The tool calls an assistant made, echoed back so results can follow.","uniqueKey":"messages.items.[INDEX].tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"any[] | null"},"function_call":{"oneOf":[{"type":"object","description":"The singular call that preceded `tool_calls`. An assistant message carrying it draws a refusal.","additionalProperties":{"oneOf":[{}],"uniqueKey":"messages.items.[INDEX].function_call.oneOf.0.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"messages.items.[INDEX].function_call.oneOf.0","typeLabel":"object"},{"type":"null","description":"The singular call that preceded `tool_calls`. An assistant message carrying it draws a refusal.","additionalProperties":{"oneOf":[{}],"uniqueKey":"messages.items.[INDEX].function_call.oneOf.1.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"messages.items.[INDEX].function_call.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].function_call","typeLabel":"object | null"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"description":"The conversation so far, oldest first; one entry at least.","minItems":1,"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"routing":{"oneOf":[{"type":"object","description":"How NagaAI picks the providers for this request. `strategy` reorders them and never removes one; `max_price` removes the ones above it and can fail the request. A NagaAI extension.","properties":{"strategy":{"oneOf":[{"type":"string","description":"The strategy for this request. An unknown name draws a 400.","enum":["reliability","balanced","latency","throughput","cache"],"uniqueKey":"routing.oneOf.0.strategy.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"routing.oneOf.0.strategy.oneOf.1","typeLabel":"null"}],"uniqueKey":"routing.oneOf.0.strategy","typeLabel":"enum\u003cstring> | null"},"max_price":{"oneOf":[{"type":"object","description":"The most this request may pay per unit, keyed by a `meter` of the model's `pricing` in `GET /v1/models`: `{\"output_token\": \"0.000004\"}` caps output at 4 credits per million tokens. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose base `price` is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.","additionalProperties":{"oneOf":[{"type":"string","description":"A price cap: credits per unit, as a decimal string or a JSON number.","uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","description":"A price cap: credits per unit, as a decimal string or a JSON number.","format":"double","uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties.oneOf.1","typeLabel":"number\u003cdouble>"}],"uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties","typeLabel":"string | number\u003cdouble>"},"propertyNames":{"type":"string"},"uniqueKey":"routing.oneOf.0.max_price.oneOf.0","typeLabel":"object"},{"type":"null","description":"The most this request may pay per unit, keyed by a `meter` of the model's `pricing` in `GET /v1/models`: `{\"output_token\": \"0.000004\"}` caps output at 4 credits per million tokens. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose base `price` is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.","additionalProperties":{"oneOf":[{"type":"string","description":"A price cap: credits per unit, as a decimal string or a JSON number.","uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","description":"A price cap: credits per unit, as a decimal string or a JSON number.","format":"double","uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties.oneOf.1","typeLabel":"number\u003cdouble>"}],"uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties","typeLabel":"string | number\u003cdouble>"},"propertyNames":{"type":"string"},"uniqueKey":"routing.oneOf.0.max_price.oneOf.1","typeLabel":"null"}],"uniqueKey":"routing.oneOf.0.max_price","typeLabel":"object | null"}},"additionalProperties":false,"uniqueKey":"routing.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"routing.oneOf.1","typeLabel":"null"}],"uniqueKey":"routing","typeLabel":"object | null"},"service_tier":{"oneOf":[{"type":"string","description":"`flex` sends the request only to providers that sell at the model's base `price` in `GET /v1/models`, and fails it when none of them can serve it. Every other value, an unknown one included, and no value let NagaAI use any provider, at the price of the one that serves it.","enum":["auto","default","flex","scale","priority"],"uniqueKey":"service_tier.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"service_tier.oneOf.1","typeLabel":"null"}],"uniqueKey":"service_tier","typeLabel":"enum\u003cstring> | null"},"models":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"models.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it, or the request does not fit it. At most 3; the answer's `model` names the one that answered, and only that one is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it, or the request does not fit it. At most 3; the answer's `model` names the one that answered, and only that one is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.1","typeLabel":"null"}],"uniqueKey":"models","typeLabel":"string[] | null"},"tools":{"oneOf":[{"type":"array","items":{"oneOf":[{"type":"object","description":"One entry of `tools[]`, told apart by `type`.","required":["type","function"],"properties":{"function":{"type":"object","description":"The declaration itself — name, description and parameter schema.","required":["name"],"properties":{"name":{"type":"string","description":"The name the model calls the function by, never empty.","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.name","typeLabel":"string"},"description":{"oneOf":[{"type":"string","description":"What the function does, written for the model to choose by.","uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"What the function does, written for the model to choose by.","uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.description","typeLabel":"string | null"},"parameters":{"oneOf":[{"type":"object","description":"The arguments the function accepts, as a JSON Schema, compiled at intake.","additionalProperties":{"oneOf":[{}],"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.parameters.oneOf.0.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.parameters.oneOf.0","typeLabel":"object"},{"type":"null","description":"The arguments the function accepts, as a JSON Schema, compiled at intake.","additionalProperties":{"oneOf":[{}],"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.parameters.oneOf.1.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.parameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.parameters","typeLabel":"object | null"},"strict":{"oneOf":[{"type":"boolean","description":"Whether the model follows `parameters` exactly when filling the arguments.","uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the model follows `parameters` exactly when filling the arguments.","uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function.strict","typeLabel":"boolean | null"}},"isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.function","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `function`.","enum":["function"],"isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"One entry of `tools[]`, told apart by `type`.","required":["type"],"properties":{"type":{"type":"string","description":"The tag that selects this branch: `type` is `custom`.","enum":["custom"],"isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"tools.oneOf.0.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"tools.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The tools the model is allowed to call.","uniqueKey":"tools.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"oneOf":[{"type":"object","description":"One entry of `tools[]`, told apart by `type`.","required":["type","function"],"properties":{"function":{"type":"object","description":"The declaration itself — name, description and parameter schema.","required":["name"],"properties":{"name":{"type":"string","description":"The name the model calls the function by, never empty."},"description":{"oneOf":[{"type":"string","description":"What the function does, written for the model to choose by."},{"type":"null","description":"What the function does, written for the model to choose by."}]},"parameters":{"oneOf":[{"type":"object","description":"The arguments the function accepts, as a JSON Schema, compiled at intake.","additionalProperties":{"oneOf":[{}]},"propertyNames":{"type":"string"}},{"type":"null","description":"The arguments the function accepts, as a JSON Schema, compiled at intake.","additionalProperties":{"oneOf":[{}]},"propertyNames":{"type":"string"}}]},"strict":{"oneOf":[{"type":"boolean","description":"Whether the model follows `parameters` exactly when filling the arguments."},{"type":"null","description":"Whether the model follows `parameters` exactly when filling the arguments."}]}}},"type":{"type":"string","description":"The tag that selects this branch: `type` is `function`.","enum":["function"]}}},{"type":"object","description":"One entry of `tools[]`, told apart by `type`.","required":["type"],"properties":{"type":{"type":"string","description":"The tag that selects this branch: `type` is `custom`.","enum":["custom"]}}}]},"description":"The tools the model is allowed to call.","uniqueKey":"tools.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools","typeLabel":"object[] | null"},"functions":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"functions.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"The pre-`tools` function-calling surface. A request carrying it draws a refusal.","uniqueKey":"functions.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"The pre-`tools` function-calling surface. A request carrying it draws a refusal.","uniqueKey":"functions.oneOf.1","typeLabel":"null"}],"uniqueKey":"functions","typeLabel":"any[] | null"},"tool_choice":{"oneOf":[{"type":"object","description":"Which tool, if any, the model calls. An explicit `null` draws a refusal.","additionalProperties":{"oneOf":[{}],"uniqueKey":"tool_choice.oneOf.0.additionalProperties","typeLabel":"any"},"uniqueKey":"tool_choice.oneOf.0","typeLabel":"object"},{"type":"string","title":"Plain text","description":"Which tool, if any, the model calls. An explicit `null` draws a refusal.","uniqueKey":"tool_choice.oneOf.1","typeLabel":"string"}],"uniqueKey":"tool_choice","typeLabel":"object | string"},"response_format":{"oneOf":[{"type":"object","description":"The shape the model's output must take.","required":["type"],"properties":{"type":{"type":"string","description":"The tag that selects this branch: `type` is `text`.","enum":["text"],"isRequired":true,"uniqueKey":"response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.0","typeLabel":"object"},{"type":"object","description":"The shape the model's output must take.","required":["type"],"properties":{"type":{"type":"string","description":"The tag that selects this branch: `type` is `json_object`.","enum":["json_object"],"isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"object"},{"type":"object","description":"The shape the model's output must take.","required":["type","json_schema"],"properties":{"json_schema":{"type":"object","description":"The schema the reply is built to, with its name and strictness.","required":["name"],"properties":{"name":{"type":"string","description":"The name of this response format, never empty.","isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema.name","typeLabel":"string"},"description":{"oneOf":[{"type":"string","description":"What the format is for, written for the model.","uniqueKey":"response_format.oneOf.2.json_schema.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"What the format is for, written for the model.","uniqueKey":"response_format.oneOf.2.json_schema.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.2.json_schema.description","typeLabel":"string | null"},"schema":{"oneOf":[{"type":"object","description":"The JSON Schema the reply must conform to. A keyword the provider's dialect refuses travels no further.","additionalProperties":{"oneOf":[{}],"uniqueKey":"response_format.oneOf.2.json_schema.schema.oneOf.0.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"response_format.oneOf.2.json_schema.schema.oneOf.0","typeLabel":"object"},{"type":"null","description":"The JSON Schema the reply must conform to. A keyword the provider's dialect refuses travels no further.","additionalProperties":{"oneOf":[{}],"uniqueKey":"response_format.oneOf.2.json_schema.schema.oneOf.1.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"response_format.oneOf.2.json_schema.schema.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.2.json_schema.schema","typeLabel":"object | null"},"strict":{"oneOf":[{"type":"boolean","description":"Whether the model is held to the schema exactly.","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the model is held to the schema exactly.","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.2.json_schema.strict","typeLabel":"boolean | null"}},"isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema","typeLabel":"object"},"type":{"type":"string","description":"The tag that selects this branch: `type` is `json_schema`.","enum":["json_schema"],"isRequired":true,"uniqueKey":"response_format.oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.2","typeLabel":"object"},{"type":"null","uniqueKey":"response_format.oneOf.3","typeLabel":"null"}],"uniqueKey":"response_format","typeLabel":"object · object · object · null"},"temperature":{"oneOf":[{"type":"number","format":"double","description":"How much randomness goes into the reply, between 0 and 2, and an alternative to `top_p`.","maximum":2,"minimum":0,"uniqueKey":"temperature.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","description":"How much randomness goes into the reply, between 0 and 2, and an alternative to `top_p`.","maximum":2,"minimum":0,"uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number\u003cdouble> | null"},"top_p":{"oneOf":[{"type":"number","format":"double","description":"The sampling cut-off, between 0 and 1, and an alternative to `temperature`.","maximum":1,"minimum":0,"uniqueKey":"top_p.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","description":"The sampling cut-off, between 0 and 1, and an alternative to `temperature`.","maximum":1,"minimum":0,"uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number\u003cdouble> | null"},"stream":{"oneOf":[{"type":"boolean","description":"Whether the reply arrives incrementally as the model writes it.","uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the reply arrives incrementally as the model writes it.","uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"type":"object","description":"Extra streaming behavior. `include_usage` adds one trailing chunk carrying the totals.","properties":{"include_usage":{"type":"boolean","description":"Whether one extra chunk carrying the request's token totals closes the stream.","uniqueKey":"stream_options.oneOf.0.include_usage","typeLabel":"boolean"}},"uniqueKey":"stream_options.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options","typeLabel":"object | null"},"stop":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"List of stop strings","description":"Strings that end generation the moment the model produces one.","uniqueKey":"stop.oneOf.0","typeLabel":"string[]"},{"type":"string","title":"Plain text","description":"Strings that end generation the moment the model produces one.","uniqueKey":"stop.oneOf.1","typeLabel":"string"},{"type":"null","uniqueKey":"stop.oneOf.2","typeLabel":"null"}],"uniqueKey":"stop","typeLabel":"string[] | string | null"},"max_completion_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"The ceiling on generated tokens, reasoning included. At least 1.","minimum":1,"uniqueKey":"max_completion_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"The ceiling on generated tokens, reasoning included. At least 1.","minimum":1,"uniqueKey":"max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_completion_tokens","typeLabel":"integer\u003cint64> | null"},"max_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"An alias of `max_completion_tokens`, read only when that key is absent.","minimum":1,"uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"An alias of `max_completion_tokens`, read only when that key is absent.","minimum":1,"uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer\u003cint64> | null"},"reasoning_effort":{"oneOf":[{"type":"string","description":"How much reasoning to spend before answering, from `none` to `max`. A model without the level runs the nearest one it has.","enum":["none","minimal","low","medium","high","xhigh","max"],"uniqueKey":"reasoning_effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"reasoning_effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring> | null"},"presence_penalty":{"oneOf":[{"type":"number","format":"double","description":"How hard a token is penalized for having appeared, from -2 to 2.","maximum":2,"minimum":-2,"uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","description":"How hard a token is penalized for having appeared, from -2 to 2.","maximum":2,"minimum":-2,"uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number\u003cdouble> | null"},"frequency_penalty":{"oneOf":[{"type":"number","format":"double","description":"How hard repetition is penalized, scaled by how often, from -2 to 2.","maximum":2,"minimum":-2,"uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number\u003cdouble>"},{"type":"null","format":"double","description":"How hard repetition is penalized, scaled by how often, from -2 to 2.","maximum":2,"minimum":-2,"uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number\u003cdouble> | null"},"parallel_tool_calls":{"oneOf":[{"type":"boolean","description":"Whether the model may return several tool calls in one turn.","uniqueKey":"parallel_tool_calls.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the model may return several tool calls in one turn.","uniqueKey":"parallel_tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"parallel_tool_calls","typeLabel":"boolean | null"},"web_search_options":{"oneOf":[{"type":"object","description":"Turns on the built-in web search for this request. A model none of whose providers can search right now answers without it, and the reply says so in `x-naga-dropped-tools`.","properties":{"search_context_size":{"oneOf":[{"type":"string","description":"How much search context goes in front of the model.","enum":["low","medium","high"],"uniqueKey":"web_search_options.oneOf.0.search_context_size.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"web_search_options.oneOf.0.search_context_size.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.search_context_size","typeLabel":"enum\u003cstring> | null"},"user_location":{"oneOf":[{"type":"object","description":"Roughly where the caller is, so results can favor that place.","required":["approximate"],"properties":{"approximate":{"type":"object","description":"The place itself. Every key is optional.","properties":{"country":{"oneOf":[{"type":"string","description":"The two-letter ISO country code, such as `US`.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.country.oneOf.0","typeLabel":"string"},{"type":"null","description":"The two-letter ISO country code, such as `US`.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.country.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.country","typeLabel":"string | null"},"region":{"oneOf":[{"type":"string","description":"The region or state, in free text.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.region.oneOf.0","typeLabel":"string"},{"type":"null","description":"The region or state, in free text.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.region.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.region","typeLabel":"string | null"},"city":{"oneOf":[{"type":"string","description":"The city, in free text.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.city.oneOf.0","typeLabel":"string"},{"type":"null","description":"The city, in free text.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.city.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.city","typeLabel":"string | null"},"timezone":{"oneOf":[{"type":"string","description":"The IANA time zone, such as `America/Chicago`.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.timezone.oneOf.0","typeLabel":"string"},{"type":"null","description":"The IANA time zone, such as `America/Chicago`.","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.timezone.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate.timezone","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.approximate","typeLabel":"object"},"type":{"type":"string","description":"Always `approximate`.","enum":["approximate"],"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"web_search_options.oneOf.0.user_location.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options.oneOf.0.user_location","typeLabel":"object | null"}},"uniqueKey":"web_search_options.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"web_search_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"web_search_options","typeLabel":"object | null"},"truncation":{"oneOf":[{"type":"string","description":"`auto` lets NagaAI drop whole turns from the middle of a conversation that does not fit the model's context window, keeping the system prompt, the first and the latest turn; `disabled`, the default, refuses it with `context_length_exceeded`. A NagaAI extension, the same key as in the Responses API.","enum":["auto","disabled"],"uniqueKey":"truncation.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"truncation.oneOf.1","typeLabel":"null"}],"uniqueKey":"truncation","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","value":{"model":"anthropic/claude-haiku-5.5","messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Say hello in one word."}]}},"reasoning":{"title":"reasoning","value":{"model":"deepseek/deepseek-v4.1-flash","messages":[{"role":"user","content":"What is 2+2?"}],"reasoning_effort":"medium"}},"streaming":{"title":"streaming","value":{"model":"anthropic/claude-haiku-5.5","messages":[{"role":"user","content":"Say hello in one word."}],"stream":true,"stream_options":{"include_usage":true}}},"tool-call":{"title":"tool-call","value":{"model":"anthropic/claude-sonnet-5.5","messages":[{"role":"user","content":"What's the weather in NYC?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get current weather","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"903dc264-9def-4ee4-8673-6c2f60d3b4a0":{"description":"The completion. `application/json` carries one `chat.completion` object when `stream` is false; `text/event-stream` carries one `chat.completion.chunk` per event, then the `data: [DONE]` sentinel, when it is true.","headers":{"x-naga-dropped-tools":{"schema":{"type":"string"},"description":"Hosted tools from the request that did not run because no provider of the model could serve them right now, comma-separated: `web_search`. Absent when every requested tool was available. A NagaAI extension."},"x-naga-routing-strategy":{"schema":{"type":"string"},"description":"The routing strategy NagaAI applied to this request."}},"content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"The completion. The gateway answers a request it does not forward with the second shape, which omits `logprobs` and `refusal`.","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","description":"This answer's identifier, repeated on every frame of a stream.","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string"},"object":{"type":"string","description":"What kind of object this is. Always `chat.completion`.","example":"chat.completion","isRequired":true,"uniqueKey":"oneOf.0.object","typeLabel":"string"},"created":{"type":"integer","format":"int64","description":"When the answer was created, in seconds since the Unix epoch.","isRequired":true,"uniqueKey":"oneOf.0.created","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"The model that answered, by its id in the NagaAI catalog.","isRequired":true,"uniqueKey":"oneOf.0.model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","description":"One answer the model produced for the request.","required":["index","message","finish_reason","logprobs"],"properties":{"index":{"type":"integer","format":"int64","description":"This answer's position in `choices[]`. Always `0`.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"message":{"type":"object","description":"The message the model produced.","required":["role","content","refusal"],"properties":{"role":{"type":"string","description":"Who wrote the message. Always `assistant`.","example":"assistant","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","description":"The text the model returned, or `null` when the turn produced none.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The text the model returned, or `null` when the turn produced none.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.content","typeLabel":"string | null"},"refusal":{"oneOf":[{"type":"string","description":"The reason the model gave for declining, or `null`.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.refusal.oneOf.0","typeLabel":"string"},{"type":"null","description":"The reason the model gave for declining, or `null`.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.refusal.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.refusal","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_content","typeLabel":"string | null"},"reasoning_details":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_details.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.reasoning_details","typeLabel":"any[] | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"One tool call the model made, with every key present at once.","required":["id","type","function"],"properties":{"id":{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"What kind of call this is. Always `function`.","example":"function","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string"},"function":{"type":"object","description":"Which function to call, and with what arguments.","required":["name","arguments"],"properties":{"name":{"type":"string","description":"The name of the function to call, as declared in `tools[]`.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The tool calls the model made, absent when it made none.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One tool call the model made, with every key present at once.","required":["id","type","function"],"properties":{"id":{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message."},"type":{"type":"string","description":"What kind of call this is. Always `function`.","example":"function"},"function":{"type":"object","description":"Which function to call, and with what arguments.","required":["name","arguments"],"properties":{"name":{"type":"string","description":"The name of the function to call, as declared in `tools[]`."},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed."}}}}},"description":"The tool calls the model made, absent when it made none.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.tool_calls","typeLabel":"object[] | null"},"images":{"oneOf":[{"type":"array","items":{"type":"object","description":"One image the model generated. A NagaAI extension beside `content`.","required":["type","image_url"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `image_url`.","example":"image_url","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].type","typeLabel":"string"},"image_url":{"type":"object","description":"Where to read the image.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: a `data:` URI when the provider returned bytes, its own URL when it returned a link.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].image_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].image_url","typeLabel":"object"},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].signature.oneOf.0","typeLabel":"string"},{"type":"null","description":"The token that continues this image on a later turn.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].signature.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].signature","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which vocabulary the token is written in.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].format.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX].format","typeLabel":"string | null"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The images the model generated. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One image the model generated. A NagaAI extension beside `content`.","required":["type","image_url"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `image_url`.","example":"image_url"},"image_url":{"type":"object","description":"Where to read the image.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: a `data:` URI when the provider returned bytes, its own URL when it returned a link."}}},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn."},{"type":"null","description":"The token that continues this image on a later turn."}]},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in."},{"type":"null","description":"Which vocabulary the token is written in."}]}}},"description":"The images the model generated. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.images.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.images","typeLabel":"object[] | null"},"annotations":{"oneOf":[{"type":"array","items":{"type":"object","description":"One citation of a web page, the only kind of annotation an answer carries.","required":["type","url_citation"],"properties":{"type":{"type":"string","description":"Always `url_citation`.","example":"url_citation","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].type","typeLabel":"string"},"url_citation":{"type":"object","description":"The page and the span of the answer it backs.","required":["start_index","end_index","url","title"],"properties":{"start_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span starts.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].url_citation.start_index","typeLabel":"integer\u003cint64>"},"end_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span ends.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].url_citation.end_index","typeLabel":"integer\u003cint64>"},"url":{"type":"string","description":"The address of the page.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].url_citation.url","typeLabel":"string"},"title":{"type":"string","description":"The title of the page.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].url_citation.title","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX].url_citation","typeLabel":"object"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The web pages the answer cites, each with the span of `content` it backs. Absent when the answer cites none.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One citation of a web page, the only kind of annotation an answer carries.","required":["type","url_citation"],"properties":{"type":{"type":"string","description":"Always `url_citation`.","example":"url_citation"},"url_citation":{"type":"object","description":"The page and the span of the answer it backs.","required":["start_index","end_index","url","title"],"properties":{"start_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span starts."},"end_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span ends."},"url":{"type":"string","description":"The address of the page."},"title":{"type":"string","description":"The title of the page."}}}}},"description":"The web pages the answer cites, each with the span of `content` it backs. Absent when the answer cites none.","uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].message.annotations","typeLabel":"object[] | null"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","description":"Why the model stopped, in one of four values.","example":"stop","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason","typeLabel":"string"},"logprobs":{"description":"Always `null`. The gateway returns no token log probabilities.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs","typeLabel":"any"}},"uniqueKey":"oneOf.0.choices.items.[INDEX]","typeLabel":"object"},"description":"The answers the model produced — one entry, see `index`.","isRequired":true,"uniqueKey":"oneOf.0.choices","typeLabel":"object[]"},"usage":{"oneOf":[{"type":"object","description":"What the request cost in tokens, absent when the provider reported none.","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"properties":{"prompt_tokens":{"type":"integer","format":"int64","description":"Tokens of the prompt, cached ones included.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens","typeLabel":"integer\u003cint64>"},"completion_tokens":{"type":"integer","format":"int64","description":"Tokens the model generated, reasoning and image tokens included.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The provider's own total for the request, reported as received.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.total_tokens","typeLabel":"integer\u003cint64>"},"prompt_tokens_details":{"type":"object","description":"The split of `prompt_tokens` the provider reported.","required":["cached_tokens"],"properties":{"cached_tokens":{"type":"integer","format":"int64","description":"How many prompt tokens the provider served from its own cache. `0` when it reported none.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cached_tokens","typeLabel":"integer\u003cint64>"},"audio_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens were audio, present only when the provider split them out.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens were audio, present only when the provider split them out.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","description":"The split of `completion_tokens` the provider reported.","required":["reasoning_tokens"],"properties":{"reasoning_tokens":{"type":"integer","format":"int64","description":"How many generated tokens the model spent reasoning. `0` when the provider reported none.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.reasoning_tokens","typeLabel":"integer\u003cint64>"},"image_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage","typeLabel":"object | null"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"The completion. The gateway answers a request it does not forward with the second shape, which omits `logprobs` and `refusal`.","required":["id","created","model","choices","usage"],"properties":{"id":{"type":"string","description":"This answer's identifier, opaque end to end.","isRequired":true,"uniqueKey":"oneOf.1.id","typeLabel":"string"},"created":{"type":"integer","format":"int64","description":"When the answer was created, in whole seconds since the Unix epoch.","isRequired":true,"uniqueKey":"oneOf.1.created","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"The model the answer is attributed to, after alias resolution.","isRequired":true,"uniqueKey":"oneOf.1.model","typeLabel":"string"},"choices":{"oneOf":[{"type":"array","items":{"type":"object","description":"One choice of a non-streaming chat completion.","required":["message"],"properties":{"message":{"type":"object","description":"The message the model produced.","required":["role"],"properties":{"role":{"type":"string","description":"Who wrote the message. `assistant` on an answer.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","title":"Plain text","description":"The text the model returned, absent when the turn produced none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.content.oneOf.1.items.[INDEX]","typeLabel":"any"},"title":"List of content parts","description":"The text the model returned, absent when the turn produced none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.content.oneOf.1","typeLabel":"any[]"},{"type":"null","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.content.oneOf.2","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.content","typeLabel":"string | any[] | null"},"refusal":{"oneOf":[{"type":"string","description":"The reason the model gave for declining, absent when it did not.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.refusal.oneOf.0","typeLabel":"string"},{"type":"null","description":"The reason the model gave for declining, absent when it did not.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.refusal","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"One tool call the model made.","required":["function"],"properties":{"function":{"type":"object","description":"Which function to call, and with what arguments.","properties":{"name":{"oneOf":[{"type":"string","description":"The name of the function to call, as declared in `tools[]`.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"The name of the function to call, as declared in `tools[]`.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string | null"},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"},"id":{"oneOf":[{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The call's id, repeated as `tool_call_id` on the answering message.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string | null"},"type":{"type":"string","description":"What kind of call this is. Always `function`.","enum":["function"],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The tool calls the model made. Absent when it made none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One tool call the model made.","required":["function"],"properties":{"id":{"oneOf":[{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message."},{"type":"null","description":"The call's id, repeated as `tool_call_id` on the answering message."}]},"type":{"type":"string","description":"What kind of call this is. Always `function`.","enum":["function"]},"function":{"type":"object","description":"Which function to call, and with what arguments.","properties":{"name":{"oneOf":[{"type":"string","description":"The name of the function to call, as declared in `tools[]`."},{"type":"null","description":"The name of the function to call, as declared in `tools[]`."}]},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed."}}}}},"description":"The tool calls the model made. Absent when it made none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_calls","typeLabel":"object[] | null"},"annotations":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.annotations.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"The web pages the answer cites, as `url_citation` entries. Absent when it cites none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.annotations.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"The web pages the answer cites, as `url_citation` entries. Absent when it cites none.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.annotations.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.annotations","typeLabel":"any[] | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_content","typeLabel":"string | null"},"reasoning_details":{"oneOf":[{"type":"array","items":{"oneOf":[{"type":"object","title":"Reasoning summary","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","summary"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.summary` here.","enum":["reasoning.summary"],"isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"summary":{"type":"string","description":"The model's summary of its own reasoning, sliced across frames on a stream.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.summary","typeLabel":"string"},"id":{"oneOf":[{"type":"string","description":"Absent on a summary entry; one sent back routes the entry nowhere.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Absent on a summary entry; one sent back routes the entry nowhere.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0.index","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.0","typeLabel":"Reasoning summary · object"},{"type":"object","title":"Encrypted reasoning","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","data"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.encrypted` here.","enum":["reasoning.encrypted"],"isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"data":{"type":"string","description":"The continuation token itself, opaque and replayed unchanged.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.data","typeLabel":"string"},"id":{"oneOf":[{"type":"string","description":"The `tool_calls[].id` this token belongs to, when the token came with a call.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The `tool_calls[].id` this token belongs to, when the token came with a call.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format this token follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning format this token follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1.index","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.1","typeLabel":"Encrypted reasoning · object"},{"type":"object","title":"Reasoning text","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.text` here.","enum":["reasoning.text"],"isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"id":{"oneOf":[{"type":"string","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id.oneOf.0","typeLabel":"string"},{"type":"null","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.id","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.format","typeLabel":"string | null"},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.index","typeLabel":"integer\u003cint64> | null"},"text":{"oneOf":[{"type":"string","description":"The model's reasoning as text, sliced across frames on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text.oneOf.0","typeLabel":"string"},{"type":"null","description":"The model's reasoning as text, sliced across frames on a stream.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.text","typeLabel":"string | null"},"signature":{"oneOf":[{"type":"string","description":"The opaque continuation token for this reasoning, replayed unchanged.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature.oneOf.0","typeLabel":"string"},{"type":"null","description":"The opaque continuation token for this reasoning, replayed unchanged.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2.signature","typeLabel":"string | null"}},"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX].oneOf.2","typeLabel":"Reasoning text · object"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0.items.[INDEX]","typeLabel":"Reasoning summary · object | Encrypted reasoning · object | Reasoning text · object"},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.0","typeLabel":"(Reasoning summary · object | Encrypted reasoning · object | Reasoning text · object)[]"},{"type":"null","items":{"oneOf":[{"type":"object","title":"Reasoning summary","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","summary"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a summary entry; one sent back routes the entry nowhere."},{"type":"null","description":"Absent on a summary entry; one sent back routes the entry nowhere."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.summary` here.","enum":["reasoning.summary"]},"summary":{"type":"string","description":"The model's summary of its own reasoning, sliced across frames on a stream."}}},{"type":"object","title":"Encrypted reasoning","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","data"],"properties":{"id":{"oneOf":[{"type":"string","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."},{"type":"null","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format this token follows, as an open string."},{"type":"null","description":"Which model family's reasoning format this token follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.encrypted` here.","enum":["reasoning.encrypted"]},"data":{"type":"string","description":"The continuation token itself, opaque and replayed unchanged."}}},{"type":"object","title":"Reasoning text","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."},{"type":"null","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.text` here.","enum":["reasoning.text"]},"text":{"oneOf":[{"type":"string","description":"The model's reasoning as text, sliced across frames on a stream."},{"type":"null","description":"The model's reasoning as text, sliced across frames on a stream."}]},"signature":{"oneOf":[{"type":"string","description":"The opaque continuation token for this reasoning, replayed unchanged."},{"type":"null","description":"The opaque continuation token for this reasoning, replayed unchanged."}]}}}]},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.reasoning_details","typeLabel":"(Reasoning summary · object | Encrypted reasoning · object | Reasoning text · object)[] | null"},"images":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.images.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"The images the model generated, beside `content`. A NagaAI extension.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.images.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"The images the model generated, beside `content`. A NagaAI extension.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.images.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.images","typeLabel":"any[] | null"},"name":{"oneOf":[{"type":"string","description":"The participant name a request may carry. This gateway never sends it.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"The participant name a request may carry. This gateway never sends it.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.name","typeLabel":"string | null"},"tool_call_id":{"oneOf":[{"type":"string","description":"The id of the call a `tool` message answers. This gateway never sends it.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_call_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The id of the call a `tool` message answers. This gateway never sends it.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_call_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message.tool_call_id","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].message","typeLabel":"object"},"index":{"type":"integer","format":"int64","description":"This answer's position in `choices`. Always `0`.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"finish_reason":{"oneOf":[{"type":"string","description":"Why the model stopped, in one of four values.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].finish_reason.oneOf.0","typeLabel":"string"},{"type":"null","description":"Why the model stopped, in one of four values.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].finish_reason","typeLabel":"string | null"},"logprobs":{"description":"Not sent. The gateway returns no token log probabilities.","uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX].logprobs","typeLabel":"any"}},"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The one answer to the request; the key is on every body.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One choice of a non-streaming chat completion.","required":["message"],"properties":{"index":{"type":"integer","format":"int64","description":"This answer's position in `choices`. Always `0`."},"message":{"type":"object","description":"The message the model produced.","required":["role"],"properties":{"role":{"type":"string","description":"Who wrote the message. `assistant` on an answer."},"content":{"oneOf":[{"type":"string","title":"Plain text","description":"The text the model returned, absent when the turn produced none."},{"type":"array","items":{"oneOf":[{}]},"title":"List of content parts","description":"The text the model returned, absent when the turn produced none."},{"type":"null"}]},"refusal":{"oneOf":[{"type":"string","description":"The reason the model gave for declining, absent when it did not."},{"type":"null","description":"The reason the model gave for declining, absent when it did not."}]},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"One tool call the model made.","required":["function"],"properties":{"id":{"oneOf":[{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message."},{"type":"null","description":"The call's id, repeated as `tool_call_id` on the answering message."}]},"type":{"type":"string","description":"What kind of call this is. Always `function`.","enum":["function"]},"function":{"type":"object","description":"Which function to call, and with what arguments.","properties":{"name":{"oneOf":[{"type":"string","description":"The name of the function to call, as declared in `tools[]`."},{"type":"null","description":"The name of the function to call, as declared in `tools[]`."}]},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed."}}}}},"description":"The tool calls the model made. Absent when it made none."},{"type":"null","items":{"type":"object","description":"One tool call the model made.","required":["function"],"properties":{"id":{"oneOf":[{"type":"string","description":"The call's id, repeated as `tool_call_id` on the answering message."},{"type":"null","description":"The call's id, repeated as `tool_call_id` on the answering message."}]},"type":{"type":"string","description":"What kind of call this is. Always `function`.","enum":["function"]},"function":{"type":"object","description":"Which function to call, and with what arguments.","properties":{"name":{"oneOf":[{"type":"string","description":"The name of the function to call, as declared in `tools[]`."},{"type":"null","description":"The name of the function to call, as declared in `tools[]`."}]},"arguments":{"type":"string","description":"The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed."}}}}},"description":"The tool calls the model made. Absent when it made none."}]},"annotations":{"oneOf":[{"type":"array","items":{"oneOf":[{}]},"description":"The web pages the answer cites, as `url_citation` entries. Absent when it cites none."},{"type":"null","items":{"oneOf":[{}]},"description":"The web pages the answer cites, as `url_citation` entries. Absent when it cites none."}]},"reasoning_content":{"oneOf":[{"type":"string","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only."},{"type":"null","description":"The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only."}]},"reasoning_details":{"oneOf":[{"type":"array","items":{"oneOf":[{"type":"object","title":"Reasoning summary","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","summary"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a summary entry; one sent back routes the entry nowhere."},{"type":"null","description":"Absent on a summary entry; one sent back routes the entry nowhere."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.summary` here.","enum":["reasoning.summary"]},"summary":{"type":"string","description":"The model's summary of its own reasoning, sliced across frames on a stream."}}},{"type":"object","title":"Encrypted reasoning","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","data"],"properties":{"id":{"oneOf":[{"type":"string","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."},{"type":"null","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format this token follows, as an open string."},{"type":"null","description":"Which model family's reasoning format this token follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.encrypted` here.","enum":["reasoning.encrypted"]},"data":{"type":"string","description":"The continuation token itself, opaque and replayed unchanged."}}},{"type":"object","title":"Reasoning text","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."},{"type":"null","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.text` here.","enum":["reasoning.text"]},"text":{"oneOf":[{"type":"string","description":"The model's reasoning as text, sliced across frames on a stream."},{"type":"null","description":"The model's reasoning as text, sliced across frames on a stream."}]},"signature":{"oneOf":[{"type":"string","description":"The opaque continuation token for this reasoning, replayed unchanged."},{"type":"null","description":"The opaque continuation token for this reasoning, replayed unchanged."}]}}}]},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension."},{"type":"null","items":{"oneOf":[{"type":"object","title":"Reasoning summary","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","summary"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a summary entry; one sent back routes the entry nowhere."},{"type":"null","description":"Absent on a summary entry; one sent back routes the entry nowhere."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.summary` here.","enum":["reasoning.summary"]},"summary":{"type":"string","description":"The model's summary of its own reasoning, sliced across frames on a stream."}}},{"type":"object","title":"Encrypted reasoning","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type","data"],"properties":{"id":{"oneOf":[{"type":"string","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."},{"type":"null","description":"The `tool_calls[].id` this token belongs to, when the token came with a call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format this token follows, as an open string."},{"type":"null","description":"Which model family's reasoning format this token follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.encrypted` here.","enum":["reasoning.encrypted"]},"data":{"type":"string","description":"The continuation token itself, opaque and replayed unchanged."}}},{"type":"object","title":"Reasoning text","description":"One entry of `reasoning_details`, told apart by its `type`.","required":["type"],"properties":{"id":{"oneOf":[{"type":"string","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."},{"type":"null","description":"Absent on a text entry; one sent back routes a `signature` onto the matching call."}]},"format":{"oneOf":[{"type":"string","description":"Which model family's reasoning format the entry follows, as an open string."},{"type":"null","description":"Which model family's reasoning format the entry follows, as an open string."}]},"index":{"oneOf":[{"type":"integer","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."},{"type":"null","format":"int64","description":"Where the entry sits among the turn's reasoning entries. Absent on a stream."}]},"type":{"type":"string","description":"What kind of entry this is. Always `reasoning.text` here.","enum":["reasoning.text"]},"text":{"oneOf":[{"type":"string","description":"The model's reasoning as text, sliced across frames on a stream."},{"type":"null","description":"The model's reasoning as text, sliced across frames on a stream."}]},"signature":{"oneOf":[{"type":"string","description":"The opaque continuation token for this reasoning, replayed unchanged."},{"type":"null","description":"The opaque continuation token for this reasoning, replayed unchanged."}]}}}]},"description":"The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension."}]},"images":{"oneOf":[{"type":"array","items":{"oneOf":[{}]},"description":"The images the model generated, beside `content`. A NagaAI extension."},{"type":"null","items":{"oneOf":[{}]},"description":"The images the model generated, beside `content`. A NagaAI extension."}]},"name":{"oneOf":[{"type":"string","description":"The participant name a request may carry. This gateway never sends it."},{"type":"null","description":"The participant name a request may carry. This gateway never sends it."}]},"tool_call_id":{"oneOf":[{"type":"string","description":"The id of the call a `tool` message answers. This gateway never sends it."},{"type":"null","description":"The id of the call a `tool` message answers. This gateway never sends it."}]}}},"finish_reason":{"oneOf":[{"type":"string","description":"Why the model stopped, in one of four values."},{"type":"null","description":"Why the model stopped, in one of four values."}]},"logprobs":{"description":"Not sent. The gateway returns no token log probabilities."}}},"description":"The one answer to the request; the key is on every body.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.choices","typeLabel":"object[] | null"},"usage":{"oneOf":[{"type":"object","description":"What the request cost in tokens, `null` when the gateway metered nothing.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","format":"int64","description":"Tokens of the prompt, cached ones included.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens","typeLabel":"integer\u003cint64>"},"completion_tokens":{"type":"integer","format":"int64","description":"Tokens of the answer, reasoning and image tokens included.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The provider's own total for the request, never recomputed here.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.total_tokens","typeLabel":"integer\u003cint64>"},"prompt_tokens_details":{"oneOf":[{"type":"object","description":"The split of `prompt_tokens`. Absent when the answer reports none.","properties":{"cached_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens the provider served from its own cache.","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens the provider served from its own cache.","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details","typeLabel":"object | null"},"completion_tokens_details":{"oneOf":[{"type":"object","description":"The split of `completion_tokens`. Absent when the answer reports none.","properties":{"image_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details","typeLabel":"object | null"}},"isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0","typeLabel":"object"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.usage","typeLabel":"object | null"},"object":{"type":"string","description":"What kind of object this is. Always `chat.completion`.","enum":["chat.completion"],"uniqueKey":"oneOf.1.object","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","value":{"id":"chatcmpl-6Zq1s8bF2wKcT4mN","object":"chat.completion","created":1774000000,"model":"anthropic/claude-haiku-5.5","choices":[{"index":0,"message":{"role":"assistant","content":"Hello","refusal":null},"finish_reason":"stop","logprobs":null}],"usage":{"prompt_tokens":18,"completion_tokens":1,"total_tokens":19,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":0}}}},"reasoning":{"title":"reasoning","value":{"id":"chatcmpl-7Bd0kR3nQyLpVs","object":"chat.completion","created":1774000000,"model":"deepseek/deepseek-v4.1-flash","choices":[{"index":0,"message":{"role":"assistant","content":"4","refusal":null,"reasoning_content":"2 plus 2 equals 4","reasoning_details":[{"type":"reasoning.text","index":0,"id":"reasoning-text-0","text":"2 plus 2 equals 4"}]},"finish_reason":"stop","logprobs":null}],"usage":{"prompt_tokens":14,"completion_tokens":9,"total_tokens":23,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":8}}}},"tool-call":{"title":"tool-call","value":{"id":"chatcmpl-5Nf2wXcH8tZrKm","object":"chat.completion","created":1774000000,"model":"anthropic/claude-sonnet-5.5","choices":[{"index":0,"message":{"role":"assistant","content":null,"refusal":null,"tool_calls":[{"id":"call_abc123","type":"function","function":{"name":"get_weather","arguments":"{\"city\":\"NYC\"}"}}]},"finish_reason":"tool_calls","logprobs":null}],"usage":{"prompt_tokens":18,"completion_tokens":1,"total_tokens":19,"prompt_tokens_details":{"cached_tokens":0},"completion_tokens_details":{"reasoning_tokens":0}}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"oneOf":[{"type":"object","description":"One frame. The gateway answers a request it does not forward with the second shape, and replaces a frame with the third when the stream fails midway.","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","description":"The answer's identifier, repeated on every frame of it.","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string"},"object":{"type":"string","description":"What kind of object this is. Always `chat.completion.chunk`.","example":"chat.completion.chunk","isRequired":true,"uniqueKey":"oneOf.0.object","typeLabel":"string"},"created":{"type":"integer","format":"int64","description":"When the answer was created, in seconds since the Unix epoch, repeated on every frame of it.","isRequired":true,"uniqueKey":"oneOf.0.created","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"The model producing the answer, repeated on every frame of it.","isRequired":true,"uniqueKey":"oneOf.0.model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","description":"One answer's share of a streamed frame.","required":["index","delta","finish_reason","logprobs"],"properties":{"index":{"type":"integer","format":"int64","description":"Which answer the frame belongs to. Always `0`, as in a non-streaming body.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"delta":{"type":"object","description":"What this frame adds to the answer.","properties":{"role":{"oneOf":[{"type":"string","description":"Who is writing. `assistant`, sent once on the first frame.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role.oneOf.0","typeLabel":"string"},{"type":"null","description":"Who is writing. `assistant`, sent once on the first frame.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role","typeLabel":"string | null"},"content":{"oneOf":[{"type":"string","description":"The next slice of the answer text, which can be a fragment of a word.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The next slice of the answer text, which can be a fragment of a word.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","description":"The next slice of the plain-text reasoning summary. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The next slice of the plain-text reasoning summary. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_content","typeLabel":"string | null"},"reasoning_details":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_details.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"Structured reasoning entries for what the model just produced. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_details.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"Structured reasoning entries for what the model just produced. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.reasoning_details","typeLabel":"any[] | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"One tool call as a stream reports it, accumulated by `index`.","required":["index","function"],"properties":{"index":{"type":"integer","format":"int64","description":"Which tool call of this turn the frame is about, and the key to accumulate on.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"function":{"type":"object","description":"The part of the call this frame carries: a name, or an argument slice.","required":["arguments"],"properties":{"arguments":{"type":"string","description":"The next slice of the argument JSON; no slice is valid JSON alone.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"oneOf":[{"type":"string","description":"The name of the function to call, sent once on the announce frame.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"The name of the function to call, sent once on the announce frame.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"},"id":{"oneOf":[{"type":"string","description":"The call's id, sent once on the frame that announces the call.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","description":"The call's id, sent once on the frame that announces the call.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","description":"What kind of call this is. Always `function`.","example":"function","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type.oneOf.0","typeLabel":"string"},{"type":"null","description":"What kind of call this is. Always `function`.","example":"function","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string | null"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"Tool-call frames: an announcement, or the next argument slice.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One tool call as a stream reports it, accumulated by `index`.","required":["index","function"],"properties":{"index":{"type":"integer","format":"int64","description":"Which tool call of this turn the frame is about, and the key to accumulate on."},"id":{"oneOf":[{"type":"string","description":"The call's id, sent once on the frame that announces the call."},{"type":"null","description":"The call's id, sent once on the frame that announces the call."}]},"type":{"oneOf":[{"type":"string","description":"What kind of call this is. Always `function`.","example":"function"},{"type":"null","description":"What kind of call this is. Always `function`.","example":"function"}]},"function":{"type":"object","description":"The part of the call this frame carries: a name, or an argument slice.","required":["arguments"],"properties":{"name":{"oneOf":[{"type":"string","description":"The name of the function to call, sent once on the announce frame."},{"type":"null","description":"The name of the function to call, sent once on the announce frame."}]},"arguments":{"type":"string","description":"The next slice of the argument JSON; no slice is valid JSON alone."}}}}},"description":"Tool-call frames: an announcement, or the next argument slice.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls","typeLabel":"object[] | null"},"images":{"oneOf":[{"type":"array","items":{"type":"object","description":"One image the model generated. A NagaAI extension beside `content`.","required":["type","image_url"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `image_url`.","example":"image_url","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].type","typeLabel":"string"},"image_url":{"type":"object","description":"Where to read the image.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: a `data:` URI when the provider returned bytes, its own URL when it returned a link.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].image_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].image_url","typeLabel":"object"},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].signature.oneOf.0","typeLabel":"string"},{"type":"null","description":"The token that continues this image on a later turn.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].signature.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].signature","typeLabel":"string | null"},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].format.oneOf.0","typeLabel":"string"},{"type":"null","description":"Which vocabulary the token is written in.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].format.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX].format","typeLabel":"string | null"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"A generated image, sent whole on one frame. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One image the model generated. A NagaAI extension beside `content`.","required":["type","image_url"],"properties":{"type":{"type":"string","description":"What kind of entry this is. Always `image_url`.","example":"image_url"},"image_url":{"type":"object","description":"Where to read the image.","required":["url"],"properties":{"url":{"type":"string","description":"Where the image lives: a `data:` URI when the provider returned bytes, its own URL when it returned a link."}}},"signature":{"oneOf":[{"type":"string","description":"The token that continues this image on a later turn."},{"type":"null","description":"The token that continues this image on a later turn."}]},"format":{"oneOf":[{"type":"string","description":"Which vocabulary the token is written in."},{"type":"null","description":"Which vocabulary the token is written in."}]}}},"description":"A generated image, sent whole on one frame. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.images","typeLabel":"object[] | null"},"annotations":{"oneOf":[{"type":"array","items":{"type":"object","description":"One citation of a web page, the only kind of annotation an answer carries.","required":["type","url_citation"],"properties":{"type":{"type":"string","description":"Always `url_citation`.","example":"url_citation","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].type","typeLabel":"string"},"url_citation":{"type":"object","description":"The page and the span of the answer it backs.","required":["start_index","end_index","url","title"],"properties":{"start_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span starts.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].url_citation.start_index","typeLabel":"integer\u003cint64>"},"end_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span ends.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].url_citation.end_index","typeLabel":"integer\u003cint64>"},"url":{"type":"string","description":"The address of the page.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].url_citation.url","typeLabel":"string"},"title":{"type":"string","description":"The title of the page.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].url_citation.title","typeLabel":"string"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX].url_citation","typeLabel":"object"}},"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The web pages the answer cites, each sent once. A span counts characters of the whole streamed `content`. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"One citation of a web page, the only kind of annotation an answer carries.","required":["type","url_citation"],"properties":{"type":{"type":"string","description":"Always `url_citation`.","example":"url_citation"},"url_citation":{"type":"object","description":"The page and the span of the answer it backs.","required":["start_index","end_index","url","title"],"properties":{"start_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span starts."},"end_index":{"type":"integer","format":"int64","description":"The character offset in `content` where the cited span ends."},"url":{"type":"string","description":"The address of the page."},"title":{"type":"string","description":"The title of the page."}}}}},"description":"The web pages the answer cites, each sent once. A span counts characters of the whole streamed `content`. A NagaAI extension.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.annotations","typeLabel":"object[] | null"}},"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta","typeLabel":"object"},"finish_reason":{"oneOf":[{"type":"string","description":"Why the model stopped, carried by the last frame alone.","example":"stop","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"string"},{"type":"null","description":"Why the model stopped, carried by the last frame alone.","example":"stop","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason","typeLabel":"string | null"},"logprobs":{"description":"Always `null`, as on a non-streaming choice.","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs","typeLabel":"any"}},"uniqueKey":"oneOf.0.choices.items.[INDEX]","typeLabel":"object"},"description":"What this frame adds — one entry, or none at all on the usage trailer.","isRequired":true,"uniqueKey":"oneOf.0.choices","typeLabel":"object[]"},"usage":{"oneOf":[{"type":"object","description":"What the request cost in tokens. Present on the usage trailer only, and only when it was asked for.","required":["prompt_tokens","completion_tokens","total_tokens","prompt_tokens_details","completion_tokens_details"],"properties":{"prompt_tokens":{"type":"integer","format":"int64","description":"Tokens of the prompt, cached ones included.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens","typeLabel":"integer\u003cint64>"},"completion_tokens":{"type":"integer","format":"int64","description":"Tokens the model generated, reasoning and image tokens included.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The provider's own total for the request, reported as received.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.total_tokens","typeLabel":"integer\u003cint64>"},"prompt_tokens_details":{"type":"object","description":"The split of `prompt_tokens` the provider reported.","required":["cached_tokens"],"properties":{"cached_tokens":{"type":"integer","format":"int64","description":"How many prompt tokens the provider served from its own cache. `0` when it reported none.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cached_tokens","typeLabel":"integer\u003cint64>"},"audio_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens were audio, present only when the provider split them out.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens were audio, present only when the provider split them out.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.audio_tokens","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","description":"The split of `completion_tokens` the provider reported.","required":["reasoning_tokens"],"properties":{"reasoning_tokens":{"type":"integer","format":"int64","description":"How many generated tokens the model spent reasoning. `0` when the provider reported none.","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.reasoning_tokens","typeLabel":"integer\u003cint64>"},"image_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.image_tokens","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.0.usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage","typeLabel":"object | null"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","description":"One frame. The gateway answers a request it does not forward with the second shape, and replaces a frame with the third when the stream fails midway.","required":["id","created","model","choices","usage"],"properties":{"id":{"type":"string","description":"The identifier of the answer these frames belong to, repeated on every frame.","isRequired":true,"uniqueKey":"oneOf.1.id","typeLabel":"string"},"created":{"type":"integer","format":"int64","description":"When the answer was created, in seconds since the Unix epoch.","isRequired":true,"uniqueKey":"oneOf.1.created","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"The model the answer is attributed to, after alias resolution.","isRequired":true,"uniqueKey":"oneOf.1.model","typeLabel":"string"},"choices":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"oneOf.1.choices.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"What this frame adds — one element, matching the answer's single choice.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"What this frame adds — one element, matching the answer's single choice.","isRequired":true,"uniqueKey":"oneOf.1.choices.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.choices","typeLabel":"any[] | null"},"usage":{"oneOf":[{"type":"object","description":"What the answer cost in tokens, `null` on every frame but the trailer.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","format":"int64","description":"Tokens of the prompt, cached ones included.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens","typeLabel":"integer\u003cint64>"},"completion_tokens":{"type":"integer","format":"int64","description":"Tokens of the answer, reasoning and image tokens included.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The provider's own total for the request, never recomputed here.","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0.total_tokens","typeLabel":"integer\u003cint64>"},"prompt_tokens_details":{"oneOf":[{"type":"object","description":"The split of `prompt_tokens`. Absent when the answer reports none.","properties":{"cached_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens the provider served from its own cache.","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens the provider served from its own cache.","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.prompt_tokens_details","typeLabel":"object | null"},"completion_tokens_details":{"oneOf":[{"type":"object","description":"The split of `completion_tokens`. Absent when the answer reports none.","properties":{"image_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many generated tokens were image output. A NagaAI extension.","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0.image_tokens","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.usage.oneOf.0.completion_tokens_details","typeLabel":"object | null"}},"isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.0","typeLabel":"object"},{"type":"null","isRequired":true,"uniqueKey":"oneOf.1.usage.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.1.usage","typeLabel":"object | null"},"object":{"type":"string","description":"What kind of object this is. Always `chat.completion.chunk`.","enum":["chat.completion.chunk"],"uniqueKey":"oneOf.1.object","typeLabel":"enum\u003cstring>"}},"uniqueKey":"oneOf.1","typeLabel":"object"},{"type":"object","description":"One frame. The gateway answers a request it does not forward with the second shape, and replaces a frame with the third when the stream fails midway.","required":["error"],"properties":{"error":{"type":"object","description":"What went wrong.","required":["type","message","code","param"],"properties":{"type":{"type":"string","description":"The class of failure, in the OpenAI error vocabulary — `api_error` for a failure with no more precise class.","isRequired":true,"uniqueKey":"oneOf.2.error.type","typeLabel":"string"},"message":{"type":"string","description":"What went wrong, in prose meant to be read.","isRequired":true,"uniqueKey":"oneOf.2.error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"A machine-readable code for the failure, or `null` when the provider gave none. The key is always present.","isRequired":true,"uniqueKey":"oneOf.2.error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A machine-readable code for the failure, or `null` when the provider gave none. The key is always present.","isRequired":true,"uniqueKey":"oneOf.2.error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, or `null` when it is about none. The key is always present.","isRequired":true,"uniqueKey":"oneOf.2.error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, or `null` when it is about none. The key is always present.","isRequired":true,"uniqueKey":"oneOf.2.error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"oneOf.2.error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.2.error","typeLabel":"object"}},"uniqueKey":"oneOf.2","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","value":{"id":"chatcmpl-6Zq1s8bF2wKcT4mN","object":"chat.completion.chunk","created":1774000000,"model":"anthropic/claude-haiku-5.5","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null,"logprobs":null}]}},"reasoning":{"title":"reasoning","value":{"id":"chatcmpl-7Bd0kR3nQyLpVs","object":"chat.completion.chunk","created":1774000000,"model":"deepseek/deepseek-v4.1-flash","choices":[{"index":0,"delta":{"reasoning_content":"2 plus 2","reasoning_details":[{"type":"reasoning.text","index":0,"id":"reasoning-text-0","text":"2 plus 2"}]},"finish_reason":null,"logprobs":null}]}},"tool-call":{"title":"tool-call","value":{"id":"chatcmpl-5Nf2wXcH8tZrKm","object":"chat.completion.chunk","created":1774000000,"model":"anthropic/claude-sonnet-5.5","choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_abc123","type":"function","function":{"name":"get_weather","arguments":""}}]},"finish_reason":null,"logprobs":null}]}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"1ba268e9-725a-4d5d-8c12-703055e9ccbb":{"description":"The request is malformed: a field failed its constraint, the body is not valid JSON, or the model name is unknown.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"ae4b6fff-acd5-4df5-afc8-cb26d52b988b":{"description":"The API key is missing, malformed, disabled, or does not belong to an account that may call this route.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invalid-api-key":{"title":"invalid-api-key","value":{"error":{"type":"invalid_api_key","message":"The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"4748995e-8925-4ed2-9b7d-1eca83626bfd":{"description":"The account has run out of credits. Top up the balance and retry.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"insufficient-credits":{"title":"insufficient-credits","value":{"error":{"type":"insufficient_quota","message":"More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"4b37fd53-4175-4d48-b582-fdf7ae2fac2f":{"description":"The model policy of the organization or of the key's workspace does not allow this model, a spending limit is reached, or the content was blocked by the moderation policy.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"5bc3276a-c5bf-470c-ae91-b069ba1823c6":{"description":"The upstream provider reports that the addressed resource does not exist.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"7c9866ed-a205-4f0a-af10-4e0b998b40b6":{"description":"The request body did not finish arriving within 15 minutes, or stalled for 60 seconds.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"cc91eb86-2bfe-4169-b004-dcc207f936c0":{"description":"The model is deprecated and no longer served. Pick a current one.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"93a18413-f7f7-426f-be48-e357704f2787":{"description":"The request body is larger than the 32 MiB this gateway accepts.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"3caca85b-67a9-4a3f-8c1a-714597431460":{"description":"The request was understood but its usage could not be metered, so it was not served.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"cab9ee2f-6fff-4417-a95f-c3baf21393fe":{"description":"The account exceeded its rate limit. `Retry-After` carries the wait in seconds.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rate-limited":{"title":"rate-limited","value":{"error":{"type":"rate_limit_exceeded","message":"Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."}}}},"exampleType":"examples"}},"x-retry-safe":true,"exampleType":"examples"},"771bc07d-5945-4710-98d9-67da926d3f58":{"description":"The gateway failed for a reason of its own. Report it — this status marks NagaAI's own bugs, never an upstream verdict.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"24154ffc-7f7b-4669-ac75-275f8f61c0f9":{"description":"No upstream is available, or the gateway is shedding load. `Retry-After` carries the suggested wait.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"}},"security":{"cc849358-6a14-4419-8fc7-56a691bea547":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"}},"68c9bf1a-807e-4fc5-bbde-8057060f816b":{"xApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"}}},"servers":{"42fb540d-6e7f-41a7-a1b9-5a3fbd325768":{"url":"https://api.naga.ac","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"xApiKeyAuth","name":"x-api-key"}],"title":"xApiKeyAuth"}]},"originalFileLocation":"openapi/naga-api.json"},"subdomain":"nagaai-60f8697b","siteName":"NagaAI Documentation","title":"Create a chat completion - NagaAI Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-12T21:32:14.616Z","originalFileLocation":"api-reference/chat-completions/create-a-chat-completion.mdx"},"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=\"description\" content=\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a chat completion - NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Chat+Completions\u0026amp;title=Create+a+chat+completion\u0026amp;description=Creates+a+model+response+in+the+OpenAI+Chat+Completions+dialect+and+charges+the+account+for+the+tokens+it+used.+Requires+an+API+key.+%60%2Fv1%2Fresponses%60+and+%60%2Fv1%2Fme\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=9b0243dbe4a291e0f8693c451148fa45f366512664c1ed0bb8ade2cbf666295d\">\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 - NagaAI Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Chat+Completions\u0026amp;title=Create+a+chat+completion\u0026amp;description=Creates+a+model+response+in+the+OpenAI+Chat+Completions+dialect+and+charges+the+account+for+the+tokens+it+used.+Requires+an+API+key.+%60%2Fv1%2Fresponses%60+and+%60%2Fv1%2Fme\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=9b0243dbe4a291e0f8693c451148fa45f366512664c1ed0bb8ade2cbf666295d\">\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/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5a5ae5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/chat-completions/create-a-chat-completion.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.naga.ac/#organization\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.naga.ac#website\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion#webpage\",\"url\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion\",\"name\":\"Create a chat completion\",\"description\":\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.\",\"dateModified\":\"2026-11-12T21:32:14.616Z\",\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"},\"breadcrumb\":{\"@id\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.naga.ac/api-reference/responses/create-a-response\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a chat completion\",\"item\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion#apireference\",\"headline\":\"Create a chat completion\",\"name\":\"Create a chat completion\",\"description\":\"Creates a model response in the OpenAI Chat Completions dialect and charges the account for the tokens it used. Requires an API key. /v1/responses and /v1/messages serve the same models in the other two dialects.\",\"url\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion\",\"mainEntityOfPage\":{\"@id\":\"https://docs.naga.ac/api-reference/chat-completions/create-a-chat-completion#webpage\"},\"dateModified\":\"2026-11-12T21:32:14.616Z\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NagaAI Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"NagaAI Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/chat-completions/create-a-chat-completion.md","siteName":"NagaAI Documentation","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/get-started/quickstart"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API reference","sidebarTitle":"Overview","icon":"book","href":"/api-reference/overview"}]},{"group":"Endpoints","pages":[{"group":"Responses","expanded":false,"pages":[{"title":"Create a response","description":"Creates a model response in the OpenAI Responses dialect and charges the account for the tokens it used. Requires an API key. `/v1/chat/completions` and `/v1/messages` serve the same models in the other two dialects.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/responses","href":"/api-reference/responses/create-a-response"}]},{"group":"Chat Completions","expanded":false,"pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion"}]},{"group":"Messages","expanded":false,"pages":[{"title":"Create a message","description":"Creates a model response in the Anthropic Messages dialect and charges the account for the tokens it used. Requires an API key. `/v1/chat/completions` and `/v1/responses` serve the same models in the other two dialects.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/messages","href":"/api-reference/messages/create-a-message"}]},{"group":"Models","expanded":false,"pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/models","href":"/api-reference/models/list-models"}]},{"group":"Startups","expanded":false,"pages":[{"title":"List startups","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/startups","href":"/api-reference/startups/list-startups"}]},{"group":"Embeddings","expanded":false,"pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Moderations","expanded":false,"pages":[{"title":"Classify content","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/moderations","href":"/api-reference/moderations/classify-content"}]},{"group":"Audio","expanded":false,"pages":[{"title":"Create speech","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/speech","href":"/api-reference/audio/create-speech"},{"title":"Create a transcription","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/transcriptions","href":"/api-reference/audio/create-a-transcription"},{"title":"Create a translation","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/translations","href":"/api-reference/audio/create-a-translation"}]},{"group":"Images","expanded":false,"pages":[{"title":"Create an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image"},{"title":"Edit an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/edits","href":"/api-reference/images/edit-an-image"}]},{"group":"Videos","expanded":false,"pages":[{"title":"Create a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/videos","href":"/api-reference/videos/create-a-video"},{"title":"Get a video job","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}","href":"/api-reference/videos/get-a-video-job"},{"title":"Download a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}/content","href":"/api-reference/videos/download-a-video"}]},{"group":"Requests","expanded":false,"pages":[{"title":"Get a request","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/requests/{id}","href":"/api-reference/requests/get-a-request"}]},{"group":"Account","expanded":false,"pages":[{"title":"Get the account balance","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/balance","href":"/api-reference/account/get-the-account-balance"},{"title":"Get account activity","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/activity","href":"/api-reference/account/get-account-activity"},{"group":"API Keys","expanded":false,"pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/account/keys","href":"/api-reference/api-keys/create-an-api-key"},{"title":"Get an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys/{key_id}","href":"/api-reference/api-keys/get-an-api-key"},{"title":"Update an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json patch /v1/account/keys/{key_id}","href":"/api-reference/api-keys/update-an-api-key"},{"title":"Delete an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json delete /v1/account/keys/{key_id}","href":"/api-reference/api-keys/delete-an-api-key"}]}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/agents/claude-code"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Create a chat completion - NagaAI Documentation","buildId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","deploymentId":"dpl_8hoxaqFTU7hTr6A2fUraxAyjuiZo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CDiBsYGW.js","utils-KF9rPlmF.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C26urKTX.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BdjmJAC1.js","snippetPresets-3IpDBjt3.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-D4x_2vvo.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BIWdc5Pa.js","shallow-LQqfiMNd.js","getApiPlaygroundDisplay-DryzlOZG.js","CodeSnippet-tcJujU4r.js","CodeSnippets-BHp0nVLL.js","Page-1CZdsdAn.js","getPastedJson-DU-1ayUv.js","icon-CZK2hPr4.js","MethodPill-DOaqmTFC.js","DuplicateIcon-B5-nUxxl.js","createIcon-CDP_U77G.js","DynamicMarkdown-GHvayGOn.js","SectionHeading-BYvpkmUD.js","axios-vUo_bRtp.js","Markdown-uxhlayGT.js","clsx-B35qUV0p.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BvrGG8gU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CAf0yVYe.js"]}