curl https://api.vachana.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "X-API-Key-ID: $GNANI_API_KEY" \ -d '{ "model": "evon-v3.5", "messages": [ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"} ], "temperature": 0.3, "max_tokens": 512, "reasoning_effort": "none" }'
{ "id": "chatcmpl-6b1f4f0c2a5e4d8b", "object": "chat.completion", "created": 1794390000, "model": "evon-v3.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of Karnataka is Bengaluru." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 41, "completion_tokens": 9, "total_tokens": 50 }}
LLM
Chat Completions
Generate the next message in a conversation. OpenAI-compatible, with or without streaming.
POST
/
v1
/
chat
/
completions
curl https://api.vachana.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "X-API-Key-ID: $GNANI_API_KEY" \ -d '{ "model": "evon-v3.5", "messages": [ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"} ], "temperature": 0.3, "max_tokens": 512, "reasoning_effort": "none" }'
{ "id": "chatcmpl-6b1f4f0c2a5e4d8b", "object": "chat.completion", "created": 1794390000, "model": "evon-v3.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of Karnataka is Bengaluru." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 41, "completion_tokens": 9, "total_tokens": 50 }}
Early accessGnani Evon v3.5 is now available as an API to early access registrants.
Overview
Send a conversation and get the model’s next message. The call is stateless: nothing is stored between requests, so messages must hold the whole conversation every time.The request and response follow OpenAI’s Chat Completions API. New to the API? Start with the Overview.
Endpoint
POST https://api.vachana.ai/v1/chat/completionsContent-Type: application/json
Authentication
Send your API key in one of these headers. If you send both, X-API-Key-ID is used.
Header
Required
Description
X-API-Key-ID
One of the two
Your Gnani API key.
Authorization
One of the two
Bearer <your-api-key>. This is what OpenAI’s SDKs send.
X-API-Request-ID
No
Your own ID for the request. It is returned in the X-API-Request-ID response header. If you leave it out, one is generated.
Request body
{ "model": "evon-v3.5", "messages": [ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"} ], "temperature": 0.6, "max_tokens": 512, "reasoning_effort": "none"}
Only messages is required. Every other field has a default.Every value is checked before the model runs. A value of the wrong type or out of range is refused with 400 invalid_request, and the message names the field, for example temperature must be between 0 and 2, got -1. Sending null for a field means “use the default”. A field name the API does not know is refused with 400 unknown_parameter, so a typo does not pass silently. A few OpenAI fields that Gnani does not use, such as logprobs and store, are accepted and ignored. See Migrating from OpenAI.
Parameters at a glance
Every request field, with its allowed values. Full descriptions and the playground are in the generated parameter list on this page. A value outside its range is refused with 400 invalid_request.
Parameter
Type
Range or options
Default
Purpose
model
string
evon-v3.5 only. Any other value returns 404 model_not_found.
evon-v3.5
The model to use.
messages
object[]
At least 1 message. role: system, developer, user, assistant or tool.
required
The conversation so far, oldest first.
stream
boolean
true, false
false
Stream the reply as Server-Sent Events. See Streaming.
stream_options
object
include_usage: true or false (default false). Only with "stream": true.
Adds a last chunk with token usage.
max_tokens
integer
1 to your plan’s maximum: 1,024 on Free and Pay-as-you-go; on Enterprise, up to the context window less the input.
1,024 on Free and Pay-as-you-go
Most tokens in the reply, thinking included. See Limits.
max_completion_tokens
integer
Same as max_tokens
Another name for max_tokens.
temperature
number
0 to 2
0.6
How random the reply is. Lower is more focused.
top_p
number
Above 0, up to 1
0.95
Nucleus sampling.
stop
string | string[]
One string, or up to 4 strings. Each at least 1 character.
Stop sequences.
seed
integer
Any integer
Makes sampling repeatable, not guaranteed.
frequency_penalty
number
-2 to 2
0
Discourages repeating the same words.
presence_penalty
number
-2 to 2
0
Encourages new topics.
reasoning_effort
string
none, minimal, low, medium, high
none turns thinking off. The other values leave it on. See Thinking.
Gnani-only. Sample from the top_k most likely tokens.
min_p
number
0 to 1
Gnani-only. Drop tokens less likely than min_p times the most likely one.
typical_p
number
Above 0, up to 1. 1 turns it off.
Gnani-only. Typical sampling.
repetition_penalty
number
Above 0, up to 2. 1.0 turns it off.
1.0
Gnani-only. Discourages repetition.
no_repeat_ngram_size
integer
0 to 20. 0 turns it off.
0
Gnani-only. Never repeat a run of this many tokens.
user
string
Any string
An ID for your end user, for your own tracking.
The Gnani-only fields are not part of OpenAI’s API. With OpenAI’s Python SDK, pass them in extra_body. The Gnani Python SDK clients work the same way; see Python SDK: LLM.
Response
The chat completion object
Without streaming (the default), the response is 200 OK with Content-Type: application/json:
{ "id": "chatcmpl-6b1f4f0c2a5e4d8b", "object": "chat.completion", "created": 1794390000, "model": "evon-v3.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of Karnataka is Bengaluru." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 41, "completion_tokens": 9, "total_tokens": 50 }}
string
An ID for this completion.
string
Always chat.completion.
integer
When the reply was created, in Unix seconds.
string
The model that wrote the reply.
object[]
Always one choice.
Show choice fields
integer
The choice’s index.
string
Always assistant.
string | null
The reply. null when the model only calls tools.
string | null
The model’s thinking, when thinking is on. Show it to users only if you want to; you do not need to send it back in later requests.
The model thinks before it answers, by default. Its thinking is returned in message.reasoning, apart from the answer in message.content, and it counts as output tokens. For quick answers, send "reasoning_effort": "none" to turn thinking off. See Thinking.
The chat completion chunk object
With "stream": true, the response is 200 OK with Content-Type: text/event-stream. Each event is a chat.completion.chunk that carries the next piece of the reply in choices[0].delta, and the stream ends with data: [DONE]:
data: {"id":"chatcmpl-6b1f4f0c2a5e4d8b","object":"chat.completion.chunk","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}data: {"id":"chatcmpl-6b1f4f0c2a5e4d8b","object":"chat.completion.chunk","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"delta":{"content":"The capital of Karnataka"},"finish_reason":null}]}data: {"id":"chatcmpl-6b1f4f0c2a5e4d8b","object":"chat.completion.chunk","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"delta":{"content":" is Bengaluru."},"finish_reason":"stop"}]}data: [DONE]
string
An ID for this completion.
string
Always chat.completion.chunk.
integer
When the reply was created, in Unix seconds.
string
The model that wrote the reply.
object[]
One choice, or an empty list on the last usage chunk.
Show choice fields
integer
The choice’s index.
string
assistant, on the first chunk.
string
The next piece of the reply. Can be empty or missing. Join every delta.content in order to rebuild the reply.
string
The next piece of the model’s thinking, when thinking is on. It arrives before the reply. See Thinking.
object[]
Pieces of a function call. The first piece for each call has its index, id and function.name; the following pieces add to function.arguments. Join the pieces by index until a chunk has a finish_reason, then parse the arguments. See Tool calling.
object
Only with the web_search tool: progress of a search. See the web_search object below.
Only on the last chunk before [DONE], and only when you send "stream_options": {"include_usage": true}. That chunk has an empty choices list. See the usage object.
How to read the stream, and what happens when it fails part-way, is on the Streaming page.
These are the numbers counted against your daily quota. With the web_search tool, usage adds up every model call made for the request, including the search results the model read.
curl https://api.vachana.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "X-API-Key-ID: $GNANI_API_KEY" \ -d '{ "model": "evon-v3.5", "messages": [ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"} ], "temperature": 0.3, "max_tokens": 512, "reasoning_effort": "none" }'
import osfrom openai import OpenAIclient = OpenAI( base_url="https://api.vachana.ai/v1", api_key=os.environ["GNANI_API_KEY"],)completion = client.chat.completions.create( model="evon-v3.5", messages=[ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"}, ], temperature=0.3, max_tokens=512, reasoning_effort="none",)choice = completion.choices[0]print(choice.message.content)if choice.finish_reason == "length": print("(the reply was cut short; raise max_tokens)")print(completion.usage)
# pip install "gnani-vachana[llm]" (the async client is AsyncGnaniLLMClient; await the call)from gnani.llm import GnaniLLMClientclient = GnaniLLMClient() # reads GNANI_API_KEYcompletion = client.chat.completions.create( model="evon-v3.5", messages=[ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"}, ], temperature=0.3, max_tokens=512, reasoning_effort="none",)choice = completion.choices[0]print(choice.message.content)if choice.finish_reason == "length": print("(the reply was cut short; raise max_tokens)")print(completion.usage)
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://api.vachana.ai/v1", apiKey: process.env.GNANI_API_KEY,});const completion = await client.chat.completions.create({ model: "evon-v3.5", messages: [ { role: "system", content: "You are a helpful assistant. Answer in one or two sentences." }, { role: "user", content: "What is the capital of Karnataka?" }, ], temperature: 0.3, max_tokens: 512, reasoning_effort: "none",});const choice = completion.choices[0];console.log(choice.message.content);if (choice.finish_reason === "length") { console.log("(the reply was cut short; raise max_tokens)");}console.log(completion.usage);
import osimport requestsresponse = requests.post( "https://api.vachana.ai/v1/chat/completions", headers={"X-API-Key-ID": os.environ["GNANI_API_KEY"]}, json={ "model": "evon-v3.5", "messages": [ {"role": "system", "content": "You are a helpful assistant. Answer in one or two sentences."}, {"role": "user", "content": "What is the capital of Karnataka?"}, ], "temperature": 0.3, "max_tokens": 512, "reasoning_effort": "none", }, timeout=300,)body = response.json()if response.ok: print(body["choices"][0]["message"]["content"])else: # LLM errors use {"error": {...}}; authentication and rate-limit errors use {"detail": {...}} error = body.get("error") or body.get("detail") or {} print(response.status_code, error.get("code") or error.get("error_code"), error.get("message"))
Differences from OpenAI
How this API differs from OpenAI’s Chat Completions API is on the OpenAI compatibility page.
Authorizations
X-API-Key-ID
string
header
required
Headers
X-API-Key-ID
string
required
Your Gnani API key. You can send it as Authorization: Bearer <key> instead.
X-API-Request-ID
string
Your own ID for this request. It is returned in the X-API-Request-ID response header.
Body
application/json
Only messages is required. Every other field has a default.
Every value is checked before the model runs. A value of the wrong
type or out of range is refused with 400 invalid_request, and the
message names the field, for example
temperature must be between 0 and 2, got -1. Sending null for a
field means "use the default". Fields that are not listed here are
ignored.
messages
object[]
required
The conversation so far, oldest message first. At least one
message. Send every turn on every request.
Minimum array length: 1
Show child attributes
model
string
default:evon-v3.5
The model to use. evon-v3.5 is the only model; leave it out
to use it. Another name returns 404 model_not_found.
stream
boolean
default:false
Send true to receive the reply as Server-Sent Events while the
model writes it. See Streaming.
stream_options
object
Only allowed when stream is true.
Show child attributes
max_tokens
integer
The most tokens the reply may use, thinking included. From 1
up to your plan's maximum. If the reply reaches it, it is cut short and
finish_reason is length.
On Free and Pay-as-you-go plans the maximum is 1,024, and a
request without max_tokens gets 1,024. A larger value returns
400 invalid_request
(max_tokens is 2048; the maximum for your plan is 1024.). On
Enterprise plans, the input plus max_tokens must fit in the
128K-token (131,072) context window. See Limits.
Required range: 1 <= x <= 131072
max_completion_tokens
integer
Another name for max_tokens. If you send both, they must be equal.
Required range: 1 <= x <= 131072
temperature
number
default:0.6
How random the reply is, from 0 to 2. Lower is more focused
and repeatable; higher is more varied. Use low values (0–0.3)
for factual answers, extraction and classification, and higher
values for creative writing.
Required range: 0 <= x <= 2
top_p
number
default:0.95
Nucleus sampling, above 0 and up to 1. The model picks only
from the most likely tokens whose probabilities add up to top_p.
Change temperature or top_p, not usually both.
Required range: x <= 1
stop
stringstring[]
Up to 4 sequences where the model stops writing. The stop sequence
is not included in the reply. Empty strings are refused.
Minimum string length: 1
seed
integer
Makes sampling repeatable: the same request with the same seed
tends to give the same reply. It is not guaranteed.
frequency_penalty
number
default:0
From -2 to 2. Positive values make the model less likely to repeat the same words.
Required range: -2 <= x <= 2
presence_penalty
number
default:0
From -2 to 2. Positive values make the model more likely to move on to new topics.
Required range: -2 <= x <= 2
reasoning_effort
enum<string>
none turns thinking off. minimal, low, medium and high
leave it on, and do not change how long the model thinks. See
Thinking.
Available options:
none,
minimal,
low,
medium,
high
enable_thinking
boolean
default:true
Turns thinking on or off. If you send it with reasoning_effort,
enable_thinking wins. Not part of OpenAI's API; with OpenAI's
Python SDK, pass it in extra_body.
reasoning_budget
integer
default:32768
The most tokens the model may spend thinking, from 0 to 65536.
0 sets no budget. Thinking also counts toward max_tokens. Not
part of OpenAI's API; with OpenAI's Python SDK, pass it in
extra_body.
Required range: 0 <= x <= 65536
tools
object[]
Functions the model may ask you to run, each
{"type": "function", "function": {"name", "description", "parameters"}}.
parameters is a JSON Schema. See
Tool calling.
Add {"type": "web_search"} to let the model search the web. The
service runs the searches itself. See
Web search.
Option 1
Option 2
Show child attributes
tool_choice
enum<string>object
Whether and which tool the model calls. Default auto.
Value
Meaning
auto
The model decides.
none
The model does not call any tool.
required
The model must call a tool. Allowed only when tools has exactly one tool.
The model must call this function. It must be in tools.
With web_search in tools, only auto and none are allowed.
Available options:
auto,
none,
required
parallel_tool_calls
boolean
Whether the model may ask for more than one function call in one reply.
response_format
object
{"type": "text"} (the default), {"type": "json_object"} for a
JSON reply, or
{"type": "json_schema", "json_schema": {"name": "...", "schema": {...}}}
for JSON that follows your schema. See
JSON output.
Option 1
Option 2
Show child attributes
top_k
integer
default:40
The model picks only from the top_k most likely next tokens.
-1 or 0 means no limit; otherwise a positive integer. Not part of OpenAI's
API; with OpenAI's Python SDK, pass it in extra_body.
Required range: x >= -1
min_p
number
From 0 to 1. Leaves out tokens that are less likely than
min_p times the most likely one. Not part of OpenAI's API; with
OpenAI's Python SDK, pass it in extra_body.
Required range: 0 <= x <= 1
typical_p
number
Typical sampling, above 0 and up to 1. 1 turns it off. Not
part of OpenAI's API; with OpenAI's Python SDK, pass it in
extra_body.
Required range: x <= 1
repetition_penalty
number
default:1
Above 0 and up to 2. Values above 1 discourage repetition;
1 turns it off. Not part of OpenAI's API; with OpenAI's Python
SDK, pass it in extra_body.
Required range: x <= 2
no_repeat_ngram_size
integer
default:0
From 0 to 20. The reply never repeats a run of this many
tokens. 0 turns it off. Not part of OpenAI's API; with OpenAI's
Python SDK, pass it in extra_body.
Required range: 0 <= x <= 20
user
string
An ID for your end user, for your own tracking.
Response
application/json (a chat.completion object) by default, or
text/event-stream (chat.completion.chunk events ending in
data: [DONE]) when stream is true.
id
string
required
object
string
required
Allowed value: "chat.completion"
choices
object[]
required
Show child attributes
created
integer
Unix time, in seconds.
model
string
usage
object
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Gnani AI Documentation","description":"Gnani AI docs for Speech APIs (STT and TTS), the LLM API, Agent Builder, and the Agent Builder Platform API. Build Voice AI for Indian languages and call audio.","colors":{"primary":"#1A1A1A","light":"#FAFAFA","dark":"#1A1A1A"},"logo":{"light":"https://mintcdn.com/gnaniinnovationsprivatelimited/07TQaHxEIXJZr-iJ/logo/favicon.svg?fit=max\u0026auto=format\u0026n=07TQaHxEIXJZr-iJ\u0026q=85\u0026s=feca06a904160c2b661bfa77fe1f90c4","dark":"https://mintcdn.com/gnaniinnovationsprivatelimited/07TQaHxEIXJZr-iJ/logo/favicon.svg?fit=max\u0026auto=format\u0026n=07TQaHxEIXJZr-iJ\u0026q=85\u0026s=feca06a904160c2b661bfa77fe1f90c4","href":"https://app.gnani.ai/voice"},"favicon":"https://mintcdn.com/gnaniinnovationsprivatelimited/j9EzPlQTWx8MehCB/favicon.svg?fit=max\u0026auto=format\u0026n=j9EzPlQTWx8MehCB\u0026q=85\u0026s=f14fb3fd819d0b628fbcd5108850f804","api":{"openapi":["STT.yml","STTBatch.yml","TTS.yml","VC.yml","voice-clone-embeddings.yml","LLM.yml","agents_openapi.yml","agent_config_openapi.yml"],"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","python","javascript"],"prefill":true},"mdx":{"auth":{"method":"key","name":"X-API-Key-ID"},"server":"https://api.vachana.ai"}},"appearance":{"default":"system","strict":false},"background":{"decoration":"gradient","color":{"light":"#FAFAFA","dark":"#1A1A1A"}},"navbar":{"links":[{"href":"mailto:hello-inya@gnani.site","label":"Support"},{"icon":"discord","href":"https://discord.gg/aECcvtABpq","label":"Community"},{"href":"https://www.gnani.ai/","label":"Website"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.gnani.ai/voice"}},"footer":{"socials":{"x":"https://x.com/GnaniAi","linkedin":"https://www.linkedin.com/company/gnani-ai","website":"https://www.gnani.ai/","instagram":"https://instagram.com/gnani.ai"}},"seo":{"indexing":"all"},"fonts":{"body":{"family":"Inter"}},"integrations":{"clarity":{"projectId":"ytd0fajeva"},"ga4":{"measurementId":"G-58CTSCY1G8"}},"contextual":{"options":[{"title":"View as Markdown","description":"View this page as Markdown on docs.gnani.ai","icon":"file-text","href":{"base":"https://docs.gnani.ai$path.md"}},"copy",{"title":"Open in Claude","description":"Open this page in Claude using docs.gnani.ai","icon":"claude","href":{"base":"https://claude.ai/new","query":[{"key":"q","value":"Read from https://docs.gnani.ai$path.md so I can ask questions about it."}]}},{"title":"Open in ChatGPT","description":"Open this page in ChatGPT using docs.gnani.ai","icon":"openai","href":{"base":"https://chat.openai.com/","query":[{"key":"hints","value":"search"},{"key":"q","value":"Read from https://docs.gnani.ai$path.md so I can ask questions about it."}]}},"add-mcp","mcp","cursor","vscode"],"display":"header"},"variables":{"llm_model":"evon-v3.5","llm_model_name":"Gnani Evon v3.5","llm_base_url":"https://api.vachana.ai/v1"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"gnaniinnovationsprivatelimited","hasAudioNarration":false,"actualSubdomain":"gnaniinnovationsprivatelimited","customDomains":["docs.gnani.ai"],"gitSource":{"type":"github","owner":"gnani-ai-mintlify","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":false},"entitlements":{},"buildId":"6afc87eb71b3c876b345dc2a","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Gnani AI APIs","count":56},{"language":"default","tag":"APIs","count":43},{"language":"default","tag":"Gnani AI Agent Builder APIs","count":28},{"language":"default","tag":"Gnani AI Agents","count":26},{"language":"default","tag":"LLM","count":18},{"language":"default","tag":"Speech-to-Text","count":15},{"language":"default","tag":"Gnani APIs","count":9},{"language":"default","tag":"Getting Started","count":7},{"language":"default","tag":"Agents API","count":7},{"language":"default","tag":"Guides","count":7}],"searchSettings":{"showContentSnippets":false}},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"html[data-gnani-index] #content-side-layout[data-api-example]>:not(#gnani-toc-layout){display:none!important}html[data-gnani-index] [id$=\"operation-page\"]>div:first-child>div:nth-child(2){display:none!important}#gnani-toc-layout{display:none;box-sizing:border-box;max-height:100%;padding-left:2.5rem;width:19rem}@media (min-width: 1280px){#gnani-toc-layout{display:flex}}#gnani-toc{width:16.5rem;min-width:0;max-height:100%;margin-top:-2.5rem;padding:2.5rem 0 1rem;overflow-y:auto;font-size:0.875rem;line-height:1.5rem;scrollbar-width:none}#gnani-toc::-webkit-scrollbar{display:none}#gnani-toc .gnani-toc-title{display:flex;align-items:center;gap:0.5rem;margin:0 0 0.5rem;font-weight:500;color:rgb(55 65 81)}html.dark #gnani-toc .gnani-toc-title{color:rgb(209 213 219)}#gnani-toc ul{margin:0;padding:0;list-style:none}#gnani-toc a{display:block;padding:0.25rem 0 0.25rem var(--gnani-toc-indent, 0);font-weight:500;color:rgb(75 85 99);text-decoration:none;overflow-wrap:anywhere}html.dark #gnani-toc a{color:rgb(156 163 175)}#gnani-toc a:hover{color:rgb(17 24 39)}html.dark #gnani-toc a:hover{color:rgb(209 213 219)}#gnani-toc li[data-active]>a{color:rgb(17 24 39)}html.dark #gnani-toc li[data-active]>a{color:rgb(250 250 250)}"}],"page":{"pagePath":"api/LLM/chat-completions","slug":"/api/LLM/chat-completions","pageMetadata":{"title":"Chat Completions","sidebarTitle":"Chat Completions","openapi":"POST /v1/chat/completions","description":"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.","keywords":["chat completions","API reference","parameters","response object","chunk object","usage","tool call","web search","OpenAI compatible"],"og:title":"Chat Completions API reference","og:description":"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.","href":"/api/LLM/chat-completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const LlmEarlyAccess=()=>_jsxs(`div`,{className:`not-prose mint-mb-6 mint-flex mint-flex-wrap mint-items-center mint-gap-x-3 mint-gap-y-1.5 mint-rounded-xl mint-border mint-border-amber-300 mint-bg-amber-50 mint-px-4 mint-py-2.5 mint-text-sm mint-text-amber-900 dark:mint-border-amber-400/30 dark:mint-bg-amber-400/10 dark:mint-text-amber-100`,children:[_jsx(`span`,{className:`mint-rounded-full mint-bg-amber-500 mint-px-2.5 mint-py-0.5 mint-text-xs mint-font-semibold mint-uppercase mint-tracking-wide mint-text-white dark:mint-bg-amber-400 dark:mint-text-amber-950`,children:`Early access`}),_jsxs(`span`,{children:[_jsx(`strong`,{children:`Gnani Evon v3.5`}),` is now available as an API to early access registrants.`]})]});function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Expandable,Heading,Note,ResponseField,Table,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_MdxComponentBoundary,{name:`LlmEarlyAccess`,children:_jsx(LlmEarlyAccess,{})}),`\n`,_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[`Send a conversation and get the model’s next message. The call is `,_jsx(_components.strong,{children:`stateless`}),`: nothing is stored between requests, so `,_jsx(_components.code,{children:`messages`}),` must hold the whole conversation every time.`]}),`\n`,_jsxs(_components.p,{children:[`The request and response follow `,_jsx(_components.a,{href:`https://platform.openai.com/docs/api-reference/chat/create`,children:`OpenAI’s Chat Completions API`}),`. New to the API? Start with the `,_jsx(_components.a,{href:`/api/LLM/overview`,children:`Overview`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST https://api.vachana.ai/v1/chat/completions`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Content-Type: application/json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`Send your API key in one of these headers. If you send both, `,_jsx(_components.code,{children:`X-API-Key-ID`}),` is used.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-API-Key-ID`})}),_jsx(_components.td,{children:`One of the two`}),_jsx(_components.td,{children:`Your Gnani API key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Authorization`})}),_jsx(_components.td,{children:`One of the two`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Bearer \u003cyour-api-key>`}),`. This is what OpenAI’s SDKs send.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-API-Request-ID`})}),_jsx(_components.td,{children:`No`}),_jsxs(_components.td,{children:[`Your own ID for the request. It is returned in the `,_jsx(_components.code,{children:`X-API-Request-ID`}),` response header. If you leave it out, one is generated.`]})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request body`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"messages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant. Answer in one or two sentences.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of Karnataka?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"temperature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.6`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"max_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`512`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"reasoning_effort\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"none\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.code,{children:`messages`}),` is required. Every other field has a default.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Every value is checked before the model runs.`}),` A value of the wrong type or out of range is refused with `,_jsx(_components.code,{children:`400 invalid_request`}),`, and the message names the field, for example `,_jsx(_components.code,{children:`temperature must be between 0 and 2, got -1`}),`. Sending `,_jsx(_components.code,{children:`null`}),` for a field means “use the default”. A field name the API does not know is refused with `,_jsx(_components.code,{children:`400 unknown_parameter`}),`, so a typo does not pass silently. A few OpenAI fields that Gnani does not use, such as `,_jsx(_components.code,{children:`logprobs`}),` and `,_jsx(_components.code,{children:`store`}),`, are accepted and ignored. See `,_jsx(_components.a,{href:`/api/LLM/openai-compatibility`,children:`Migrating from OpenAI`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`parameters-at-a-glance`,children:`Parameters at a glance`}),`\n`,_jsxs(_components.p,{children:[`Every request field, with its allowed values. Full descriptions and the playground are in the generated parameter list on this page. A value outside its range is refused with `,_jsx(_components.code,{children:`400 invalid_request`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Range or options`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Purpose`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`evon-v3.5`}),` only. Any other value returns `,_jsx(_components.code,{children:`404 model_not_found`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`evon-v3.5`})}),_jsx(_components.td,{children:`The model to use.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`messages`})}),_jsx(_components.td,{children:`object[]`}),_jsxs(_components.td,{children:[`At least 1 message. `,_jsx(_components.code,{children:`role`}),`: `,_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`developer`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),` or `,_jsx(_components.code,{children:`tool`}),`.`]}),_jsx(_components.td,{children:`required`}),_jsx(_components.td,{children:`The conversation so far, oldest first.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stream`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),`, `,_jsx(_components.code,{children:`false`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})}),_jsxs(_components.td,{children:[`Stream the reply as Server-Sent Events. See `,_jsx(_components.a,{href:`/api/LLM/streaming`,children:`Streaming`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stream_options`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`include_usage`}),`: `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),` (default `,_jsx(_components.code,{children:`false`}),`). Only with `,_jsx(_components.code,{children:`\"stream\": true`}),`.`]}),_jsx(_components.td,{}),_jsxs(_components.td,{children:[`Adds a last chunk with token `,_jsx(_components.code,{children:`usage`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`max_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`1`}),` to your plan’s maximum: `,_jsx(_components.strong,{children:`1,024`}),` on Free and Pay-as-you-go; on Enterprise, up to the context window less the input.`]}),_jsx(_components.td,{children:`1,024 on Free and Pay-as-you-go`}),_jsxs(_components.td,{children:[`Most tokens in the reply, thinking included. See `,_jsx(_components.a,{href:`/api/LLM/limits`,children:`Limits`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`max_completion_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[`Same as `,_jsx(_components.code,{children:`max_tokens`})]}),_jsx(_components.td,{}),_jsxs(_components.td,{children:[`Another name for `,_jsx(_components.code,{children:`max_tokens`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`temperature`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` to `,_jsx(_components.code,{children:`2`})]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0.6`})}),_jsx(_components.td,{children:`How random the reply is. Lower is more focused.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_p`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Above `,_jsx(_components.code,{children:`0`}),`, up to `,_jsx(_components.code,{children:`1`})]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0.95`})}),_jsx(_components.td,{children:`Nucleus sampling.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stop`})}),_jsx(_components.td,{children:`string | string[]`}),_jsx(_components.td,{children:`One string, or up to 4 strings. Each at least 1 character.`}),_jsx(_components.td,{}),_jsx(_components.td,{children:`Stop sequences.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`seed`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Any integer`}),_jsx(_components.td,{}),_jsx(_components.td,{children:`Makes sampling repeatable, not guaranteed.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`frequency_penalty`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`-2`}),` to `,_jsx(_components.code,{children:`2`})]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`Discourages repeating the same words.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`presence_penalty`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`-2`}),` to `,_jsx(_components.code,{children:`2`})]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`Encourages new topics.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`reasoning_effort`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`minimal`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, `,_jsx(_components.code,{children:`high`})]}),_jsx(_components.td,{}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),` turns thinking off. The other values leave it on. See `,_jsx(_components.a,{href:`/api/LLM/thinking`,children:`Thinking`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`enable_thinking`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),`, `,_jsx(_components.code,{children:`false`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})}),_jsxs(_components.td,{children:[`Turns thinking on or off. See `,_jsx(_components.a,{href:`/api/LLM/thinking`,children:`Thinking`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`reasoning_budget`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` to `,_jsx(_components.code,{children:`65536`}),`. `,_jsx(_components.code,{children:`0`}),` means no budget.`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`32768`})}),_jsxs(_components.td,{children:[`Most tokens the model may spend thinking. See `,_jsx(_components.a,{href:`/api/LLM/thinking`,children:`Thinking`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tools`})}),_jsx(_components.td,{children:`object[]`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`function`}),` tools, and the built-in `,_jsx(_components.code,{children:`{\"type\": \"web_search\"}`})]}),_jsx(_components.td,{}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/api/LLM/tool-calling`,children:`Tool calling`}),` and `,_jsx(_components.a,{href:`/api/LLM/web-search`,children:`Web search`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_choice`})}),_jsx(_components.td,{children:`string | object`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`required`}),`, or `,_jsx(_components.code,{children:`{\"type\": \"function\", \"function\": {\"name\": \"...\"}}`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`auto`})}),_jsxs(_components.td,{children:[`Whether and which tool the model calls. See `,_jsx(_components.a,{href:`/api/LLM/tool-calling`,children:`Tool calling`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`parallel_tool_calls`})}),_jsx(_components.td,{children:`boolean`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),`, `,_jsx(_components.code,{children:`false`})]}),_jsx(_components.td,{}),_jsx(_components.td,{children:`Allow more than one function call in one reply.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response_format`})}),_jsx(_components.td,{children:`object`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`{\"type\": \"text\"}`}),`, `,_jsx(_components.code,{children:`{\"type\": \"json_object\"}`}),` or `,_jsx(_components.code,{children:`{\"type\": \"json_schema\", \"json_schema\": {...}}`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`{\"type\": \"text\"}`})}),_jsxs(_components.td,{children:[`Ask for JSON. See `,_jsx(_components.a,{href:`/api/LLM/structured-outputs`,children:`JSON output`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`top_k`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`-1`}),` or `,_jsx(_components.code,{children:`0`}),` for no limit, or a positive integer`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`40`})}),_jsxs(_components.td,{children:[`Gnani-only. Sample from the `,_jsx(_components.code,{children:`top_k`}),` most likely tokens.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`min_p`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` to `,_jsx(_components.code,{children:`1`})]}),_jsx(_components.td,{}),_jsxs(_components.td,{children:[`Gnani-only. Drop tokens less likely than `,_jsx(_components.code,{children:`min_p`}),` times the most likely one.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`typical_p`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Above `,_jsx(_components.code,{children:`0`}),`, up to `,_jsx(_components.code,{children:`1`}),`. `,_jsx(_components.code,{children:`1`}),` turns it off.`]}),_jsx(_components.td,{}),_jsx(_components.td,{children:`Gnani-only. Typical sampling.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`repetition_penalty`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Above `,_jsx(_components.code,{children:`0`}),`, up to `,_jsx(_components.code,{children:`2`}),`. `,_jsx(_components.code,{children:`1.0`}),` turns it off.`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1.0`})}),_jsx(_components.td,{children:`Gnani-only. Discourages repetition.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`no_repeat_ngram_size`})}),_jsx(_components.td,{children:`integer`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`0`}),` to `,_jsx(_components.code,{children:`20`}),`. `,_jsx(_components.code,{children:`0`}),` turns it off.`]}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`Gnani-only. Never repeat a run of this many tokens.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`user`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Any string`}),_jsx(_components.td,{}),_jsx(_components.td,{children:`An ID for your end user, for your own tracking.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`The Gnani-only fields are not part of OpenAI’s API. With OpenAI’s Python SDK, pass them in `,_jsx(_components.code,{children:`extra_body`}),`. The Gnani Python SDK clients work the same way; see `,_jsx(_components.a,{href:`/python-sdk/llm#gnani-only-parameters`,children:`Python SDK: LLM`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(Heading,{level:`3`,id:`the-chat-completion-object`,children:`The chat completion object`}),`\n`,_jsxs(_components.p,{children:[`Without streaming (the default), the response is `,_jsx(_components.code,{children:`200 OK`}),` with `,_jsx(_components.code,{children:`Content-Type: application/json`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl-6b1f4f0c2a5e4d8b\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1794390000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"The capital of Karnataka is Bengaluru.\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`41`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id`,children:_jsx(_components.p,{children:`An ID for this completion.`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`chat.completion`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`created`,type:`integer`,id:`param-created`,children:_jsx(_components.p,{children:`When the reply was created, in Unix seconds.`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model`,children:_jsx(_components.p,{children:`The model that wrote the reply.`})}),`\n`,_jsxs(ResponseField,{name:`choices`,type:`object[]`,id:`param-choices`,children:[_jsx(_components.p,{children:`Always one choice.`}),_jsxs(Expandable,{title:`choice fields`,children:[_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index`,children:_jsx(_components.p,{children:`The choice’s index.`})}),_jsx(ResponseField,{name:`message.role`,type:`string`,id:`param-message-role`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`assistant`}),`.`]})}),_jsx(ResponseField,{name:`message.content`,type:`string | null`,id:`param-message-content`,children:_jsxs(_components.p,{children:[`The reply. `,_jsx(_components.code,{children:`null`}),` when the model only calls tools.`]})}),_jsx(ResponseField,{name:`message.reasoning`,type:`string | null`,id:`param-message-reasoning`,children:_jsx(_components.p,{children:`The model’s thinking, when thinking is on. Show it to users only if you want to; you do not need to send it back in later requests.`})}),_jsx(ResponseField,{name:`message.tool_calls`,type:`object[] | null`,id:`param-message-tool-calls`,children:_jsxs(_components.p,{children:[`The functions the model wants you to run. See `,_jsx(_components.a,{href:`#the-tool-call-object`,children:`the tool call object`}),` and `,_jsx(_components.a,{href:`/api/LLM/tool-calling`,children:`Tool calling`}),`.`]})}),_jsx(ResponseField,{name:`message.web_search`,type:`object`,id:`param-message-web-search`,children:_jsxs(_components.p,{children:[`Only with the `,_jsx(_components.code,{children:`web_search`}),` tool: the searches the model ran and the sources it used. See the web_search object below, and `,_jsx(_components.a,{href:`/api/LLM/web-search`,children:`Web search`}),`.`]})}),_jsxs(ResponseField,{name:`finish_reason`,type:`string`,id:`param-finish-reason`,children:[_jsx(_components.p,{children:`Why the model stopped.`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`stop`})}),_jsxs(_components.td,{children:[`The reply is complete, or a `,_jsx(_components.code,{children:`stop`}),` sequence was reached.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`length`})}),_jsxs(_components.td,{children:[`The reply reached `,_jsx(_components.code,{children:`max_tokens`}),` and was cut short.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`tool_calls`})}),_jsx(_components.td,{children:`The model is asking you to run functions.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`content_filter`})}),_jsxs(_components.td,{children:[`The safety filters withheld the reply. See `,_jsx(_components.a,{href:`/api/LLM/safety`,children:`Safety and privacy`}),`.`]})]})]})]})]})]})]}),`\n`,_jsx(ResponseField,{name:`usage`,type:`object`,id:`param-usage`,children:_jsxs(_components.p,{children:[`Tokens used by this request. See `,_jsx(_components.a,{href:`#the-usage-object`,children:`the usage object`}),`.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`The model thinks before it answers, by default.`}),` Its thinking is returned in `,_jsx(_components.code,{children:`message.reasoning`}),`, apart from the answer in `,_jsx(_components.code,{children:`message.content`}),`, and it counts as output tokens. For quick answers, send `,_jsx(_components.code,{children:`\"reasoning_effort\": \"none\"`}),` to turn thinking off. See `,_jsx(_components.a,{href:`/api/LLM/thinking`,children:`Thinking`}),`.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`the-chat-completion-chunk-object`,children:`The chat completion chunk object`}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`\"stream\": true`}),`, the response is `,_jsx(_components.code,{children:`200 OK`}),` with `,_jsx(_components.code,{children:`Content-Type: text/event-stream`}),`. Each event is a `,_jsx(_components.code,{children:`chat.completion.chunk`}),` that carries the next piece of the reply in `,_jsx(_components.code,{children:`choices[0].delta`}),`, and the stream ends with `,_jsx(_components.code,{children:`data: [DONE]`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"finish_reason\":null}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"The capital of Karnataka\"},\"finish_reason\":null}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is Bengaluru.\"},\"finish_reason\":\"stop\"}]}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`data: [DONE]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-1`,children:_jsx(_components.p,{children:`An ID for this completion.`})}),`\n`,_jsx(ResponseField,{name:`object`,type:`string`,id:`param-object-1`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`chat.completion.chunk`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`created`,type:`integer`,id:`param-created-1`,children:_jsx(_components.p,{children:`When the reply was created, in Unix seconds.`})}),`\n`,_jsx(ResponseField,{name:`model`,type:`string`,id:`param-model-1`,children:_jsx(_components.p,{children:`The model that wrote the reply.`})}),`\n`,_jsxs(ResponseField,{name:`choices`,type:`object[]`,id:`param-choices-1`,children:[_jsxs(_components.p,{children:[`One choice, or an empty list on the last `,_jsx(_components.code,{children:`usage`}),` chunk.`]}),_jsxs(Expandable,{title:`choice fields`,children:[_jsx(ResponseField,{name:`index`,type:`integer`,id:`param-index-1`,children:_jsx(_components.p,{children:`The choice’s index.`})}),_jsx(ResponseField,{name:`delta.role`,type:`string`,id:`param-delta-role`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`assistant`}),`, on the first chunk.`]})}),_jsx(ResponseField,{name:`delta.content`,type:`string`,id:`param-delta-content`,children:_jsxs(_components.p,{children:[`The next piece of the reply. Can be empty or missing. Join every `,_jsx(_components.code,{children:`delta.content`}),` in order to rebuild the reply.`]})}),_jsx(ResponseField,{name:`delta.reasoning`,type:`string`,id:`param-delta-reasoning`,children:_jsxs(_components.p,{children:[`The next piece of the model’s thinking, when thinking is on. It arrives before the reply. See `,_jsx(_components.a,{href:`/api/LLM/thinking`,children:`Thinking`}),`.`]})}),_jsx(ResponseField,{name:`delta.tool_calls`,type:`object[]`,id:`param-delta-tool-calls`,children:_jsxs(_components.p,{children:[`Pieces of a function call. The first piece for each call has its `,_jsx(_components.code,{children:`index`}),`, `,_jsx(_components.code,{children:`id`}),` and `,_jsx(_components.code,{children:`function.name`}),`; the following pieces add to `,_jsx(_components.code,{children:`function.arguments`}),`. Join the pieces by `,_jsx(_components.code,{children:`index`}),` until a chunk has a `,_jsx(_components.code,{children:`finish_reason`}),`, then parse the arguments. See `,_jsx(_components.a,{href:`/api/LLM/tool-calling`,children:`Tool calling`}),`.`]})}),_jsx(ResponseField,{name:`delta.web_search`,type:`object`,id:`param-delta-web-search`,children:_jsxs(_components.p,{children:[`Only with the `,_jsx(_components.code,{children:`web_search`}),` tool: progress of a search. See the web_search object below.`]})}),_jsx(ResponseField,{name:`finish_reason`,type:`string | null`,id:`param-finish-reason-1`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`null`}),` until the last content chunk, then one of the values listed for `,_jsx(_components.a,{href:`#the-chat-completion-object`,children:`the chat completion object`}),`.`]})})]})]}),`\n`,_jsx(ResponseField,{name:`usage`,type:`object`,id:`param-usage-1`,children:_jsxs(_components.p,{children:[`Only on the last chunk before `,_jsx(_components.code,{children:`[DONE]`}),`, and only when you send `,_jsx(_components.code,{children:`\"stream_options\": {\"include_usage\": true}`}),`. That chunk has an empty `,_jsx(_components.code,{children:`choices`}),` list. See `,_jsx(_components.a,{href:`#the-usage-object`,children:`the usage object`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`How to read the stream, and what happens when it fails part-way, is on the `,_jsx(_components.a,{href:`/api/LLM/streaming`,children:`Streaming`}),` page.`]}),`\n`,_jsx(Heading,{level:`3`,id:`the-usage-object`,children:`The usage object`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`41`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`prompt_tokens`,type:`integer`,id:`param-prompt-tokens`,children:_jsx(_components.p,{children:`Input tokens.`})}),`\n`,_jsx(ResponseField,{name:`completion_tokens`,type:`integer`,id:`param-completion-tokens`,children:_jsx(_components.p,{children:`Output tokens, thinking included.`})}),`\n`,_jsx(ResponseField,{name:`total_tokens`,type:`integer`,id:`param-total-tokens`,children:_jsx(_components.p,{children:`Total tokens.`})}),`\n`,_jsxs(_components.p,{children:[`These are the numbers counted against your `,_jsx(_components.a,{href:`/api/LLM/limits`,children:`daily quota`}),`. With the `,_jsx(_components.code,{children:`web_search`}),` tool, `,_jsx(_components.code,{children:`usage`}),` adds up every model call made for the request, including the search results the model read.`]}),`\n`,_jsx(Heading,{level:`3`,id:`the-tool-call-object`,children:`The tool call object`}),`\n`,_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"call_9f2c41\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"function\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"function\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"get_order_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"arguments\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`order_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ORD-48213`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,id:`param-id-2`,children:_jsxs(_components.p,{children:[`The call’s ID. Send it back as `,_jsx(_components.code,{children:`tool_call_id`}),` on the `,_jsx(_components.code,{children:`tool`}),` message that holds the result.`]})}),`\n`,_jsx(ResponseField,{name:`type`,type:`string`,id:`param-type`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`function`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`function`,type:`object`,id:`param-function`,children:_jsxs(Expandable,{title:`function fields`,children:[_jsx(ResponseField,{name:`name`,type:`string`,id:`param-name`,children:_jsxs(_components.p,{children:[`The name of the function to run, from your `,_jsx(_components.code,{children:`tools`}),`.`]})}),_jsx(ResponseField,{name:`arguments`,type:`string`,id:`param-arguments`,children:_jsx(_components.p,{children:`The arguments as a JSON-encoded string, not an object, written by the model. Validate it before use.`})})]})}),`\n`,_jsxs(_components.p,{children:[`When streaming, each piece in `,_jsx(_components.code,{children:`delta.tool_calls`}),` also has an `,_jsx(_components.code,{children:`index`}),`, which you use to join the pieces of one call.`]}),`\n`,_jsx(Heading,{level:`3`,id:`the-web_search-object`,children:`The web_search object`}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`message.web_search`}),`, when the model searched the web:`]}),`\n`,_jsx(CodeBlock,{filename:``,wrap:`true`,numberOfLines:`12`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"queries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Mumbai weather forecast this weekend\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sources\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Mumbai weekend forecast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://example.com/mumbai-forecast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"snippet\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Saturday: light showers in the afternoon. Sunday: partly cloudy...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"remaining_today\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(ResponseField,{name:`queries`,type:`string[]`,id:`param-queries`,children:_jsx(_components.p,{children:`The searches the model ran, in order.`})}),`\n`,_jsxs(ResponseField,{name:`sources`,type:`object[]`,id:`param-sources`,children:[_jsx(_components.p,{children:`Every result the model was given. Numbering runs across all searches in the request.`}),_jsxs(Expandable,{title:`source fields`,children:[_jsx(ResponseField,{name:`id`,type:`integer`,id:`param-id-3`,children:_jsxs(_components.p,{children:[`The number the answer cites, as `,_jsx(_components.code,{children:`[id]`}),`.`]})}),_jsx(ResponseField,{name:`title`,type:`string`,id:`param-title`,children:_jsx(_components.p,{children:`The page title.`})}),_jsx(ResponseField,{name:`url`,type:`string`,id:`param-url`,children:_jsx(_components.p,{children:`The page URL.`})}),_jsx(ResponseField,{name:`snippet`,type:`string`,id:`param-snippet`,children:_jsx(_components.p,{children:`The relevant text from the page.`})})]})]}),`\n`,_jsx(ResponseField,{name:`remaining_today`,type:`integer`,id:`param-remaining-today`,children:_jsx(_components.p,{children:`How many searches you have left today.`})}),`\n`,_jsxs(_components.p,{children:[`When streaming, `,_jsx(_components.code,{children:`delta.web_search`}),` reports each search as it happens:`]}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`searching`})}),_jsxs(_components.td,{children:[`A search has started. `,_jsx(_components.code,{children:`query`}),` is what is being searched.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completed`})}),_jsxs(_components.td,{children:[`The search finished. `,_jsx(_components.code,{children:`sources`}),` holds the results (empty if nothing was found), and `,_jsx(_components.code,{children:`remaining`}),` the searches left today.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`failed`})}),_jsx(_components.td,{children:`The search could not run. The model answers without it.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`limit_reached`})}),_jsx(_components.td,{children:`Your daily search limit was reached during this request. The model answers without searching further.`})]})]})]})}),`\n`,_jsx(ResponseField,{name:`query`,type:`string`,id:`param-query`,children:_jsx(_components.p,{children:`What is being searched.`})}),`\n`,_jsx(ResponseField,{name:`sources`,type:`object[]`,id:`param-sources-1`,children:_jsxs(_components.p,{children:[`On `,_jsx(_components.code,{children:`completed`}),`: the results, with the same fields as above.`]})}),`\n`,_jsx(ResponseField,{name:`remaining`,type:`integer`,id:`param-remaining`,children:_jsxs(_components.p,{children:[`On `,_jsx(_components.code,{children:`completed`}),`: the searches left today.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`response-headers`,children:`Response headers`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-API-Request-ID`})}),_jsx(_components.td,{children:`The request ID: yours, or a generated one. Quote it when you contact support.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Retry-After`})}),_jsxs(_components.td,{children:[`On some `,_jsx(_components.code,{children:`429`}),` responses: the number of seconds to wait before retrying.`]})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`Error codes, shapes and what to do about each are on the `,_jsx(_components.a,{href:`/api/LLM/errors`,children:`Errors`}),` page.`]}),`\n`,_jsx(Heading,{level:`2`,id:`retrying`,children:`Retrying`}),`\n`,_jsxs(_components.p,{children:[`Which errors to retry, and how, is in `,_jsx(_components.a,{href:`/api/LLM/errors#retrying`,children:`Errors: Retrying`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`code-examples`,children:`Code examples`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.vachana.ai/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key-ID: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$GNANI_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"evon-v3.5\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\": 0.3,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\": 512,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"reasoning_effort\": \"none\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python (OpenAI SDK)`,numberOfLines:`24`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.vachana.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GNANI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`completion `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant. Answer in one or two sentences.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of Karnataka?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`512`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reasoning_effort`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"none\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`choice `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` completion.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(choice.message.content)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` choice.finish_reason `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"length\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"(the reply was cut short; raise max_tokens)\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(completion.usage)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python (Gnani SDK)`,numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# pip install \"gnani-vachana[llm]\" (the async client is AsyncGnaniLLMClient; await the call)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` gnani.llm `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GnaniLLMClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` GnaniLLMClient() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# reads GNANI_API_KEY`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`completion `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant. Answer in one or two sentences.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of Karnataka?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` temperature`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`512`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reasoning_effort`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"none\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`choice `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` completion.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(choice.message.content)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` choice.finish_reason `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"length\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"(the reply was cut short; raise max_tokens)\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(completion.usage)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript (OpenAI SDK)`,numberOfLines:`24`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.vachana.ai/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`GNANI_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` completion`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a helpful assistant. Answer in one or two sentences.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What is the capital of Karnataka?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` temperature:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 512`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reasoning_effort:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"none\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` choice`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` completion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choice`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choice`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`finish_reason`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"length\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"(the reply was cut short; raise max_tokens)\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`usage`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python (requests)`,numberOfLines:`26`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.vachana.ai/v1/chat/completions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-API-Key-ID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GNANI_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"evon-v3.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant. Answer in one or two sentences.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What is the capital of Karnataka?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"temperature\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"max_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`512`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"reasoning_effort\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"none\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`300`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`body `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.ok:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(body[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # LLM errors use {\"error\": {...}}; authentication and rate-limit errors use {\"detail\": {...}}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"detail\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.status_code, error.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` error.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error_code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), error.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`]})})})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`differences-from-openai`,children:`Differences from OpenAI`}),`\n`,_jsxs(_components.p,{children:[`How this API differs from OpenAI’s Chat Completions API is on the `,_jsx(_components.a,{href:`/api/LLM/openai-compatibility`,children:`OpenAI compatibility`}),` page.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{LlmEarlyAccess,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat Completions","sidebarTitle":"Chat Completions","openapi":"POST /v1/chat/completions","description":"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.","keywords":["chat completions","API reference","parameters","response object","chunk object","usage","tool call","web search","OpenAI compatible"],"og:title":"Chat Completions API reference","og:description":"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.","href":"/api/LLM/chat-completions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Endpoint","slug":"endpoint","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Request body","slug":"request-body","depth":2,"children":[{"title":"Parameters at a glance","slug":"parameters-at-a-glance","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[{"title":"The chat completion object","slug":"the-chat-completion-object","depth":3,"children":[]},{"title":"The chat completion chunk object","slug":"the-chat-completion-chunk-object","depth":3,"children":[]},{"title":"The usage object","slug":"the-usage-object","depth":3,"children":[]},{"title":"The tool call object","slug":"the-tool-call-object","depth":3,"children":[]},{"title":"The web_search object","slug":"the-web_search-object","depth":3,"children":[]},{"title":"Response headers","slug":"response-headers","depth":3,"children":[]}]},{"title":"Errors","slug":"errors","depth":2,"children":[]},{"title":"Retrying","slug":"retrying","depth":2,"children":[]},{"title":"Code examples","slug":"code-examples","depth":2,"children":[]},{"title":"Differences from OpenAI","slug":"differences-from-openai","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/gnaniinnovationsprivatelimited/aa125a548bc31de7/api-page-index.js"],"dynamicCss":".mint-mb-6 {\n margin-bottom: 1.5rem\n}\n.mint-flex {\n display: flex\n}\n.mint-flex-wrap {\n flex-wrap: wrap\n}\n.mint-items-center {\n align-items: center\n}\n.mint-gap-x-3 {\n column-gap: 0.75rem\n}\n.mint-gap-y-1\\.5 {\n row-gap: 0.375rem\n}\n.mint-rounded-full {\n border-radius: 9999px\n}\n.mint-rounded-xl {\n border-radius: 0.75rem\n}\n.mint-border {\n border-width: 1px\n}\n.mint-border-amber-300 {\n --tw-border-opacity: 1;\n border-color: rgb(252 211 77 / var(--tw-border-opacity, 1))\n}\n.mint-bg-amber-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(255 251 235 / var(--tw-bg-opacity, 1))\n}\n.mint-bg-amber-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(245 158 11 / var(--tw-bg-opacity, 1))\n}\n.mint-px-2\\.5 {\n padding-left: 0.625rem;\n padding-right: 0.625rem\n}\n.mint-px-4 {\n padding-left: 1rem;\n padding-right: 1rem\n}\n.mint-py-0\\.5 {\n padding-top: 0.125rem;\n padding-bottom: 0.125rem\n}\n.mint-py-2\\.5 {\n padding-top: 0.625rem;\n padding-bottom: 0.625rem\n}\n.mint-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem\n}\n.mint-text-xs {\n font-size: 0.75rem;\n line-height: 1rem\n}\n.mint-font-semibold {\n font-weight: 600\n}\n.mint-uppercase {\n text-transform: uppercase\n}\n.mint-tracking-wide {\n letter-spacing: 0.025em\n}\n.mint-text-amber-900 {\n --tw-text-opacity: 1;\n color: rgb(120 53 15 / var(--tw-text-opacity, 1))\n}\n.mint-text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1))\n}\n.dark\\:mint-border-amber-400\\/30:is(.dark *) {\n border-color: rgb(251 191 36 / 0.3)\n}\n.dark\\:mint-bg-amber-400:is(.dark *) {\n --tw-bg-opacity: 1;\n background-color: rgb(251 191 36 / var(--tw-bg-opacity, 1))\n}\n.dark\\:mint-bg-amber-400\\/10:is(.dark *) {\n background-color: rgb(251 191 36 / 0.1)\n}\n.dark\\:mint-text-amber-100:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(254 243 199 / var(--tw-text-opacity, 1))\n}\n.dark\\:mint-text-amber-950:is(.dark *) {\n --tw-text-opacity: 1;\n color: rgb(69 26 3 / var(--tw-text-opacity, 1))\n}","openApiReferenceData":{"operation":{"summary":"Chat Completions","description":"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.","operationId":"create_chat_completion","x-codeSamples":[{"lang":"bash","label":"cURL","source":"curl https://api.vachana.ai/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"X-API-Key-ID: $GNANI_API_KEY\" \\\n -d '{\n \"model\": \"evon-v3.5\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"}\n ],\n \"temperature\": 0.3,\n \"max_tokens\": 512,\n \"reasoning_effort\": \"none\"\n }'\n"},{"lang":"python","label":"Python (OpenAI SDK)","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n base_url=\"https://api.vachana.ai/v1\",\n api_key=os.environ[\"GNANI_API_KEY\"],\n)\n\ncompletion = client.chat.completions.create(\n model=\"evon-v3.5\",\n messages=[\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"},\n ],\n temperature=0.3,\n max_tokens=512,\n reasoning_effort=\"none\",\n)\n\nchoice = completion.choices[0]\nprint(choice.message.content)\nif choice.finish_reason == \"length\":\n print(\"(the reply was cut short; raise max_tokens)\")\nprint(completion.usage)\n"},{"lang":"javascript","label":"JavaScript (OpenAI SDK)","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n baseURL: \"https://api.vachana.ai/v1\",\n apiKey: process.env.GNANI_API_KEY,\n});\n\nconst completion = await client.chat.completions.create({\n model: \"evon-v3.5\",\n messages: [\n { role: \"system\", content: \"You are a helpful assistant. Answer in one or two sentences.\" },\n { role: \"user\", content: \"What is the capital of Karnataka?\" },\n ],\n temperature: 0.3,\n max_tokens: 512,\n reasoning_effort: \"none\",\n});\n\nconst choice = completion.choices[0];\nconsole.log(choice.message.content);\nif (choice.finish_reason === \"length\") {\n console.log(\"(the reply was cut short; raise max_tokens)\");\n}\nconsole.log(completion.usage);\n"},{"lang":"python","label":"Python (requests)","source":"import os\nimport requests\n\nresponse = requests.post(\n \"https://api.vachana.ai/v1/chat/completions\",\n headers={\"X-API-Key-ID\": os.environ[\"GNANI_API_KEY\"]},\n json={\n \"model\": \"evon-v3.5\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"},\n ],\n \"temperature\": 0.3,\n \"max_tokens\": 512,\n \"reasoning_effort\": \"none\",\n },\n timeout=300,\n)\n\nbody = response.json()\nif response.ok:\n print(body[\"choices\"][0][\"message\"][\"content\"])\nelse:\n # LLM errors use {\"error\": {...}}; authentication and rate-limit errors use {\"detail\": {...}}\n error = body.get(\"error\") or body.get(\"detail\") or {}\n print(response.status_code, error.get(\"code\") or error.get(\"error_code\"), error.get(\"message\"))\n"}],"parameters":["8d475ff0-89b3-414f-83f0-23583e190f2b","89c73200-3700-49f1-af46-12872551818a"],"requestBody":"37818ba1-6402-4b51-9c78-560eb7350a53","responses":{"200":"37f8d04e-e1e3-4f48-8161-41920212795b","400":"c0557124-8e29-437a-bea4-174622fe5c21","401":"ef92950a-4c0d-4dc1-b66f-0b9a8f1b6ed4","403":"9d044289-8218-40dc-b907-08a91605ebb1","404":"09b20636-5e0a-45c4-b42e-d5ee45f3d902","413":"f0b3e102-af6e-49ce-b380-9a950de35c8b","429":"c2127697-75c8-416b-b977-5154390b02d1","500":"39b26260-76b9-49f1-a646-6861d6034e3d","502":"255f08ad-c170-44b6-98bb-c724e5d1e4c6","503":"2bfa7064-2cc4-478f-b596-5581b891e87c","504":"cc87599e-3b65-4042-9d09-cdaba60392c3"},"method":"post","type":"path","servers":["f9ffce58-5d39-425a-a759-9b7ec8a3c6aa"],"security":[],"path":"/v1/chat/completions","baseUrlOptions":["https://api.vachana.ai"],"title":"Chat Completions","codeSamples":[{"label":"cURL","lang":"bash","source":"curl https://api.vachana.ai/v1/chat/completions \\\n -H \"Content-Type: application/json\" \\\n -H \"X-API-Key-ID: $GNANI_API_KEY\" \\\n -d '{\n \"model\": \"evon-v3.5\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"}\n ],\n \"temperature\": 0.3,\n \"max_tokens\": 512,\n \"reasoning_effort\": \"none\"\n }'\n"},{"label":"Python (OpenAI SDK)","lang":"python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n base_url=\"https://api.vachana.ai/v1\",\n api_key=os.environ[\"GNANI_API_KEY\"],\n)\n\ncompletion = client.chat.completions.create(\n model=\"evon-v3.5\",\n messages=[\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"},\n ],\n temperature=0.3,\n max_tokens=512,\n reasoning_effort=\"none\",\n)\n\nchoice = completion.choices[0]\nprint(choice.message.content)\nif choice.finish_reason == \"length\":\n print(\"(the reply was cut short; raise max_tokens)\")\nprint(completion.usage)\n"},{"label":"JavaScript (OpenAI SDK)","lang":"javascript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n baseURL: \"https://api.vachana.ai/v1\",\n apiKey: process.env.GNANI_API_KEY,\n});\n\nconst completion = await client.chat.completions.create({\n model: \"evon-v3.5\",\n messages: [\n { role: \"system\", content: \"You are a helpful assistant. Answer in one or two sentences.\" },\n { role: \"user\", content: \"What is the capital of Karnataka?\" },\n ],\n temperature: 0.3,\n max_tokens: 512,\n reasoning_effort: \"none\",\n});\n\nconst choice = completion.choices[0];\nconsole.log(choice.message.content);\nif (choice.finish_reason === \"length\") {\n console.log(\"(the reply was cut short; raise max_tokens)\");\n}\nconsole.log(completion.usage);\n"},{"label":"Python (requests)","lang":"python","source":"import os\nimport requests\n\nresponse = requests.post(\n \"https://api.vachana.ai/v1/chat/completions\",\n headers={\"X-API-Key-ID\": os.environ[\"GNANI_API_KEY\"]},\n json={\n \"model\": \"evon-v3.5\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are a helpful assistant. Answer in one or two sentences.\"},\n {\"role\": \"user\", \"content\": \"What is the capital of Karnataka?\"},\n ],\n \"temperature\": 0.3,\n \"max_tokens\": 512,\n \"reasoning_effort\": \"none\",\n },\n timeout=300,\n)\n\nbody = response.json()\nif response.ok:\n print(body[\"choices\"][0][\"message\"][\"content\"])\nelse:\n # LLM errors use {\"error\": {...}}; authentication and rate-limit errors use {\"detail\": {...}}\n error = body.get(\"error\") or body.get(\"detail\") or {}\n print(response.status_code, error.get(\"code\") or error.get(\"error_code\"), error.get(\"message\"))\n"}],"requestExampleLanguages":["bash","python","javascript"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"You are a helpful assistant. Answer in one or two sentences.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"What is the capital of Karnataka?","body.model":"evon-v3.5","body.max_tokens":512,"body.temperature":0.3,"body.reasoning_effort":"none"},{"body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"You are a helpful assistant. Reply in Hindi, in one or two sentences.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"UPI से पैसे कैसे भेजते हैं?","body.model":"evon-v3.5","body.reasoning_effort":"none"},{"body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.0":"Plan a 3-day trip to Hampi on a student budget.","body.model":"evon-v3.5","body.max_tokens":1024,"body.reasoning_budget":256},{"body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"Extract the appointment details from the message.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"Can I see Dr. Rao on Friday at 4 pm? It's for my knee.","body.model":"evon-v3.5","body.temperature":0,"body.reasoning_effort":"none","body.response_format.oneOf.1.type":"json_schema","body.response_format.oneOf.1.json_schema.name":"appointment","body.response_format.oneOf.1.json_schema.schema":{"type":"object","properties":{"doctor":{"type":"string"},"day":{"type":"string"},"time":{"type":"string"},"reason":{"type":"string"}},"required":["doctor","day","time","reason"],"additionalProperties":false}},{"body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"You are a support assistant for an online store.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"Where is my order ORD-48213?","body.model":"evon-v3.5","body.reasoning_effort":"none","body.tools.items.0.oneOf.0.type":"function","body.tools.items.0.oneOf.0.function.name":"get_order_status","body.tools.items.0.oneOf.0.function.description":"Look up the delivery status of a customer's order.","body.tools.items.0.oneOf.0.function.parameters":{"type":"object","properties":{"order_id":{"type":"string","description":"The order ID, for example ORD-48213."}},"required":["order_id"]}},{"body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.0":"Will it rain in Mumbai this weekend?","body.model":"evon-v3.5","body.tools.items.0.oneOf.1.type":"web_search"},{"body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"You are a helpful assistant. Answer in one or two sentences.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"What is the capital of Karnataka?","body.model":"evon-v3.5","body.stream":true,"body.stream_options.include_usage":true,"body.reasoning_effort":"none"}]},"dependencies":{"parameters":{"8d475ff0-89b3-414f-83f0-23583e190f2b":{"name":"X-API-Key-ID","in":"header","required":true,"description":"Your Gnani API key. You can send it as `Authorization: Bearer \u003ckey>` instead.","schema":{"type":"string","isRequired":true,"description":"Your Gnani API key. You can send it as `Authorization: Bearer \u003ckey>` instead.","uniqueKey":"","typeLabel":"string"}},"89c73200-3700-49f1-af46-12872551818a":{"name":"X-API-Request-ID","in":"header","required":false,"description":"Your own ID for this request. It is returned in the `X-API-Request-ID` response header.","schema":{"type":"string","isRequired":false,"description":"Your own ID for this request. It is returned in the `X-API-Request-ID` response header.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"description":"Only `messages` is required. Every other field has a default.\n\n**Every value is checked before the model runs.** A value of the wrong\ntype or out of range is refused with `400 invalid_request`, and the\nmessage names the field, for example\n`temperature must be between 0 and 2, got -1`. Sending `null` for a\nfield means \"use the default\". Fields that are not listed here are\nignored.\n","properties":{"messages":{"type":"array","minItems":1,"description":"The conversation so far, oldest message first. At least one\nmessage. Send every turn on every request.\n","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"],"description":"Who wrote the message.\n\n| Value | Meaning |\n| --- | --- |\n| `system` | Your instructions for the whole conversation. Put it first. |\n| `developer` | Same as `system`. |\n| `user` | Your end user's message. |\n| `assistant` | One of the model's earlier replies. |\n| `tool` | The result of a function call. Needs `tool_call_id`. |\n","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"The text of the message. Send a string, or a non-empty list of\ntext parts such as `[{\"type\": \"text\", \"text\": \"Hello\"}]`.\n\nRequired on every message. The only exception is an `assistant`\nmessage that has `tool_calls`, where `content` may be left out or\n`null`. A message without `content` is refused with\n`400 invalid_request` (`messages[0].content is required`).\n","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","const":"text","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].text","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"The text of the message. Send a string, or a non-empty list of\ntext parts such as `[{\"type\": \"text\", \"text\": \"Hello\"}]`.\n\nRequired on every message. The only exception is an `assistant`\nmessage that has `tool_calls`, where `content` may be left out or\n`null`. A message without `content` is refused with\n`400 invalid_request` (`messages[0].content is required`).\n","minItems":1,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"},{"type":"null","description":"The text of the message. Send a string, or a non-empty list of\ntext parts such as `[{\"type\": \"text\", \"text\": \"Hello\"}]`.\n\nRequired on every message. The only exception is an `assistant`\nmessage that has `tool_calls`, where `content` may be left out or\n`null`. A message without `content` is refused with\n`400 invalid_request` (`messages[0].content is required`).\n","uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[] | null"},"name":{"type":"string","description":"Optional name of the author, to tell participants apart.","uniqueKey":"messages.items.[INDEX].name","typeLabel":"string"},"tool_calls":{"type":"array","description":"**Only on `assistant` messages.** The tool calls from the model's\nearlier reply, copied unchanged. See\n[Tool calling](/api/LLM/tool-calling).\n","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","const":"function","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].type","typeLabel":"string"},"function":{"type":"object","required":["name","arguments"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"The arguments as a JSON-encoded string, written by the model. Validate it before use.","isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"object[]"},"tool_call_id":{"type":"string","description":"**Only on `tool` messages, where it is required.** The `id` of the\ntool call that this message answers.\n","uniqueKey":"messages.items.[INDEX].tool_call_id","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"model":{"type":"string","default":"evon-v3.5","description":"The model to use. `evon-v3.5` is the only model; leave it out\nto use it. Another name returns `404 model_not_found`.\n","uniqueKey":"model","typeLabel":"string"},"stream":{"type":"boolean","default":false,"description":"Send `true` to receive the reply as Server-Sent Events while the\nmodel writes it. See [Streaming](/api/LLM/streaming).\n","uniqueKey":"stream","typeLabel":"boolean"},"stream_options":{"type":"object","description":"Only allowed when `stream` is `true`.","properties":{"include_usage":{"type":"boolean","default":false,"description":"Add a last chunk, with an empty `choices` list, that carries token `usage`.","uniqueKey":"stream_options.include_usage","typeLabel":"boolean"}},"uniqueKey":"stream_options","typeLabel":"object"},"max_tokens":{"type":"integer","minimum":1,"maximum":131072,"description":"The most tokens the reply may use, **thinking included**. From `1`\nup to your plan's maximum. If the reply reaches it, it is cut short and\n`finish_reason` is `length`.\n\nOn Free and Pay-as-you-go plans the maximum is **1,024**, and a\nrequest without `max_tokens` gets 1,024. A larger value returns\n`400 invalid_request`\n(`max_tokens is 2048; the maximum for your plan is 1024.`). On\nEnterprise plans, the input plus `max_tokens` must fit in the\n128K-token (131,072) context window. See [Limits](/api/LLM/limits).\n","uniqueKey":"max_tokens","typeLabel":"integer"},"max_completion_tokens":{"type":"integer","minimum":1,"maximum":131072,"description":"Another name for `max_tokens`. If you send both, they must be equal.","uniqueKey":"max_completion_tokens","typeLabel":"integer"},"temperature":{"type":"number","minimum":0,"maximum":2,"default":0.6,"description":"How random the reply is, from `0` to `2`. Lower is more focused\nand repeatable; higher is more varied. Use low values (`0`–`0.3`)\nfor factual answers, extraction and classification, and higher\nvalues for creative writing.\n","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","exclusiveMinimum":0,"maximum":1,"default":0.95,"description":"Nucleus sampling, above `0` and up to `1`. The model picks only\nfrom the most likely tokens whose probabilities add up to `top_p`.\nChange `temperature` or `top_p`, not usually both.\n","uniqueKey":"top_p","typeLabel":"number"},"stop":{"oneOf":[{"type":"string","description":"Up to 4 sequences where the model stops writing. The stop sequence\nis not included in the reply. Empty strings are refused.\n","minLength":1,"uniqueKey":"stop.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","minLength":1,"uniqueKey":"stop.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the model stops writing. The stop sequence\nis not included in the reply. Empty strings are refused.\n","maxItems":4,"uniqueKey":"stop.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"stop","typeLabel":"string | string[]"},"seed":{"type":"integer","description":"Makes sampling repeatable: the same request with the same seed\ntends to give the same reply. It is not guaranteed.\n","uniqueKey":"seed","typeLabel":"integer"},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2,"default":0,"description":"From `-2` to `2`. Positive values make the model less likely to repeat the same words.","uniqueKey":"frequency_penalty","typeLabel":"number"},"presence_penalty":{"type":"number","minimum":-2,"maximum":2,"default":0,"description":"From `-2` to `2`. Positive values make the model more likely to move on to new topics.","uniqueKey":"presence_penalty","typeLabel":"number"},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high"],"description":"`none` turns thinking off. `minimal`, `low`, `medium` and `high`\nleave it on, and do not change how long the model thinks. See\n[Thinking](/api/LLM/thinking).\n","uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring>"},"enable_thinking":{"type":"boolean","default":true,"description":"Turns thinking on or off. If you send it with `reasoning_effort`,\n`enable_thinking` wins. Not part of OpenAI's API; with OpenAI's\nPython SDK, pass it in `extra_body`.\n","uniqueKey":"enable_thinking","typeLabel":"boolean"},"reasoning_budget":{"type":"integer","minimum":0,"maximum":65536,"default":32768,"description":"The most tokens the model may spend thinking, from `0` to `65536`.\n`0` sets no budget. Thinking also counts toward `max_tokens`. Not\npart of OpenAI's API; with OpenAI's Python SDK, pass it in\n`extra_body`.\n","uniqueKey":"reasoning_budget","typeLabel":"integer"},"tools":{"type":"array","description":"Functions the model may ask you to run, each\n`{\"type\": \"function\", \"function\": {\"name\", \"description\", \"parameters\"}}`.\n`parameters` is a JSON Schema. See\n[Tool calling](/api/LLM/tool-calling).\n\nAdd `{\"type\": \"web_search\"}` to let the model search the web. The\nservice runs the searches itself. See\n[Web search](/api/LLM/web-search).\n","items":{"oneOf":[{"type":"object","required":["type","function"],"properties":{"type":{"type":"string","const":"function","isRequired":true,"uniqueKey":"tools.items.[INDEX].oneOf.0.type","typeLabel":"string"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tools.items.[INDEX].oneOf.0.function.name","typeLabel":"string"},"description":{"type":"string","uniqueKey":"tools.items.[INDEX].oneOf.0.function.description","typeLabel":"string"},"parameters":{"type":"object","description":"A JSON Schema for the function's arguments.","uniqueKey":"tools.items.[INDEX].oneOf.0.function.parameters","typeLabel":"object"}},"isRequired":true,"uniqueKey":"tools.items.[INDEX].oneOf.0.function","typeLabel":"object"}},"uniqueKey":"tools.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"web_search","isRequired":true,"uniqueKey":"tools.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"tools.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"tool_choice":{"oneOf":[{"type":"string","description":"Whether and which tool the model calls. Default `auto`.\n\n| Value | Meaning |\n| --- | --- |\n| `auto` | The model decides. |\n| `none` | The model does not call any tool. |\n| `required` | The model must call a tool. Allowed only when `tools` has exactly one tool. |\n| `{\"type\": \"function\", \"function\": {\"name\": \"get_weather\"}}` | The model must call this function. It must be in `tools`. |\n\nWith `web_search` in `tools`, only `auto` and `none` are allowed.\n","enum":["auto","none","required"],"uniqueKey":"tool_choice.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Whether and which tool the model calls. Default `auto`.\n\n| Value | Meaning |\n| --- | --- |\n| `auto` | The model decides. |\n| `none` | The model does not call any tool. |\n| `required` | The model must call a tool. Allowed only when `tools` has exactly one tool. |\n| `{\"type\": \"function\", \"function\": {\"name\": \"get_weather\"}}` | The model must call this function. It must be in `tools`. |\n\nWith `web_search` in `tools`, only `auto` and `none` are allowed.\n","required":["type","function"],"properties":{"type":{"type":"string","const":"function","isRequired":true,"uniqueKey":"tool_choice.oneOf.1.type","typeLabel":"string"},"function":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tool_choice.oneOf.1.function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"tool_choice.oneOf.1.function","typeLabel":"object"}},"uniqueKey":"tool_choice.oneOf.1","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"enum\u003cstring> | object"},"parallel_tool_calls":{"type":"boolean","description":"Whether the model may ask for more than one function call in one reply.","uniqueKey":"parallel_tool_calls","typeLabel":"boolean"},"response_format":{"oneOf":[{"type":"object","description":"`{\"type\": \"text\"}` (the default), `{\"type\": \"json_object\"}` for a\nJSON reply, or\n`{\"type\": \"json_schema\", \"json_schema\": {\"name\": \"...\", \"schema\": {...}}}`\nfor JSON that follows your schema. See\n[JSON output](/api/LLM/structured-outputs).\n","required":["type"],"properties":{"type":{"type":"string","enum":["text","json_object"],"isRequired":true,"uniqueKey":"response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.0","typeLabel":"object"},{"type":"object","description":"`{\"type\": \"text\"}` (the default), `{\"type\": \"json_object\"}` for a\nJSON reply, or\n`{\"type\": \"json_schema\", \"json_schema\": {\"name\": \"...\", \"schema\": {...}}}`\nfor JSON that follows your schema. See\n[JSON output](/api/LLM/structured-outputs).\n","required":["type","json_schema"],"properties":{"type":{"type":"string","const":"json_schema","isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"string"},"json_schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"response_format.oneOf.1.json_schema.name","typeLabel":"string"},"schema":{"type":"object","uniqueKey":"response_format.oneOf.1.json_schema.schema","typeLabel":"object"},"strict":{"type":"boolean","uniqueKey":"response_format.oneOf.1.json_schema.strict","typeLabel":"boolean"}},"isRequired":true,"uniqueKey":"response_format.oneOf.1.json_schema","typeLabel":"object"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"object"}],"uniqueKey":"response_format","typeLabel":"object"},"top_k":{"type":"integer","minimum":-1,"default":40,"description":"The model picks only from the `top_k` most likely next tokens.\n`-1` or `0` means no limit; otherwise a positive integer. Not part of OpenAI's\nAPI; with OpenAI's Python SDK, pass it in `extra_body`.\n","uniqueKey":"top_k","typeLabel":"integer"},"min_p":{"type":"number","minimum":0,"maximum":1,"description":"From `0` to `1`. Leaves out tokens that are less likely than\n`min_p` times the most likely one. Not part of OpenAI's API; with\nOpenAI's Python SDK, pass it in `extra_body`.\n","uniqueKey":"min_p","typeLabel":"number"},"typical_p":{"type":"number","exclusiveMinimum":0,"maximum":1,"description":"Typical sampling, above `0` and up to `1`. `1` turns it off. Not\npart of OpenAI's API; with OpenAI's Python SDK, pass it in\n`extra_body`.\n","uniqueKey":"typical_p","typeLabel":"number"},"repetition_penalty":{"type":"number","exclusiveMinimum":0,"maximum":2,"default":1,"description":"Above `0` and up to `2`. Values above `1` discourage repetition;\n`1` turns it off. Not part of OpenAI's API; with OpenAI's Python\nSDK, pass it in `extra_body`.\n","uniqueKey":"repetition_penalty","typeLabel":"number"},"no_repeat_ngram_size":{"type":"integer","minimum":0,"maximum":20,"default":0,"description":"From `0` to `20`. The reply never repeats a run of this many\ntokens. `0` turns it off. Not part of OpenAI's API; with OpenAI's\nPython SDK, pass it in `extra_body`.\n","uniqueKey":"no_repeat_ngram_size","typeLabel":"integer"},"user":{"type":"string","description":"An ID for your end user, for your own tracking.","uniqueKey":"user","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"Basic request","value":{"model":"evon-v3.5","messages":[{"role":"system","content":"You are a helpful assistant. Answer in one or two sentences."},{"role":"user","content":"What is the capital of Karnataka?"}],"temperature":0.3,"max_tokens":512,"reasoning_effort":"none"}},"hindi":{"title":"hindi","summary":"Reply in Hindi","value":{"model":"evon-v3.5","messages":[{"role":"system","content":"You are a helpful assistant. Reply in Hindi, in one or two sentences."},{"role":"user","content":"UPI से पैसे कैसे भेजते हैं?"}],"reasoning_effort":"none"}},"thinking":{"title":"thinking","summary":"Thinking with a budget","value":{"model":"evon-v3.5","max_tokens":1024,"reasoning_budget":256,"messages":[{"role":"user","content":"Plan a 3-day trip to Hampi on a student budget."}]}},"json_schema":{"title":"json_schema","summary":"JSON that follows a schema","value":{"model":"evon-v3.5","reasoning_effort":"none","temperature":0,"messages":[{"role":"system","content":"Extract the appointment details from the message."},{"role":"user","content":"Can I see Dr. Rao on Friday at 4 pm? It's for my knee."}],"response_format":{"type":"json_schema","json_schema":{"name":"appointment","schema":{"type":"object","properties":{"doctor":{"type":"string"},"day":{"type":"string"},"time":{"type":"string"},"reason":{"type":"string"}},"required":["doctor","day","time","reason"],"additionalProperties":false}}}}},"tool_call":{"title":"tool_call","summary":"Tool calling","value":{"model":"evon-v3.5","reasoning_effort":"none","messages":[{"role":"system","content":"You are a support assistant for an online store."},{"role":"user","content":"Where is my order ORD-48213?"}],"tools":[{"type":"function","function":{"name":"get_order_status","description":"Look up the delivery status of a customer's order.","parameters":{"type":"object","properties":{"order_id":{"type":"string","description":"The order ID, for example ORD-48213."}},"required":["order_id"]}}}]}},"web_search":{"title":"web_search","summary":"Web search","value":{"model":"evon-v3.5","messages":[{"role":"user","content":"Will it rain in Mumbai this weekend?"}],"tools":[{"type":"web_search"}]}},"streaming":{"title":"streaming","summary":"Streaming, with usage","value":{"model":"evon-v3.5","stream":true,"stream_options":{"include_usage":true},"messages":[{"role":"system","content":"You are a helpful assistant. Answer in one or two sentences."},{"role":"user","content":"What is the capital of Karnataka?"}],"reasoning_effort":"none"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"37f8d04e-e1e3-4f48-8161-41920212795b":{"description":"`application/json` (a `chat.completion` object) by default, or\n`text/event-stream` (`chat.completion.chunk` events ending in\n`data: [DONE]`) when `stream` is `true`.\n","headers":{"X-API-Request-ID":{"description":"The request ID. Quote it when you contact support.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["id","object","choices"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","const":"chat.completion","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer","isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"finish_reason":{"oneOf":[{"type":"string","description":"`stop`, `length`, `tool_calls` or `content_filter`.","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"string"},{"type":"null","description":"`stop`, `length`, `tool_calls` or `content_filter`.","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"string | null"},"message":{"type":"object","required":["role"],"properties":{"role":{"type":"string","const":"assistant","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","description":"The reply. `null` when the model only calls tools.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The reply. `null` when the model only calls tools.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"},"reasoning":{"oneOf":[{"type":"string","description":"The model's thinking, when thinking is on.","uniqueKey":"choices.items.[INDEX].message.reasoning.oneOf.0","typeLabel":"string"},{"type":"null","description":"The model's thinking, when thinking is on.","uniqueKey":"choices.items.[INDEX].message.reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.reasoning","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","const":"function","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string"},"function":{"type":"object","required":["name","arguments"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","description":"The arguments as a JSON-encoded string, written by the model. Validate it before use.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","required":["name","arguments"],"properties":{"name":{"type":"string"},"arguments":{"type":"string","description":"The arguments as a JSON-encoded string, written by the model. Validate it before use."}}}}},"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.tool_calls","typeLabel":"object[] | null"},"web_search":{"type":"object","description":"Present when the model searched the web.","properties":{"queries":{"type":"array","items":{"type":"string","uniqueKey":"choices.items.[INDEX].message.web_search.queries.items.[INDEX]","typeLabel":"string"},"uniqueKey":"choices.items.[INDEX].message.web_search.queries","typeLabel":"string[]"},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"The number the answer cites, as `[id]`.","uniqueKey":"choices.items.[INDEX].message.web_search.sources.items.[INDEX].id","typeLabel":"integer"},"title":{"type":"string","uniqueKey":"choices.items.[INDEX].message.web_search.sources.items.[INDEX].title","typeLabel":"string"},"url":{"type":"string","uniqueKey":"choices.items.[INDEX].message.web_search.sources.items.[INDEX].url","typeLabel":"string"},"snippet":{"type":"string","uniqueKey":"choices.items.[INDEX].message.web_search.sources.items.[INDEX].snippet","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.web_search.sources.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].message.web_search.sources","typeLabel":"object[]"},"remaining_today":{"type":"integer","description":"Searches you have left today.","uniqueKey":"choices.items.[INDEX].message.web_search.remaining_today","typeLabel":"integer"}},"uniqueKey":"choices.items.[INDEX].message.web_search","typeLabel":"object"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"created":{"type":"integer","description":"Unix time, in seconds.","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","uniqueKey":"model","typeLabel":"string"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","description":"Input tokens.","isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","description":"Output tokens, thinking included.","isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"A plain reply","value":{"id":"chatcmpl-6b1f4f0c2a5e4d8b","object":"chat.completion","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"message":{"role":"assistant","content":"The capital of Karnataka is Bengaluru."},"finish_reason":"stop"}],"usage":{"prompt_tokens":41,"completion_tokens":9,"total_tokens":50}}},"tool_call":{"title":"tool_call","summary":"The model asks you to run a function","value":{"id":"chatcmpl-6b1f4f0c2a5e4d8c","object":"chat.completion","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"message":{"role":"assistant","content":null,"tool_calls":[{"id":"call_9f2c41","type":"function","function":{"name":"get_order_status","arguments":"{\"order_id\": \"ORD-48213\"}"}}]},"finish_reason":"tool_calls"}]}},"web_search":{"title":"web_search","summary":"An answer with web sources","value":{"id":"chatcmpl-6b1f4f0c2a5e4d8d","object":"chat.completion","created":1794390000,"model":"evon-v3.5","choices":[{"index":0,"message":{"role":"assistant","content":"Light rain is likely in Mumbai on Saturday, with a drier Sunday [1]. Carry an umbrella if you are out on Saturday afternoon [2].","web_search":{"queries":["Mumbai weather forecast this weekend"],"sources":[{"id":1,"title":"Mumbai weekend forecast","url":"https://example.com/mumbai-forecast","snippet":"Saturday: light showers in the afternoon. Sunday: partly cloudy..."},{"id":2,"title":"Monsoon update for the Konkan coast","url":"https://example.org/konkan-update","snippet":"Isolated showers are expected along the coast on Saturday..."}],"remaining_today":9}},"finish_reason":"stop"}],"usage":{"prompt_tokens":1630,"completion_tokens":112,"total_tokens":1742}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"type":"string","description":"Server-Sent Events. Each `data:` line holds one `chat.completion.chunk`; the last is `data: [DONE]`.","uniqueKey":"","typeLabel":"string"},"example":"data: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"The capital of Karnataka\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is Bengaluru.\"},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n","examples":{"Example":{"title":"Example","value":"data: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"The capital of Karnataka\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-6b1f4f0c2a5e4d8b\",\"object\":\"chat.completion.chunk\",\"created\":1794390000,\"model\":\"evon-v3.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is Bengaluru.\"},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]\n"}},"exampleType":"examples"}},"exampleType":"examples"},"c0557124-8e29-437a-bea4-174622fe5c21":{"description":"The request is invalid, too long, or was refused by the safety filters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invalid_request":{"title":"invalid_request","summary":"A parameter is out of range","value":{"error":{"message":"temperature must be between 0 and 2, got -1","type":"invalid_request_error","param":null,"code":"invalid_request"}}},"context_length_exceeded":{"title":"context_length_exceeded","summary":"The input is too long","value":{"error":{"message":"The input is about 70120 tokens; the limit is 63488.","type":"invalid_request_error","param":null,"code":"context_length_exceeded"}}},"content_filter":{"title":"content_filter","summary":"Refused by the safety filters","value":{"error":{"message":"The request was blocked by the input guardrails.","type":"invalid_request_error","param":null,"code":"content_filter"}}}},"exampleType":"examples"}},"exampleType":"examples"},"ef92950a-4c0d-4dc1-b66f-0b9a8f1b6ed4":{"description":"The API key is missing or not valid.","content":{"application/json":{"schema":{"type":"object","description":"Authentication and request-rate errors use this shape.","properties":{"detail":{"type":"object","properties":{"error_code":{"type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"type":"string","uniqueKey":"detail.message","typeLabel":"string"},"status_code":{"type":"integer","uniqueKey":"detail.status_code","typeLabel":"integer"}},"uniqueKey":"detail","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"detail":{"error_code":"MISSING_API_KEY","message":"Missing API key","status_code":401}},"examples":{"Example":{"title":"Example","value":{"detail":{"error_code":"MISSING_API_KEY","message":"Missing API key","status_code":401}}}},"exampleType":"examples"}},"exampleType":"examples"},"9d044289-8218-40dc-b907-08a91605ebb1":{"description":"The API key does not have access to the LLM API.","content":{"application/json":{"schema":{"type":"object","description":"Authentication and request-rate errors use this shape.","properties":{"detail":{"type":"object","properties":{"error_code":{"type":"string","uniqueKey":"detail.error_code","typeLabel":"string"},"message":{"type":"string","uniqueKey":"detail.message","typeLabel":"string"},"status_code":{"type":"integer","uniqueKey":"detail.status_code","typeLabel":"integer"}},"uniqueKey":"detail","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"detail":{"error_code":"SCOPE_NOT_ALLOWED","message":"Service 'LLM' not in allowed scopes","status_code":403}},"examples":{"Example":{"title":"Example","value":{"detail":{"error_code":"SCOPE_NOT_ALLOWED","message":"Service 'LLM' not in allowed scopes","status_code":403}}}},"exampleType":"examples"}},"exampleType":"examples"},"09b20636-5e0a-45c4-b42e-d5ee45f3d902":{"description":"`model` is not a model this API serves. Send `evon-v3.5`, or leave out `model`.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"model_not_found":{"title":"model_not_found","summary":"Unknown model","value":{"error":{"message":"`model` is not a model this API serves.","type":"invalid_request_error","param":null,"code":"model_not_found"}}}},"exampleType":"examples"}},"exampleType":"examples"},"f0b3e102-af6e-49ce-b380-9a950de35c8b":{"description":"The body is over 10 MB, or the messages hold more than 1 MB of text. Send less text.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"request_too_large":{"title":"request_too_large","summary":"The request is too large","value":{"error":{"message":"The body is over 10 MB, or the messages hold more than 1 MB of text.","type":"invalid_request_error","param":null,"code":"request_too_large"}}}},"exampleType":"examples"}},"exampleType":"examples"},"c2127697-75c8-416b-b977-5154390b02d1":{"description":"A rate limit or the daily token quota was reached. Wait for the\nnumber of seconds in `Retry-After` when it is sent.\n","headers":{"Retry-After":{"description":"The number of seconds to wait before retrying. Sent on some `429` responses; when it is sent, wait at least that long.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"oneOf":[{"type":"object","description":"Authentication and request-rate errors use this shape.","properties":{"detail":{"type":"object","properties":{"error_code":{"type":"string","uniqueKey":"oneOf.0.detail.error_code","typeLabel":"string"},"message":{"type":"string","uniqueKey":"oneOf.0.detail.message","typeLabel":"string"},"status_code":{"type":"integer","uniqueKey":"oneOf.0.detail.status_code","typeLabel":"integer"}},"uniqueKey":"oneOf.0.detail","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"oneOf.1.error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"oneOf.1.error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"oneOf.1.error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"oneOf.1.error","typeLabel":"object"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"rate_limited":{"title":"rate_limited","summary":"Too many requests","value":{"detail":{"error_code":"RATE_LIMITED","message":"Request rate exceeded: at most 60 requests per minute.","status_code":429}}},"daily_quota":{"title":"daily_quota","summary":"Daily token quota used up","value":{"error":{"message":"Daily token quota of 100000 tokens used up. It resets at midnight IST.","type":"rate_limit_error","param":null,"code":"daily_token_quota_exceeded"}}},"web_search_limit_exceeded":{"title":"web_search_limit_exceeded","summary":"Daily web searches used up","value":{"error":{"message":"You have used today's web searches.","type":"rate_limit_error","param":null,"code":"web_search_limit_exceeded"}}},"model_overloaded":{"title":"model_overloaded","summary":"The model is busy","value":{"error":{"message":"The model is busy.","type":"rate_limit_error","param":null,"code":"model_overloaded"}}}},"exampleType":"examples"}},"exampleType":"examples"},"39b26260-76b9-49f1-a646-6861d6034e3d":{"description":"Something went wrong on our side. Retry with backoff.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"internal_error":{"title":"internal_error","summary":"Internal error","value":{"error":{"message":"Something went wrong on our side.","type":"server_error","param":null,"code":"internal_error"}}}},"exampleType":"examples"}},"exampleType":"examples"},"255f08ad-c170-44b6-98bb-c724e5d1e4c6":{"description":"The model could not be reached or could not serve the request. Retry with backoff.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"upstream_error":{"title":"upstream_error","summary":"The model could not be reached","value":{"error":{"message":"The model could not be reached or could not serve the request.","type":"server_error","param":null,"code":"upstream_error"}}}},"exampleType":"examples"}},"exampleType":"examples"},"2bfa7064-2cc4-478f-b596-5581b891e87c":{"description":"The safety check could not run, or web search is not available. Retry with backoff.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"guardrail_unavailable":{"title":"guardrail_unavailable","summary":"The safety check could not run","value":{"error":{"message":"The safety check could not run, so the request was not sent to the model.","type":"server_error","param":null,"code":"guardrail_unavailable"}}},"web_search_unavailable":{"title":"web_search_unavailable","summary":"Web search is not available","value":{"error":{"message":"Web search is not available right now.","type":"server_error","param":null,"code":"web_search_unavailable"}}}},"exampleType":"examples"}},"exampleType":"examples"},"cc87599e-3b65-4042-9d09-cdaba60392c3":{"description":"The model did not respond in time. Retry, or ask for a shorter reply.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"upstream_timeout":{"title":"upstream_timeout","summary":"The model did not finish in time","value":{"error":{"message":"The model did not finish within the time limit.","type":"server_error","param":null,"code":"upstream_timeout"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"29d12aa3-8499-4d1f-ad36-ff61da3529c2":{"Key":{"name":"X-API-Key-ID","type":"apiKey","in":"header"}}},"servers":{"f9ffce58-5d39-425a-a759-9b7ec8a3c6aa":{"url":"https://api.vachana.ai","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"name":"X-API-Key-ID","type":"apiKey","in":"header"},"schema":{"title":"X-API-Key-ID","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Key","name":"X-API-Key-ID"}],"title":"Key"}]},"originalFileLocation":"LLM.yml"},"subdomain":"gnaniinnovationsprivatelimited","siteName":"Gnani AI Documentation","title":"Chat Completions API reference","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-17T16:59:39.581Z","originalFileLocation":"api/LLM/chat-completions.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=\"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Gnani AI 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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat Completions API reference\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Gnani AI Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gnani.ai/api/LLM/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://gnaniinnovationsprivatelimited.mintlify.site/_mintlify/api/og/v2?division=LLM\u0026amp;title=Chat+Completions\u0026amp;description=Generate+the+next+message+in+a+conversation.+OpenAI-compatible%2C+with+or+without+streaming.\u0026amp;theme=07070e9119adcc39f71f2fbc\u0026amp;signature=efad4b227bb7a1f92630999b23e2fb9a2270f31400ae42e05106758b184f2e09\">\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=\"Chat Completions API reference\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://gnaniinnovationsprivatelimited.mintlify.site/_mintlify/api/og/v2?division=LLM\u0026amp;title=Chat+Completions\u0026amp;description=Generate+the+next+message+in+a+conversation.+OpenAI-compatible%2C+with+or+without+streaming.\u0026amp;theme=07070e9119adcc39f71f2fbc\u0026amp;signature=efad4b227bb7a1f92630999b23e2fb9a2270f31400ae42e05106758b184f2e09\">\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/gnaniinnovationsprivatelimited/b9mY1NvMwd3p02_R/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Gnani AI Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1A1A1A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gnani.ai/api/LLM/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/LLM/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gnani.ai/#organization\",\"name\":\"Gnani AI Documentation\",\"url\":\"https://docs.gnani.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/gnaniinnovationsprivatelimited/07TQaHxEIXJZr-iJ/logo/favicon.svg?fit=max\u0026auto=format\u0026n=07TQaHxEIXJZr-iJ\u0026q=85\u0026s=feca06a904160c2b661bfa77fe1f90c4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gnani.ai#website\",\"name\":\"Gnani AI Documentation\",\"url\":\"https://docs.gnani.ai\",\"publisher\":{\"@id\":\"https://docs.gnani.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gnani.ai/api/LLM/chat-completions#webpage\",\"url\":\"https://docs.gnani.ai/api/LLM/chat-completions\",\"name\":\"Chat Completions\",\"description\":\"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\",\"dateModified\":\"2026-11-17T16:59:39.581Z\",\"isPartOf\":{\"@id\":\"https://docs.gnani.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gnani.ai/api/LLM/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gnani.ai/api/LLM/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"APIs\",\"item\":\"https://docs.gnani.ai/api/STT/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM\",\"item\":\"https://docs.gnani.ai/api/LLM/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Chat Completions\",\"item\":\"https://docs.gnani.ai/api/LLM/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gnani.ai/api/LLM/chat-completions#apireference\",\"headline\":\"Chat Completions\",\"name\":\"Chat Completions\",\"description\":\"Generate the next message in a conversation. OpenAI-compatible, with or without streaming.\",\"url\":\"https://docs.gnani.ai/api/LLM/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gnani.ai/api/LLM/chat-completions#webpage\"},\"dateModified\":\"2026-11-17T16:59:39.581Z\",\"keywords\":\"chat completions, API reference, parameters, response object, chunk object, usage, tool call, web search, OpenAI compatible\",\"publisher\":{\"@id\":\"https://docs.gnani.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gnani.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Gnani AI Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Gnani AI Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/LLM/chat-completions.md","siteName":"Gnani AI Documentation","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Gnani AI APIs","groups":[{"group":"Gnani APIs","pages":[{"title":"Introduction – Gnani Speech APIs","href":"/api/introduction/introduction"},{"title":"Quick Start","href":"/api/introduction/quick-start"},{"title":"LiveKit Plugin","href":"/livekit/introduction"},{"title":"Pipecat Plugin","href":"/pipecat/introduction"},{"group":"Python SDK","pages":[{"title":"Python SDK","href":"/python-sdk/introduction"},{"title":"Python SDK — Speech-to-Text","sidebarTitle":"Speech-to-Text","href":"/python-sdk/speech-to-text"},{"title":"Python SDK — Batch Speech-to-Text","sidebarTitle":"Batch Speech-to-Text","href":"/python-sdk/speech-to-text-batch"},{"title":"Python SDK — Text-to-Speech","sidebarTitle":"Text-to-Speech","href":"/python-sdk/text-to-speech"},{"title":"Python SDK — LLM","sidebarTitle":"LLM","href":"/python-sdk/llm"}]}]},{"group":"APIs","pages":[{"group":"Speech-to-Text","pages":[{"title":"Speech-to-Text","sidebarTitle":"Overview","href":"/api/STT/overview"},{"group":"Models","pages":[{"title":"Models","sidebarTitle":"Overview","href":"/api/STT/models/overview"},{"title":"Prisma v3.0","sidebarTitle":"Prisma v3.0","tag":"New","href":"/api/STT/models/prisma-v3"},{"title":"Prisma v2.5","sidebarTitle":"Prisma v2.5","tag":"Default","href":"/api/STT/models/prisma-v2-5"}]},{"title":"REST transcription","sidebarTitle":"REST transcription","openapi":"POST /stt/v3","href":"/api/STT/speech-to-text"},{"title":"Realtime streaming","sidebarTitle":"Realtime streaming","asyncapi":"api/STT/stt-websocket.yml stt","href":"/api/STT/stt-websocket"},{"group":"Batch transcription","pages":[{"title":"Batch transcription","sidebarTitle":"Batch transcription","href":"/api/STTBatch/Introduction"},{"title":"Create job","openapi":"STTBatch.yml POST /stt/v3/batch/jobs","href":"/api/STTBatch/Create_Job"},{"title":"Start job","openapi":"STTBatch.yml POST /stt/v3/batch/jobs/{job_id}/start","href":"/api/STTBatch/Start_Job"},{"title":"Get job status","openapi":"STTBatch.yml GET /stt/v3/batch/jobs/{job_id}","href":"/api/STTBatch/Get_Job"},{"title":"List jobs","openapi":"STTBatch.yml GET /stt/v3/batch/jobs","href":"/api/STTBatch/List_Jobs"},{"title":"Get job files","openapi":"STTBatch.yml GET /stt/v3/batch/jobs/{job_id}/files","href":"/api/STTBatch/Get_Job_Files"},{"title":"Cancel job","openapi":"STTBatch.yml POST /stt/v3/batch/jobs/{job_id}/cancel","href":"/api/STTBatch/Cancel_Job"}]},{"title":"Supported languages","sidebarTitle":"Supported languages","href":"/api/STT/languages"},{"title":"Limits","tag":"New","href":"/api/STT/limits"}]},{"group":"Text-to-Speech","pages":[{"title":"Available Voices","hidden":true,"href":"/api/TTS/available-voices"},{"title":"Text-to-Speech (REST)","openapi":"POST /api/v1/tts/inference","href":"/api/TTS/tts-inference"},{"title":"Text-to-Speech (Streaming)","openapi":"POST /api/v1/tts/sse","href":"/api/TTS/tts-sse"},{"title":"Text-to-Speech (Realtime)","asyncapi":"api/TTS/websocket.yml tts","href":"/api/TTS/tts-websocket"},{"title":"Audio Tags","tag":"New","href":"/api/TTS/tts-audio-tags"},{"title":"Text Normalization Guide","href":"/api/TTS/tts-input-formating"}]},{"group":"Voice Cloning","pages":[{"title":"Voice Clone Embeddings","openapi":"POST /api/v1/tts/voice-clone/embeddings","href":"/api/VC/voice-clone-embeddings"},{"title":"Voice Cloned TTS (REST)","openapi":"VC.yml POST /api/v1/tts/inference","href":"/api/VC/vc-inference"},{"title":"Voice Cloned TTS (Streaming)","openapi":"VC.yml POST /api/v1/tts/sse","href":"/api/VC/vc-sse"},{"title":"Voice Cloned TTS (Realtime)","asyncapi":"api/VC/vc-websocket.yml vc","href":"/api/VC/vc-websocket"}]},{"group":"LLM","tag":"Beta","pages":[{"title":"Gnani Evon API","sidebarTitle":"Overview","tag":"New","href":"/api/LLM/overview"},{"title":"Quickstart","description":"Get an API key and send your first request to the LLM API in a few minutes.","href":"/api/LLM/quickstart"},{"title":"Chat Completions","sidebarTitle":"Chat Completions","openapi":"POST /v1/chat/completions","href":"/api/LLM/chat-completions"},{"group":"Guides","expanded":true,"pages":[{"title":"Streaming","description":"Show the model's reply while it is being written, using Server-Sent Events.","href":"/api/LLM/streaming"},{"title":"Thinking","href":"/api/LLM/thinking"},{"title":"Tool calling","href":"/api/LLM/tool-calling"},{"title":"JSON output","href":"/api/LLM/structured-outputs"},{"title":"Web search","href":"/api/LLM/web-search"},{"title":"Indian languages","href":"/api/LLM/indian-languages"},{"title":"Migrating from OpenAI","sidebarTitle":"Migrating from OpenAI","href":"/api/LLM/openai-compatibility"}]},{"group":"Recipes","pages":[{"title":"Voice agent","href":"/api/LLM/recipes/voice-agent"},{"title":"Customer support bot","sidebarTitle":"Support bot","href":"/api/LLM/recipes/support-bot"},{"title":"Intent classification for Indian languages","sidebarTitle":"Intent classification","href":"/api/LLM/recipes/intent-classification"},{"title":"Q\u0026A with web search and citations","sidebarTitle":"Web search Q\u0026A","href":"/api/LLM/recipes/web-search-qa"}]},{"title":"Safety and privacy","href":"/api/LLM/safety"},{"title":"Limits","href":"/api/LLM/limits"},{"title":"Errors","href":"/api/LLM/errors"},{"title":"Changelog","href":"/api/LLM/changelog"}]}]},{"group":"Use Cases","pages":[{"title":"Podcast Transcription with Speaker Labels","href":"/api/use-cases/podcast-transcription"},{"title":"Call Analytics Pipeline","href":"/api/use-cases/call-analytics"},{"title":"Real-Time Quality \u0026 Compliance Monitoring","href":"/api/use-cases/real-time-compliance"}]},{"group":"Reference","pages":[{"title":"Error Reference","sidebarTitle":"Error Reference","tag":"New","href":"/api/introduction/errors"}]}]},{"tab":"Gnani AI Agents","pages":[{"title":"Gnani AI Agents","href":"/introduction"}]},{"tab":"Gnani AI Agent Builder APIs","pages":[{"title":"Gnani AI Agent Builder APIs","href":"/Platform/platform-introduction"}]}]},"basePath":"","title":"Chat Completions API reference","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-jJHA3WSo.js","utils-DbZn3Mjn.js","cloneDeep-CnBnaSyy.js","_Uint8Array-CMQtTgBR.js","isObject-FP1Yky1u.js","utils-Bl2DvzOJ.js","addUniqueKeysToSchema-BwOLo9p1.js","snippetPresets-BBiPpKa-.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-C0px4Tml.js","isEqual-zAyttAAO.js","usePlaygroundInputsStore-Dell6dGw.js","shallow-0VKqkSqN.js","getApiPlaygroundDisplay-CP_ctPEB.js","CodeSnippet-5L35ic0s.js","CodeSnippets-DOXbNhJw.js","Page-DRLI_2Ue.js","getPastedJson-VhzT9m2P.js","icon-CD8_AtCO.js","MethodPill-DGgOMftG.js","DuplicateIcon-DZ6A_EtN.js","createIcon-DUl4oM5f.js","DynamicMarkdown-BGHukeRM.js","SectionHeading-ChrEUs8u.js","axios-vUo_bRtp.js","Markdown-Dj-na-_-.js","dist-C5gjFYHe.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","katex-YMM-FMeD.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js","AssistantPageLink-DEBW87tT.js"]}