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."
}
]
}'
An account API key. Send it as Authorization: Bearer <key>.
Headers
x-naga-routing-strategy
enum<string>
The routing strategy when the body names none. An unknown name is ignored. A NagaAI extension.
The order in which NagaAI tries providers at the same price: reliability best recent success rate, balanced speed among near-best success, latency first token, throughput tokens per second, cache providers that read a cached prefix. 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.
model
string
required
The model to run, named by an id or alias from NagaAI's catalog. An entry without the chat.completions capability draws a refusal.
messages
object[]
required
The conversation so far, oldest first; one entry at least.
Minimum array length: 1
Hide child attributes
messages.role
string
required
Who the message is from.
messages.content
List of content parts · object[]string
The contents of the message. Optional only on an assistant message.
One entry of a message's content. The role decides which kinds it admits.
Option 1
Option 2
Option 3
Option 4
Option 5
Hide child attributes
messages.content.text
string
required
The text of this part.
messages.content.type
enum<string>
required
The tag that selects this branch: type is text.
Available options:
text
messages.content.cache_control
object | null
A prompt-cache breakpoint: cache the prompt up to and including this part. A NagaAI extension in OpenRouter's shape.
Hide child attributes
messages.content.cache_control.type
enum<string>
required
Always ephemeral.
Available options:
ephemeral
messages.content.cache_control.ttl
enum<string> | null
5m or 1h. Absent means 5m.
Available options:
5m,
1h
messages.images
object[] | null
Image references carried beside content. A NagaAI extension.
Hide child attributes
messages.images.image_url
object
required
The image reference and its detail level.
Hide child attributes
messages.images.image_url.url
string
required
Where the image lives: an http(s) URL, or a data: URI under 20 MiB.
messages.images.image_url.detail
enum<string>
default:auto
How much detail to spend on this image.
Available options:
low,
high,
auto
messages.images.type
enum<string>
required
The tag that selects this branch: type is image_url.
Available options:
image_url
messages.images.signature
string | null
The token that continues this image on a later turn.
messages.images.format
string | null
Which vocabulary the token is written in.
messages.reasoning_details
object[] | null
Reasoning items of an earlier assistant turn, echoed back. A NagaAI extension that wins over reasoning_content.
One entry of a message's reasoning_details. A NagaAI extension.
Option 1
Option 2
Option 3
Hide child attributes
messages.reasoning_details.summary
string
required
The recap text.
messages.reasoning_details.type
enum<string>
required
The tag that selects this branch: type is reasoning.summary.
Available options:
reasoning.summary
messages.reasoning_details.id
string | null
An identifier travelling with the entry, never routed onto a tool call.
messages.reasoning_details.format
string | null
Which model family's reasoning dialect produced the entry, as an open string.
messages.reasoning_details.index
integer<int64> | null
Where the entry sits among the turn's reasoning entries. Answers only.
messages.reasoning_content
string | null
The plain-text reasoning of an earlier assistant turn. A NagaAI extension.
messages.reasoning
string | null
An alias of reasoning_content, read last of the three.
messages.name
string | null
A name for the participant. The gateway drops it.
messages.tool_call_id
string | null
On a tool message, the id of the call it answers. Required there.
messages.tool_calls
any[] | null
The tool calls an assistant made, echoed back so results can follow.
messages.function_call
object | null
The singular call that preceded tool_calls. An assistant message carrying it draws a refusal.
Hide child attributes
messages.function_call.{key}
any
routing
object
How NagaAI picks the providers for this request: strategy reorders them, max_price removes the dearer ones and can fail the request. A NagaAI extension.
Hide child attributes
routing.strategy
enum<string>
Which provider NagaAI tries first among those at the same price. Absent: the x-naga-routing-strategy header, the key's default, the workspace's, else NagaAI's choice.
Available options:
reliability,
balanced,
latency,
throughput,
cache
routing.max_price
object
The most one unit of each named meter may cost. Absent: no price limit.
Hide child attributes
routing.max_price.token
stringnumber
Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.input_token
stringnumber
Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.output_token
stringnumber
Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.cached_input_token
stringnumber
Credits per prompt token read from cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_input_token
stringnumber
Credits per prompt token written to cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_1h_input_token
stringnumber
Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.
routing.max_price.input_text_token
stringnumber
Credits per prompt text token. A non-negative decimal, as a string or a number.
routing.max_price.output_text_token
stringnumber
Credits per output text token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_token
stringnumber
Credits per input audio token. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_token
stringnumber
Credits per output audio token. A non-negative decimal, as a string or a number.
routing.max_price.input_image_token
stringnumber
Credits per input image token. A non-negative decimal, as a string or a number.
routing.max_price.output_image_token
stringnumber
Credits per output image token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_hour
stringnumber
Credits per hour of input audio. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_hour
stringnumber
Credits per hour of output audio. A non-negative decimal, as a string or a number.
routing.max_price.input_text_character
stringnumber
Credits per input text character. A non-negative decimal, as a string or a number.
routing.max_price.output_text_character
stringnumber
Credits per output text character. A non-negative decimal, as a string or a number.
routing.max_price.input_text_search
stringnumber
Credits per rerank search. A non-negative decimal, as a string or a number.
routing.max_price.output_image_image
stringnumber
Credits per delivered picture. A non-negative decimal, as a string or a number.
routing.max_price.request
stringnumber
Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.
routing.max_price.output_video_second
stringnumber
Credits per second of video. A non-negative decimal, as a string or a number.
routing.max_price.output_video_megapixel_second
stringnumber
Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.
Example:
{ "output_token": "0.000005" }
routing.precision
enum<string>[]
The weight precisions the model may be served in. Absent: any.
Minimum array length: 1
A weight precision a provider serves a model in, as it publishes it.
Available options:
int4,
int8,
fp4,
mxfp4,
nvfp4,
fp6,
fp8,
mxfp8,
fp16,
bf16,
fp32
service_tier
enum<string>
flex sends the request only to providers at the model's base price in GET /v1/models, and fails it when none can serve it. Any other value, an unknown one included, or none: any provider, at its price.
Available options:
auto,
default,
flex,
scale,
priority
models
string[] | null
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.
Maximum array length: 3
tools
object[] | null
The tools the model is allowed to call.
One entry of tools[], told apart by type.
Option 1
Option 2
Hide child attributes
tools.function
object
required
The declaration itself — name, description and parameter schema.
Hide child attributes
tools.function.name
string
required
The name the model calls the function by, never empty.
tools.function.description
string | null
What the function does, written for the model to choose by.
tools.function.parameters
object | null
The arguments the function accepts, as a JSON Schema, compiled at intake.
Hide child attributes
tools.function.parameters.{key}
any
tools.function.strict
boolean | null
Whether the model follows parameters exactly when filling the arguments.
tools.type
enum<string>
required
The tag that selects this branch: type is function.
Available options:
function
functions
any[] | null
The pre-tools function-calling surface. A request carrying it draws a refusal.
tool_choice
objectstring
Which tool, if any, the model calls. An explicit null draws a refusal.
Hide child attributes
tool_choice.{key}
any
response_format
object
The shape the model's output must take.
Option 1
Option 2
Option 3
Hide child attributes
response_format.type
enum<string>
required
The tag that selects this branch: type is text.
Available options:
text
temperature
number<double> | null
How much randomness goes into the reply, between 0 and 2, and an alternative to top_p.
Required range: 0 <= x <= 2
top_p
number<double> | null
The sampling cut-off, between 0 and 1, and an alternative to temperature.
Required range: 0 <= x <= 1
stream
boolean | null
Whether the reply arrives incrementally as the model writes it.
stream_options
object | null
Extra streaming behavior. include_usage adds one trailing chunk carrying the totals.
Hide child attributes
stream_options.include_usage
boolean
Whether one extra chunk carrying the request's token totals closes the stream.
stop
string[]string
Strings that end generation the moment the model produces one.
max_completion_tokens
integer<int64> | null
The ceiling on generated tokens, reasoning included. At least 1.
Required range: x >= 1
max_tokens
integer<int64> | null
An alias of max_completion_tokens, read only when that key is absent.
Required range: x >= 1
reasoning_effort
enum<string> | null
How much reasoning to spend before answering, from none to max. A model without the level runs the nearest one it has.
Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
presence_penalty
number<double> | null
How hard a token is penalized for having appeared, from -2 to 2.
Required range: -2 <= x <= 2
frequency_penalty
number<double> | null
How hard repetition is penalized, scaled by how often, from -2 to 2.
Required range: -2 <= x <= 2
parallel_tool_calls
boolean | null
Whether the model may return several tool calls in one turn.
web_search_options
object | null
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.
Hide child attributes
web_search_options.search_context_size
enum<string> | null
How much search context goes in front of the model.
Available options:
low,
medium,
high
web_search_options.user_location
object | null
Roughly where the caller is, so results can favor that place.
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
cache_control
object | null
Automatic prompt caching: one breakpoint on the last part that can be cached, moving forward as the conversation grows. A NagaAI extension in OpenRouter's shape.
Hide child attributes
cache_control.type
enum<string>
required
Always ephemeral.
Available options:
ephemeral
cache_control.ttl
enum<string> | null
5m or 1h. Absent means 5m.
Available options:
5m,
1h
prompt_cache_key
string | null
Groups requests that share a prompt prefix, so they reach the same prompt cache. At most 64 characters. NagaAI passes it to the providers that document it and drops it at the rest.
Maximum string length: 64
prompt_cache_retention
enum<string> | null
How long OpenAI keeps the cached prefix on models before GPT-5.6: in_memory or 24h. NagaAI drops a value the model does not take, and drops the field at providers that do not document it.
Available options:
in_memory,
24h
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.
id
string
required
This answer's identifier, repeated on every frame of a stream.
object
string
required
What kind of object this is. Always chat.completion.
Example:
"chat.completion"
created
integer<int64>
required
When the answer was created, in seconds since the Unix epoch.
model
string
required
The model that answered, by its id in the NagaAI catalog.
choices
object[]
required
The answers the model produced — one entry, see index.
Hide child attributes
choices.index
integer<int64>
required
This answer's position in choices[]. Always 0.
choices.message
object
required
The message the model produced.
Hide child attributes
choices.message.role
string
required
Who wrote the message. Always assistant.
Example:
"assistant"
choices.message.content
string | null
required
The text the model returned, or null when the turn produced none.
choices.message.refusal
string | null
required
The reason the model gave for declining, or null.
choices.message.reasoning_content
string | null
The model's reasoning as plain text. A NagaAI extension mirroring the first reasoning item only.
choices.message.reasoning_details
any[] | null
The turn's reasoning as structured entries, in the order the model produced them. A NagaAI extension.
choices.message.tool_calls
object[] | null
The tool calls the model made, absent when it made none.
Hide child attributes
choices.message.tool_calls.id
string
required
The call's id, repeated as tool_call_id on the answering message.
choices.message.tool_calls.type
string
required
What kind of call this is. Always function.
Example:
"function"
choices.message.tool_calls.function
object
required
Which function to call, and with what arguments.
Hide child attributes
choices.message.tool_calls.function.name
string
required
The name of the function to call, as declared in tools[].
choices.message.tool_calls.function.arguments
string
required
The arguments to call the function with, as JSON in a string. Valid JSON is not guaranteed.
choices.message.images
object[] | null
The images the model generated. A NagaAI extension.
Hide child attributes
choices.message.images.type
string
required
What kind of entry this is. Always image_url.
Example:
"image_url"
choices.message.images.image_url
object
required
Where to read the image.
Hide child attributes
choices.message.images.image_url.url
string
required
Where the image lives: a data: URI when the provider returned bytes, its own URL when it returned a link.
choices.message.images.signature
string | null
The token that continues this image on a later turn.
choices.message.images.format
string | null
Which vocabulary the token is written in.
choices.message.annotations
object[] | null
The web pages the answer cites, each with the span of content it backs. Absent when the answer cites none.
The character offset in content where the cited span ends.
choices.message.annotations.url_citation.url
string
required
The address of the page.
choices.message.annotations.url_citation.title
string
required
The title of the page.
choices.finish_reason
string
required
Why the model stopped, in one of four values.
Example:
"stop"
choices.logprobs
any
required
Always null. The gateway returns no token log probabilities.
usage
object | null
What the request cost in tokens, absent when the provider reported none.
Hide child attributes
usage.prompt_tokens
integer<int64>
required
Tokens of the prompt, cached ones included.
usage.completion_tokens
integer<int64>
required
Tokens the model generated, reasoning and image tokens included.
usage.total_tokens
integer<int64>
required
The provider's own total for the request, reported as received.
usage.prompt_tokens_details
object
required
The split of prompt_tokens the provider reported.
Hide child attributes
usage.prompt_tokens_details.cached_tokens
integer<int64>
required
How many prompt tokens the provider served from its own cache. 0 when it reported none.
usage.prompt_tokens_details.audio_tokens
integer<int64> | null
How many prompt tokens were audio, present only when the provider split them out.
usage.prompt_tokens_details.cache_write_tokens
integer<int64> | null
How many prompt tokens were written to the provider's cache, billed at the cache-write rate. Counted inside prompt_tokens; present only when the request wrote to the cache.
usage.completion_tokens_details
object
required
The split of completion_tokens the provider reported.
Hide child attributes
usage.completion_tokens_details.reasoning_tokens
integer<int64>
required
How many generated tokens the model spent reasoning. 0 when the provider reported none.
usage.completion_tokens_details.image_tokens
integer<int64> | null
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":"Blog","href":"https://naga.ac/blog"},{"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":"6afff8e862a3bc10271d2724","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"Docs","count":35},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Guides","count":17},{"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":"site-roles","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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","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":["d7ba6b65-b191-4f55-94b6-2c83560a4e30"],"requestBody":"1929a304-9066-4663-ad3c-ccd40d08376d","responses":{"200":"98f1fecf-5fda-40ad-8865-f23e2246309f","400":"1593cd4a-3e33-4ff0-87ae-ed1c2c054ebe","401":"8d74680d-a49c-432b-8e3e-5808121260fd","402":"ed118ebc-ef68-4184-82ed-9ee1076eb35f","403":"70d343b7-49c0-4519-9360-d4cd4e9c4961","404":"3d9a1766-ba4c-4cf4-9f72-76ba7b7b43c1","408":"13371e8b-b277-4b2c-b4d7-9288f704d8bb","410":"310f11b7-38d3-4277-a350-d50d790e326c","413":"d5057e96-7485-4508-8328-bd2da6397a40","422":"0c46a493-60c6-4e07-89b9-5fc2255eabdd","429":"b60eae06-b620-4a53-819d-58a98d358509","500":"5832187f-ae1e-487b-9fc1-bbcd04428849","503":"16fadfb3-ae77-47c2-8ff2-460913523c1e"},"security":["b51aaff5-a4cb-4009-91db-75e5aa162e57","d3a463cb-fd46-4fcb-b79d-10f109e93042"],"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":["ddee1100-762b-4028-ac39-d54cdb9aa21e"],"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":{"d7ba6b65-b191-4f55-94b6-2c83560a4e30":{"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 providers at the same price: `reliability` best recent success rate, `balanced` speed among near-best success, `latency` first token, `throughput` tokens per second, `cache` providers that read a cached prefix. 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>"},"cache_control":{"oneOf":[{"type":"object","description":"A prompt-cache breakpoint: cache the prompt up to and including this part. A NagaAI extension in OpenRouter's shape.","required":["type"],"properties":{"type":{"type":"string","description":"Always `ephemeral`.","enum":["ephemeral"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.0.type","typeLabel":"enum\u003cstring>"},"ttl":{"oneOf":[{"type":"string","description":"`5m` or `1h`. Absent means `5m`.","enum":["5m","1h"],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.0.ttl.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.0.ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.0.ttl","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.0.cache_control","typeLabel":"object | null"}},"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>"},"cache_control":{"oneOf":[{"type":"object","description":"A prompt-cache breakpoint: cache the prompt up to and including this part. A NagaAI extension in OpenRouter's shape.","required":["type"],"properties":{"type":{"type":"string","description":"Always `ephemeral`.","enum":["ephemeral"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.0.type","typeLabel":"enum\u003cstring>"},"ttl":{"oneOf":[{"type":"string","description":"`5m` or `1h`. Absent means `5m`.","enum":["5m","1h"],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.0.ttl.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.0.ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.0.ttl","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.1.cache_control","typeLabel":"object | null"}},"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>"},"cache_control":{"oneOf":[{"type":"object","description":"A prompt-cache breakpoint: cache the prompt up to and including this part. A NagaAI extension in OpenRouter's shape.","required":["type"],"properties":{"type":{"type":"string","description":"Always `ephemeral`.","enum":["ephemeral"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.0.type","typeLabel":"enum\u003cstring>"},"ttl":{"oneOf":[{"type":"string","description":"`5m` or `1h`. Absent means `5m`.","enum":["5m","1h"],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.0.ttl.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.0.ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.0.ttl","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.0.items.[INDEX].oneOf.2.cache_control","typeLabel":"object | null"}},"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":{"type":"object","description":"How NagaAI picks the providers for this request: `strategy` reorders them, `max_price` removes the dearer ones and can fail the request. A NagaAI extension.","properties":{"strategy":{"type":"string","description":"Which provider NagaAI tries first among those at the same price. Absent: the `x-naga-routing-strategy` header, the key's default, the workspace's, else NagaAI's choice.","enum":["reliability","balanced","latency","throughput","cache"],"uniqueKey":"routing.strategy","typeLabel":"enum\u003cstring>"},"max_price":{"type":"object","description":"The most one unit of each named meter may cost. Absent: no price limit.","example":{"output_token":"0.000005"},"properties":{"token":{"oneOf":[{"type":"string","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.token","typeLabel":"string | number"},"input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_token","typeLabel":"string | number"},"output_token":{"oneOf":[{"type":"string","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_token","typeLabel":"string | number"},"cached_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cached_input_token","typeLabel":"string | number"},"cache_write_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_input_token","typeLabel":"string | number"},"cache_write_1h_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_1h_input_token","typeLabel":"string | number"},"input_text_token":{"oneOf":[{"type":"string","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_token","typeLabel":"string | number"},"output_text_token":{"oneOf":[{"type":"string","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_token","typeLabel":"string | number"},"input_audio_token":{"oneOf":[{"type":"string","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_token","typeLabel":"string | number"},"output_audio_token":{"oneOf":[{"type":"string","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_token","typeLabel":"string | number"},"input_image_token":{"oneOf":[{"type":"string","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_image_token","typeLabel":"string | number"},"output_image_token":{"oneOf":[{"type":"string","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_token","typeLabel":"string | number"},"input_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_hour","typeLabel":"string | number"},"output_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_hour","typeLabel":"string | number"},"input_text_character":{"oneOf":[{"type":"string","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_character","typeLabel":"string | number"},"output_text_character":{"oneOf":[{"type":"string","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_character","typeLabel":"string | number"},"input_text_search":{"oneOf":[{"type":"string","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_search","typeLabel":"string | number"},"output_image_image":{"oneOf":[{"type":"string","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_image","typeLabel":"string | number"},"request":{"oneOf":[{"type":"string","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.request","typeLabel":"string | number"},"output_video_second":{"oneOf":[{"type":"string","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_second","typeLabel":"string | number"},"output_video_megapixel_second":{"oneOf":[{"type":"string","description":"Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per megapixel-second of upscaled video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_megapixel_second","typeLabel":"string | number"}},"additionalProperties":false,"uniqueKey":"routing.max_price","typeLabel":"object"},"precision":{"type":"array","items":{"type":"string","description":"A weight precision a provider serves a model in, as it publishes it.","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32"],"uniqueKey":"routing.precision.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"The weight precisions the model may be served in. Absent: any.","minItems":1,"uniqueKey":"routing.precision","typeLabel":"enum\u003cstring>[]"}},"additionalProperties":false,"uniqueKey":"routing","typeLabel":"object"},"service_tier":{"type":"string","description":"`flex` sends the request only to providers at the model's base `price` in `GET /v1/models`, and fails it when none can serve it. Any other value, an unknown one included, or none: any provider, at its price.","enum":["auto","default","flex","scale","priority"],"uniqueKey":"service_tier","typeLabel":"enum\u003cstring>"},"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"},"cache_control":{"oneOf":[{"type":"object","description":"Automatic prompt caching: one breakpoint on the last part that can be cached, moving forward as the conversation grows. A NagaAI extension in OpenRouter's shape.","required":["type"],"properties":{"type":{"type":"string","description":"Always `ephemeral`.","enum":["ephemeral"],"isRequired":true,"uniqueKey":"cache_control.oneOf.0.type","typeLabel":"enum\u003cstring>"},"ttl":{"oneOf":[{"type":"string","description":"`5m` or `1h`. Absent means `5m`.","enum":["5m","1h"],"uniqueKey":"cache_control.oneOf.0.ttl.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"cache_control.oneOf.0.ttl.oneOf.1","typeLabel":"null"}],"uniqueKey":"cache_control.oneOf.0.ttl","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"cache_control.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"cache_control.oneOf.1","typeLabel":"null"}],"uniqueKey":"cache_control","typeLabel":"object | null"},"prompt_cache_key":{"oneOf":[{"type":"string","description":"Groups requests that share a prompt prefix, so they reach the same prompt cache. At most 64 characters. NagaAI passes it to the providers that document it and drops it at the rest.","maxLength":64,"uniqueKey":"prompt_cache_key.oneOf.0","typeLabel":"string"},{"type":"null","description":"Groups requests that share a prompt prefix, so they reach the same prompt cache. At most 64 characters. NagaAI passes it to the providers that document it and drops it at the rest.","maxLength":64,"uniqueKey":"prompt_cache_key.oneOf.1","typeLabel":"null"}],"uniqueKey":"prompt_cache_key","typeLabel":"string | null"},"prompt_cache_retention":{"oneOf":[{"type":"string","description":"How long OpenAI keeps the cached prefix on models before GPT-5.6: `in_memory` or `24h`. NagaAI drops a value the model does not take, and drops the field at providers that do not document it.","enum":["in_memory","24h"],"uniqueKey":"prompt_cache_retention.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"prompt_cache_retention.oneOf.1","typeLabel":"null"}],"uniqueKey":"prompt_cache_retention","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"A plain completion","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","summary":"Ask a reasoning model to think first","value":{"model":"deepseek/deepseek-v4.1-flash","messages":[{"role":"user","content":"What is 2+2?"}],"reasoning_effort":"medium"}},"streaming":{"title":"streaming","summary":"Stream the answer, with a usage trailer","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","summary":"Offer the model a function to 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":{"98f1fecf-5fda-40ad-8865-f23e2246309f":{"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"},"cache_write_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens were written to the provider's cache, billed at the cache-write rate. Counted inside `prompt_tokens`; present only when the request wrote to the cache.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens were written to the provider's cache, billed at the cache-write rate. Counted inside `prompt_tokens`; present only when the request wrote to the cache.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_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","summary":"One `chat.completion` object","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","summary":"The thinking arrives beside the answer","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","summary":"The model asked for a function instead of answering","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"},"cache_write_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"How many prompt tokens were written to the provider's cache, billed at the cache-write rate. Counted inside `prompt_tokens`; present only when the request wrote to the cache.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many prompt tokens were written to the provider's cache, billed at the cache-write rate. Counted inside `prompt_tokens`; present only when the request wrote to the cache.","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.cache_write_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","summary":"One `data:` line of a streamed answer","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","summary":"A frame carrying reasoning, before any content","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","summary":"A frame opening a tool call; arguments arrive in later frames","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"},"1593cd4a-3e33-4ff0-87ae-ed1c2c054ebe":{"description":"The request is malformed: a field failed its constraint, the body is not valid JSON, the model name is unknown, or no provider serves it within its price limit.","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"},"8d74680d-a49c-432b-8e3e-5808121260fd":{"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","summary":"401 — the key is not one this gateway serves","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"},"ed118ebc-ef68-4184-82ed-9ee1076eb35f":{"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","summary":"402 — the account has no credits left","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"},"70d343b7-49c0-4519-9360-d4cd4e9c4961":{"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"},"3d9a1766-ba4c-4cf4-9f72-76ba7b7b43c1":{"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"},"13371e8b-b277-4b2c-b4d7-9288f704d8bb":{"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"},"310f11b7-38d3-4277-a350-d50d790e326c":{"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"},"d5057e96-7485-4508-8328-bd2da6397a40":{"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"},"0c46a493-60c6-4e07-89b9-5fc2255eabdd":{"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"},"b60eae06-b620-4a53-819d-58a98d358509":{"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","summary":"429 — too many requests; `Retry-After` carries the wait","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"},"5832187f-ae1e-487b-9fc1-bbcd04428849":{"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"},"16fadfb3-ae77-47c2-8ff2-460913523c1e":{"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":{"b51aaff5-a4cb-4009-91db-75e5aa162e57":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"}},"d3a463cb-fd46-4fcb-b79d-10f109e93042":{"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":{"ddee1100-762b-4028-ac39-d54cdb9aa21e":{"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-19T16:54:45.225Z","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-19T16:54:45.225Z\",\"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-19T16:54:45.225Z\",\"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":"Rerank","expanded":false,"pages":[{"title":"Rerank documents","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents"}]},{"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","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js","Markdown-CK5C-fmV.js","AssistantPageLink-Cw134Dd-.js","dist-3xM3Qrc7.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}