# Chat

## Create a chat completion

> Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.

```json
{"openapi":"3.0.3","info":{"title":"Create a chat completion","version":"endpoint_chat.sendChatCompletionRequest"},"servers":[{"url":"https://app.interactive.ai/api/v1","description":"Interactive AI API server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"API key as bearer token in Authorization header"}},"schemas":{"ChatResponse":{"type":"object","properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"$ref":"#/components/schemas/ChatResponseChoice"}},"created":{"type":"number","format":"double"},"model":{"type":"string"},"object":{"type":"string","enum":["chat.completion"]},"system_fingerprint":{"type":"string","nullable":true},"usage":{"$ref":"#/components/schemas/ChatGenerationTokenUsage"}},"required":["id","choices","created","model","object"]},"ChatResponseChoice":{"type":"object","properties":{"finish_reason":{"$ref":"#/components/schemas/__schema2"},"index":{"type":"number","format":"double"},"message":{"$ref":"#/components/schemas/AssistantMessage"},"reasoning_details":{"type":"array","items":{"$ref":"#/components/schemas/__schema3"}},"logprobs":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatMessageTokenLogprobs"}]}},"required":["finish_reason","index","message"]},"__schema2":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatCompletionFinishReason"}]},"ChatCompletionFinishReason":{"type":"string","enum":["tool_calls","stop","length","content_filter","error"]},"AssistantMessage":{"type":"object","properties":{"role":{"type":"string","enum":["assistant"]},"content":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/AssistantMessageContent"}]},"name":{"type":"string"},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageToolCall"}},"refusal":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true}},"required":["role"]},"AssistantMessageContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/AssistantMessageContent1"}]},"AssistantMessageContent1":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItem"}},"ChatMessageContentItem":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/ChatMessageContentItemCacheControl"}},"required":["type","text"],"description":"text variant"},{"type":"object","properties":{"type":{"type":"string","enum":["image_url"]},"image_url":{"$ref":"#/components/schemas/ChatMessageContentItemImageImageUrl"}},"required":["type","image_url"],"description":"image_url variant"},{"type":"object","properties":{"type":{"type":"string","enum":["input_audio"]},"input_audio":{"$ref":"#/components/schemas/ChatMessageContentItemAudioInputAudio"}},"required":["type","input_audio"],"description":"input_audio variant"},{"type":"object","properties":{"type":{"type":"string","enum":["input_video"]}},"required":["type"],"description":"input_video variant"},{"type":"object","properties":{"type":{"type":"string","enum":["video_url"]}},"required":["type"],"description":"video_url variant"}],"discriminator":{"propertyName":"type"}},"ChatMessageContentItemCacheControl":{"type":"object","properties":{"type":{"type":"string","enum":["ephemeral"]},"ttl":{"$ref":"#/components/schemas/ChatMessageContentItemCacheControlTtl"}},"required":["type"]},"ChatMessageContentItemCacheControlTtl":{"type":"string","enum":["5m","1h"]},"ChatMessageContentItemImageImageUrl":{"type":"object","properties":{"url":{"type":"string"},"detail":{"$ref":"#/components/schemas/ChatMessageContentItemImageImageUrlDetail"}},"required":["url"]},"ChatMessageContentItemImageImageUrlDetail":{"type":"string","enum":["auto","low","high"]},"ChatMessageContentItemAudioInputAudio":{"type":"object","properties":{"data":{"type":"string"},"format":{"type":"string"}},"required":["data","format"]},"ChatMessageToolCall":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["function"]},"function":{"$ref":"#/components/schemas/ChatMessageToolCallFunction"}},"required":["id","type","function"]},"ChatMessageToolCallFunction":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}},"required":["name","arguments"]},"__schema3":{"oneOf":[{"$ref":"#/components/schemas/Schema30"},{"$ref":"#/components/schemas/Schema31"},{"$ref":"#/components/schemas/Schema32"}]},"Schema30":{"type":"object","properties":{"type":{"type":"string","enum":["reasoning.summary"]},"summary":{"type":"string"},"id":{"$ref":"#/components/schemas/__schema4"},"format":{"$ref":"#/components/schemas/__schema5"},"index":{"$ref":"#/components/schemas/__schema6"}},"required":["type","summary"]},"__schema4":{"type":"string","nullable":true},"__schema5":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/Schema5"}]},"Schema5":{"type":"string","enum":["unknown","openai-responses-v1","xai-responses-v1","anthropic-claude-v1","google-gemini-v1"]},"__schema6":{"type":"number","format":"double"},"Schema31":{"type":"object","properties":{"type":{"type":"string","enum":["reasoning.encrypted"]},"data":{"type":"string"},"id":{"$ref":"#/components/schemas/__schema4"},"format":{"$ref":"#/components/schemas/__schema5"},"index":{"$ref":"#/components/schemas/__schema6"}},"required":["type","data"]},"Schema32":{"type":"object","properties":{"type":{"type":"string","enum":["reasoning.text"]},"text":{"type":"string","nullable":true},"signature":{"type":"string","nullable":true},"id":{"$ref":"#/components/schemas/__schema4"},"format":{"$ref":"#/components/schemas/__schema5"},"index":{"$ref":"#/components/schemas/__schema6"}},"required":["type"]},"ChatMessageTokenLogprobs":{"type":"object","properties":{"content":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ChatMessageTokenLogprob"}},"refusal":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ChatMessageTokenLogprob"}}},"required":["content","refusal"]},"ChatMessageTokenLogprob":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number","format":"double"},"bytes":{"type":"array","nullable":true,"items":{"type":"number","format":"double"}},"top_logprobs":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageTokenLogprobTopLogprobsItems"}}},"required":["token","logprob","bytes","top_logprobs"]},"ChatMessageTokenLogprobTopLogprobsItems":{"type":"object","properties":{"token":{"type":"string"},"logprob":{"type":"number","format":"double"},"bytes":{"type":"array","nullable":true,"items":{"type":"number","format":"double"}}},"required":["token","logprob","bytes"]},"ChatGenerationTokenUsage":{"type":"object","properties":{"completion_tokens":{"type":"number","format":"double"},"prompt_tokens":{"type":"number","format":"double"},"total_tokens":{"type":"number","format":"double"},"completion_tokens_details":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationTokenUsageCompletionTokensDetails"}]},"prompt_tokens_details":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationTokenUsagePromptTokensDetails"}]}},"required":["completion_tokens","prompt_tokens","total_tokens"]},"ChatGenerationTokenUsageCompletionTokensDetails":{"type":"object","properties":{"reasoning_tokens":{"type":"number","nullable":true,"format":"double"},"audio_tokens":{"type":"number","nullable":true,"format":"double"},"accepted_prediction_tokens":{"type":"number","nullable":true,"format":"double"},"rejected_prediction_tokens":{"type":"number","nullable":true,"format":"double"}}},"ChatGenerationTokenUsagePromptTokensDetails":{"type":"object","properties":{"cached_tokens":{"type":"number","format":"double"},"audio_tokens":{"type":"number","format":"double"},"video_tokens":{"type":"number","format":"double"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"An error code"},"message":{"type":"string","description":"A human-readable error message"},"param":{"type":"string","description":"The parameter that caused the error, if applicable"},"type":{"type":"string","description":"The type of error"}},"required":["code","message","param","type"]}},"required":["error"]},"ChatGenerationParams":{"type":"object","properties":{"provider":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsProvider"}],"description":"When multiple model providers are available, optionally indicate your routing preference."},"plugins":{"type":"array","items":{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItems"},"description":"Plugins you want to enable for this request, including their settings."},"route":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsRoute"}]},"user":{"type":"string"},"session_id":{"type":"string","description":"A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"model":{"$ref":"#/components/schemas/ModelName"},"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelName"}},"frequency_penalty":{"type":"number","nullable":true,"format":"double"},"logit_bias":{"type":"object","nullable":true,"additionalProperties":{"type":"number","format":"double"}},"logprobs":{"type":"boolean","nullable":true},"top_logprobs":{"type":"number","nullable":true,"format":"double"},"max_completion_tokens":{"type":"number","nullable":true,"format":"double"},"max_tokens":{"type":"number","nullable":true,"format":"double"},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"presence_penalty":{"type":"number","nullable":true,"format":"double"},"reasoning":{"$ref":"#/components/schemas/ChatGenerationParamsReasoning"},"response_format":{"$ref":"#/components/schemas/ChatGenerationParamsResponseFormat"},"seed":{"type":"integer","nullable":true},"stop":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsStop"}]},"stream":{"type":"boolean","default":false},"stream_options":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatStreamOptions"}]},"temperature":{"type":"number","nullable":true,"format":"double","default":1},"tool_choice":{"$ref":"#/components/schemas/ToolChoiceOption"},"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolDefinitionJson"}},"top_p":{"type":"number","nullable":true,"format":"double","default":1},"debug":{"$ref":"#/components/schemas/ChatGenerationParamsDebug"}},"required":["messages"]},"ChatGenerationParamsProvider":{"type":"object","properties":{"allow_fallbacks":{"type":"boolean","nullable":true,"description":"Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n"},"require_parameters":{"type":"boolean","nullable":true,"description":"Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest."},"data_collection":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsProviderDataCollection"}],"description":"Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."},"zdr":{"type":"boolean","nullable":true},"enforce_distillable_text":{"type":"boolean","nullable":true},"order":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/__schema0"}],"description":"An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."},"only":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/__schema0"}],"description":"List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."},"ignore":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/__schema0"}],"description":"List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."},"quantizations":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/ChatGenerationParamsProviderQuantizationsItems"},"description":"A list of quantization levels to filter the provider by."},"sort":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ProviderSortUnion"}],"description":"The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."},"max_price":{"$ref":"#/components/schemas/ChatGenerationParamsProviderMaxPrice","description":"The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."},"preferred_min_throughput":{"type":"number","nullable":true,"format":"double"},"preferred_max_latency":{"type":"number","nullable":true,"format":"double"},"min_throughput":{"type":"number","nullable":true,"format":"double"},"max_latency":{"type":"number","nullable":true,"format":"double"}}},"ChatGenerationParamsProviderDataCollection":{"type":"string","enum":["deny","allow"]},"__schema0":{"type":"array","items":{"$ref":"#/components/schemas/Schema0Items"}},"Schema0Items":{"oneOf":[{"$ref":"#/components/schemas/Schema0Items0"},{"type":"string"}]},"Schema0Items0":{"type":"string","enum":["AI21","AionLabs","Alibaba","Amazon Bedrock","Amazon Nova","Anthropic","Arcee AI","AtlasCloud","Avian","Azure","BaseTen","BytePlus","Black Forest Labs","Cerebras","Chutes","Cirrascale","Clarifai","Cloudflare","Cohere","Crusoe","DeepInfra","DeepSeek","Featherless","Fireworks","Friendli","GMICloud","GoPomelo","Google","Google AI Studio","Groq","Hyperbolic","Inception","InferenceNet","Infermatic","Inflection","Liquid","Mara","Mancer 2","Minimax","ModelRun","Mistral","Modular","Moonshot AI","Morph","NCompass","Nebius","NextBit","Novita","Nvidia","OpenAI","OpenInference","Parasail","Perplexity","Phala","Relace","SambaNova","SiliconFlow","Sourceful","Stealth","StreamLake","Switchpoint","Targon","Together","Venice","WandB","Xiaomi","xAI","Z.AI","FakeProvider"]},"ChatGenerationParamsProviderQuantizationsItems":{"type":"string","enum":["int4","int8","fp4","fp6","fp8","fp16","bf16","fp32","unknown"]},"ProviderSortUnion":{"oneOf":[{"$ref":"#/components/schemas/ProviderSort"},{"$ref":"#/components/schemas/ProviderSortConfig"}]},"ProviderSort":{"type":"string","enum":["price","throughput","latency"]},"ProviderSortConfig":{"type":"object","properties":{"by":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ProviderSort"}]},"partition":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ProviderSortConfigPartition"}]}}},"ProviderSortConfigPartition":{"type":"string","enum":["model","none"]},"ChatGenerationParamsProviderMaxPrice":{"type":"object","properties":{"prompt":{"$ref":"#/components/schemas/__schema1"},"completion":{"$ref":"#/components/schemas/__schema1"},"image":{"$ref":"#/components/schemas/__schema1"},"audio":{"$ref":"#/components/schemas/__schema1"},"request":{"$ref":"#/components/schemas/__schema1"}}},"__schema1":{"oneOf":[{"type":"number","format":"double"},{"type":"string"},{"type":"number","format":"double"}]},"ChatGenerationParamsPluginsItems":{"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItems0"},{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItems1"},{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItems2"},{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItems3"}]},"ChatGenerationParamsPluginsItems0":{"type":"object","properties":{"id":{"type":"string","enum":["moderation"]}},"required":["id"]},"ChatGenerationParamsPluginsItems1":{"type":"object","properties":{"id":{"type":"string","enum":["web"]},"enabled":{"type":"boolean"},"max_results":{"type":"number","format":"double"},"search_prompt":{"type":"string"},"engine":{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItemsOneOf1Engine"}},"required":["id"]},"ChatGenerationParamsPluginsItemsOneOf1Engine":{"type":"string","enum":["native","exa"]},"ChatGenerationParamsPluginsItems2":{"type":"object","properties":{"id":{"type":"string","enum":["file-parser"]},"enabled":{"type":"boolean"},"pdf":{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItemsOneOf2Pdf"}},"required":["id"]},"ChatGenerationParamsPluginsItemsOneOf2Pdf":{"type":"object","properties":{"engine":{"$ref":"#/components/schemas/ChatGenerationParamsPluginsItemsOneOf2PdfEngine"}}},"ChatGenerationParamsPluginsItemsOneOf2PdfEngine":{"type":"string","enum":["mistral-ocr","pdf-text","native"]},"ChatGenerationParamsPluginsItems3":{"type":"object","properties":{"id":{"type":"string","enum":["response-healing"]},"enabled":{"type":"boolean"}},"required":["id"]},"ChatGenerationParamsRoute":{"type":"string","enum":["fallback","sort"]},"Message":{"oneOf":[{"$ref":"#/components/schemas/SystemMessage"},{"$ref":"#/components/schemas/UserMessage"},{"$ref":"#/components/schemas/Message2"},{"$ref":"#/components/schemas/AssistantMessage"},{"$ref":"#/components/schemas/ToolResponseMessage"}]},"SystemMessage":{"type":"object","properties":{"role":{"type":"string","enum":["system"]},"content":{"$ref":"#/components/schemas/SystemMessageContent"},"name":{"type":"string"}},"required":["role","content"]},"SystemMessageContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/SystemMessageContent1"}]},"SystemMessageContent1":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItemText"}},"ChatMessageContentItemText":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/ChatMessageContentItemCacheControl"}},"required":["type","text"]},"UserMessage":{"type":"object","properties":{"role":{"type":"string","enum":["user"]},"content":{"$ref":"#/components/schemas/UserMessageContent"},"name":{"type":"string"}},"required":["role","content"]},"UserMessageContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/UserMessageContent1"}]},"UserMessageContent1":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItem"}},"Message2":{"type":"object","properties":{"role":{"type":"string","enum":["developer"]},"content":{"$ref":"#/components/schemas/MessageOneOf2Content"},"name":{"type":"string"}},"required":["role","content"]},"MessageOneOf2Content":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/MessageOneOf2Content1"}]},"MessageOneOf2Content1":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItemText"}},"ToolResponseMessage":{"type":"object","properties":{"role":{"type":"string","enum":["tool"]},"content":{"$ref":"#/components/schemas/ToolResponseMessageContent"},"tool_call_id":{"type":"string"}},"required":["role","content","tool_call_id"]},"ToolResponseMessageContent":{"oneOf":[{"type":"string"},{"$ref":"#/components/schemas/ToolResponseMessageContent1"}]},"ToolResponseMessageContent1":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessageContentItem"}},"ModelName":{"type":"string"},"ChatGenerationParamsReasoning":{"type":"object","properties":{"effort":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsReasoningEffort"}]},"summary":{"nullable":true,"oneOf":[{"$ref":"#/components/schemas/ReasoningSummaryVerbosity"}]}}},"ChatGenerationParamsReasoningEffort":{"type":"string","enum":["xhigh","high","medium","low","minimal","none"]},"ReasoningSummaryVerbosity":{"type":"string","enum":["auto","concise","detailed"]},"ChatGenerationParamsResponseFormat":{"oneOf":[{"$ref":"#/components/schemas/ChatGenerationParamsResponseFormat0"},{"$ref":"#/components/schemas/ChatGenerationParamsResponseFormat1"},{"$ref":"#/components/schemas/ResponseFormatJSONSchema"},{"$ref":"#/components/schemas/ResponseFormatTextGrammar"},{"$ref":"#/components/schemas/ChatGenerationParamsResponseFormat4"}]},"ChatGenerationParamsResponseFormat0":{"type":"object","properties":{"type":{"type":"string","enum":["text"]}},"required":["type"]},"ChatGenerationParamsResponseFormat1":{"type":"object","properties":{"type":{"type":"string","enum":["json_object"]}},"required":["type"]},"ResponseFormatJSONSchema":{"type":"object","properties":{"type":{"type":"string","enum":["json_schema"]},"json_schema":{"$ref":"#/components/schemas/JSONSchemaConfig"}},"required":["type","json_schema"]},"JSONSchemaConfig":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object","additionalProperties":{"description":"Any type"}},"strict":{"type":"boolean","nullable":true}},"required":["name"]},"ResponseFormatTextGrammar":{"type":"object","properties":{"type":{"type":"string","enum":["grammar"]},"grammar":{"type":"string"}},"required":["type","grammar"]},"ChatGenerationParamsResponseFormat4":{"type":"object","properties":{"type":{"type":"string","enum":["python"]}},"required":["type"]},"ChatGenerationParamsStop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"ChatStreamOptions":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"ToolChoiceOption":{"oneOf":[{"type":"string","enum":["none"]},{"type":"string","enum":["auto"]},{"type":"string","enum":["required"]},{"$ref":"#/components/schemas/NamedToolChoice"}]},"NamedToolChoice":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"$ref":"#/components/schemas/NamedToolChoiceFunction"}},"required":["type","function"]},"NamedToolChoiceFunction":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]},"ToolDefinitionJson":{"type":"object","properties":{"type":{"type":"string","enum":["function"]},"function":{"$ref":"#/components/schemas/ToolDefinitionJsonFunction"}},"required":["type","function"]},"ToolDefinitionJsonFunction":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object","additionalProperties":{"description":"Any type"}},"strict":{"type":"boolean","nullable":true}},"required":["name"]},"ChatGenerationParamsDebug":{"type":"object","properties":{"echo_upstream_body":{"type":"boolean"}}}}},"paths":{"/chat/completions":{"post":{"operationId":"send-chat-completion-request","summary":"Create a chat completion","description":"Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.","tags":["subpackage_chat"],"parameters":[],"responses":{"200":{"description":"Successful chat completion response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad request - invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too many requests - rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"description":"Chat completion request parameters","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatGenerationParams"}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.interactive.ai/llm-router/api-reference/chat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
