{
"detail": "Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."
}
{
"detail": "Model not found"
}
Inference
Generate Chat Completions
Generate conversational responses with streaming support and multimodal capabilities.
This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.
Request Body:
model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id
messages: Array of message objects (required, minimum 1), each containing:
role: Message role (system, user, or assistant)
content: Text string OR array of content objects (for multimodal)
name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)
max_tokens (optional): Maximum tokens to generate in completion
prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500)
temperature (optional): Sampling temperature between 0 and 2 (default: 1)
stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response.
Tip: For prompts where you expect a long output (e.g., max_tokens > 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.
tools (optional): List of tools/functions available to the model
tool_choice (optional): Tool selection mode (auto, none, or specific tool)
top_p (optional): Nucleus sampling parameter
top_k (optional): Top-k sampling parameter
n (optional): Number of completions to generate (default: 1)
POST /api/v3/inference/chat/completionsHeaders: {"Authorization": "Bearer <api_key>"}{ "model": "model_01kmqm4nrn9fw6r", "messages": [ {"role": "user", "content": "What is the status of INC-4821?"} ], "tools": [ { "type": "function", "function": { "name": "get_incident", "description": "Get incident status", "parameters": { "type": "object", "properties": { "incident_id": {"type": "string"} } } } } ], "tool_choice": "auto", "stream": false}
Example Request (Streaming):
POST /api/v3/inference/chat/completionsHeaders: {"Authorization": "Bearer <api_key>"}{ "model": "model_01kmqm4nrn9fw6r", "messages": [{"role": "user", "content": "Tell me a story"}], "stream": true}
Example Response (Streaming):
data: {"id":"nugen-abc123","created":1704123600.0,"model":"model_01kmqm4nrn9fw6r","choices":[{"index":0,"delta":{"role":"assistant","content":"Once"},"finish_reason":null}]}data: {"id":"nugen-abc123","created":1704123600.0,"model":"model_01kmqm4nrn9fw6r","choices":[{"index":0,"delta":{"content":" upon"},"finish_reason":null}]}data: {"id":"nugen-abc123","created":1704123600.0,"model":"model_01kmqm4nrn9fw6r","choices":[{"index":0,"delta":{"content":" a time"},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":5,"total_tokens":15}}data: [DONE]
Provisioned throughput:
Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.
Notes:
Supports both text-only and vision/multimodal inputs depending on the model
Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned
Function calling enables models to invoke external tools via tools and tool_choice parameters
confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {"object": "confidence", ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk
For streaming, usage statistics are included only in the final chunk
Conversations are automatically saved to S3 if enabled in user settings
Include X-Session-ID header for multi-turn conversation tracking
Use prompt_truncate_len to control context window usage for long conversations
The reasoning parameter enables advanced reasoning capabilities for supported models
{
"detail": "Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."
}
{
"detail": "Model not found"
}
Authorizations
Authorization
string
header
required
Your Nugen API key, sent as a Bearer token
Headers
X-Session-ID
string | null
Session identifier for multi-turn conversation tracking
Body
application/json
A chat completion request in the OpenAI format.
model
string
required
Use your aligned model id (e.g. model_01kmqm4nrn9fw6r). The same aligned id serves chat completions, embeddings and reranking.
Example:
"model_01kmqm4nrn9fw6r"
messages
ChatCompletionRequestMessage · object[]
required
A list of messages comprising the conversation so far.
Minimum array length: 1
Show child attributes
max_tokens
integer | null
default:200
The maximum number of tokens to generate in the completion.
prompt_truncate_len
integer | null
default:1500
The size to which to truncate chat prompts.
temperature
number | null
default:0.75
What sampling temperature to use, between 0 and 2.
Required range: 0 <= x <= 2
stream
boolean | null
default:true
Stream partial progress as server-sent events. Defaults to true; null means true. Set false for one JSON response, which must complete within 50 seconds or the call answers 504. Use true for long generations.
tools
Tools · object[] | null
List of tools/functions
tool_choice
stringTool Choice · object
'auto', 'none', or specific tool
top_p
number | null
Nucleus sampling
top_k
integer | null
Top-k sampling
n
integer | null
default:1
Number of completions
reasoning
ChatCompletionReasoning · object | null
Reasoning configuration for the model
Show child attributes
stream_options
Stream Options · object | null
Options for streaming responses, e.g., {'include_usage': true}
Response
Streaming chat completion responses or complete response depending on stream parameter
A chat completion response in the OpenAI format, with a confidence score on aligned models.
id
string
required
A unique identifier of the response.
created
number
required
The Unix time in seconds when the response was generated.
model
string
required
The model used for the chat completion.
choices
ChatCompletionChoice · object[]
required
The list of chat completion choices.
Show child attributes
confidence_score
number | null
required
Confidence Score from Domain-Aligned AI
object
string
default:chat.completion
The object type, which is always "chat.completion".
Allowed value: "chat.completion"
usage
ChatCompletionUsage · object | null
Usage statistics.
For streaming responses, usage field is included in the very last response chunk returned.
Note that returning usage for streaming requests is a popular LLM API extension. If you use any popular LLM SDK, you might access the field directly even if it's not present in the type signature in the SDK.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Nugen API Reference Docs","colors":{"primary":"#005b96","light":"#6497b1","dark":"#005b96"},"logo":{"light":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/light.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=f5f462b08161252f94dca4827e8055a0","dark":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/dark.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=c1f31d3028b6ad46f4c22208d402733e"},"favicon":"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/favicon.png?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=74a9985970701685cc9f798a5bed86fe","api":{"openapi":"https://api.nugen.in/openapi-public.json","mdx":{"auth":{"method":"bearer"},"server":"https://api.nugen.in/"}},"navbar":{"links":[{"href":"https://github.com/nugen-in/nugen-cookbook","label":"Cookbook"}],"primary":{"type":"button","label":"Get API Key","href":"https://nugen.in/signup"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/nugen-in"}},"contextual":{"options":["copy","vscode","claude","chatgpt","perplexity","cursor"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"API Status","icon":"bolt-lightning","href":"https://status.nugen.in"},{"anchor":"Nugen Intelligence","icon":"earth-asia","href":"https://nugen.in"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"courteasy","hasAudioNarration":false,"actualSubdomain":"courteasy","customDomains":["docs.nugen.in"],"gitSource":{"type":"github","owner":"nugen-in","repo":"nugen-docs-test","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6afb0e5093c081f905772cfd","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"API Reference","count":42},{"language":"default","tag":"Models","count":8},{"language":"default","tag":"Alignment Projects","count":7},{"language":"default","tag":"Benchmarks","count":7},{"language":"default","tag":"Inference","count":7},{"language":"default","tag":"Evaluations","count":6},{"language":"default","tag":"Documents","count":5},{"language":"default","tag":"BYOC","count":2}]},"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":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/inference/generate-chat-completions","slug":"/api-reference/inference/generate-chat-completions","pageMetadata":{"title":"Generate Chat Completions","description":"Generate conversational responses with streaming support and multimodal capabilities.\n\n\nThis endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`); base text models (e.g. `model_01kmqm4nrn9fw6r`) also work if you have not aligned a model yet. For reserved capacity pass `ptm_id:model_id`\n- `messages`: Array of message objects (required, minimum 1), each containing:\n - `role`: Message role (`system`, `user`, or `assistant`)\n - `content`: Text string OR array of content objects (for multimodal)\n - Text: `{\"type\": \"text\", \"text\": \"your message\"}`\n - Image URL: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"https://...\"}}`\n - Image Base64: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,...\"}}`\n - `name` (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)\n- `max_tokens` (optional): Maximum tokens to generate in completion\n- `prompt_truncate_len` (optional): Size to truncate chat prompts (default: 1500)\n- `temperature` (optional): Sampling temperature between 0 and 2 (default: 1)\n- `stream` (optional): Stream the response as server-sent events (default: `true`). Set `stream: false` for one JSON response.\n > **Tip:** For prompts where you expect a long output (e.g., `max_tokens > 500`), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.\n- `tools` (optional): List of tools/functions available to the model\n- `tool_choice` (optional): Tool selection mode (`auto`, `none`, or specific tool)\n- `top_p` (optional): Nucleus sampling parameter\n- `top_k` (optional): Top-k sampling parameter\n- `n` (optional): Number of completions to generate (default: 1)\n- `reasoning` (optional): Reasoning configuration object with:\n - `effort`: Reasoning effort level (`xhigh`, `high`, `medium`, `low`, `minimal`, `none`)\n - `max_tokens`: Token limit for reasoning\n - `exclude`: Set true to exclude reasoning tokens from response\n - `enabled`: Enable reasoning with default parameters\n\n\n**Optional Headers:**\n\n- `X-Session-ID`: Session identifier for multi-turn conversation tracking\n\n\n**Returns:**\n\n**Non-streaming mode** -\n- `id`: Unique identifier for the response\n- `object`: Object type (always `chat.completion`)\n- `created`: Unix timestamp when completion was created\n- `model`: Model used for chat completion\n- `choices`: List of completion choices, each containing:\n - `index`: Index of the choice\n - `message`: Response message with:\n - `role`: Role of the author (always `assistant`)\n - `content`: Generated response text\n - `tool_calls` (optional): Tool calls made by the model (for function calling)\n - `finish_reason`: Reason model stopped (`stop` for natural stop, `length` if max tokens reached)\n- `usage`: Token usage statistics:\n - `prompt_tokens`: Number of tokens in the prompt\n - `completion_tokens`: Number of tokens generated\n - `total_tokens`: Total tokens used (prompt + completion)\n- `confidence_score` (optional): Confidence score, 0-100, on aligned models; null on base models\n\n**Streaming mode** - `ChatCompletionChunk` stream with:\n- `id`: Unique identifier\n- `created`: Timestamp\n- `model`: Model ID\n- `choices`: List of chunk choices with:\n - `index`: ChatCompletionChoice index\n - `delta`: Delta content with `role` and `content`\n - `finish_reason`: Reason for stopping (only in final chunk)\n- `usage` (optional): Only present in final chunk\n\n\n**Example Request (Text Chat):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Text Chat):**\n\n```json\n{\n \"id\": \"nugen-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1704123600.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The capital of France is Paris.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 20,\n \"completion_tokens\": 8,\n \"total_tokens\": 28\n },\n \"confidence_score\": 89.5454\n}\n```\n\n\n**Example Request (Using Domain-Aligned Model):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do I return a product?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Domain-Aligned Model):**\n\n```json\n{\n \"id\": \"nugen-abc456\",\n \"object\": \"chat.completion\",\n \"created\": 1704123700.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 15,\n \"completion_tokens\": 25,\n \"total_tokens\": 40\n },\n \"confidence_score\": 95.8\n}\n```\n\n**How to get your aligned model ID:**\n1. Create an alignment project using `POST /api/v3/alignment-projects/create`\n2. Poll `GET /api/v3/alignment-projects/{id}/status` until status is `READY`\n3. Use the `model_id` field from the response (e.g., `\"model_01kmqm4nrn9fw6r\"`)\n4. Deploy the model using `POST /api/v3/models/{model_id}/deployment` (optional - for evaluation/production use)\n5. Use the `model_id` in the `model` parameter for inference requests\n\n\n**Example Request (Vision - Image URL):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe what you see in this image.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 1000,\n \"stream\": false\n}\n```\n\n\n**Example Request (Vision - Base64 Image):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n }\n ]\n }\n ],\n \"stream\": false\n}\n```\n\n\n**Example Request (Function Calling):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the status of INC-4821?\"}\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_incident\",\n \"description\": \"Get incident status\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"incident_id\": {\"type\": \"string\"}\n }\n }\n }\n }\n ],\n \"tool_choice\": \"auto\",\n \"stream\": false\n}\n```\n\n\n**Example Request (Streaming):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Tell me a story\"}],\n \"stream\": true\n}\n```\n\n\n**Example Response (Streaming):**\n\n```\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"Once\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" upon\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" a time\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":5,\"total_tokens\":15}}\n\ndata: [DONE]\n```\n\n\n**Provisioned throughput:**\n\nReserve inference capacity for production workloads. Pass your provisioned id in `model` as `ptm_id:model_id` in place of the plain `model_id`. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.\n\n**Notes:**\n\n- Supports both text-only and vision/multimodal inputs depending on the model\n- **Using Domain-Aligned Models**: Pass the `model_id` from your completed alignment project as the `model` parameter. Get your aligned model IDs from `GET /api/v3/alignment-projects/{id}/status` or `GET /api/v3/models/aligned`\n- Function calling enables models to invoke external tools via `tools` and `tool_choice` parameters\n- `confidence_score` (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own `{\"object\": \"confidence\", ...}` events interleaved with content chunks, one per generated span, rather than a single value on the final chunk\n- For streaming, usage statistics are included only in the final chunk\n- Conversations are automatically saved to S3 if enabled in user settings\n- Include `X-Session-ID` header for multi-turn conversation tracking\n- Use `prompt_truncate_len` to control context window usage for long conversations\n- The `reasoning` parameter enables advanced reasoning capabilities for supported models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/chat/completions","href":"/api-reference/inference/generate-chat-completions","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n blockquote: \"blockquote\",\n code: \"code\",\n li: \"li\",\n ol: \"ol\",\n p: \"p\",\n pre: \"pre\",\n span: \"span\",\n strong: \"strong\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n }, {CodeBlock} = _components;\n if (!CodeBlock) _missingMdxReference(\"CodeBlock\", true);\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Generate conversational responses with streaming support and multimodal capabilities.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.\"\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Request Body:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"model\"\n }), \": Model ID (required). Use your aligned model id (e.g. \", _jsx(_components.code, {\n children: \"model_01kmqm4nrn9fw6r\"\n }), \"); base text models (e.g. \", _jsx(_components.code, {\n children: \"model_01kmqm4nrn9fw6r\"\n }), \") also work if you have not aligned a model yet. For reserved capacity pass \", _jsx(_components.code, {\n children: \"ptm_id:model_id\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"messages\"\n }), \": Array of message objects (required, minimum 1), each containing:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"role\"\n }), \": Message role (\", _jsx(_components.code, {\n children: \"system\"\n }), \", \", _jsx(_components.code, {\n children: \"user\"\n }), \", or \", _jsx(_components.code, {\n children: \"assistant\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"content\"\n }), \": Text string OR array of content objects (for multimodal)\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Text: \", _jsx(_components.code, {\n children: \"{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"your message\\\"}\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Image URL: \", _jsx(_components.code, {\n children: \"{\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"https://...\\\"}}\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Image Base64: \", _jsx(_components.code, {\n children: \"{\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"data:image/jpeg;base64,...\\\"}}\"\n })]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"name\"\n }), \" (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"max_tokens\"\n }), \" (optional): Maximum tokens to generate in completion\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"prompt_truncate_len\"\n }), \" (optional): Size to truncate chat prompts (default: 1500)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"temperature\"\n }), \" (optional): Sampling temperature between 0 and 2 (default: 1)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"stream\"\n }), \" (optional): Stream the response as server-sent events (default: \", _jsx(_components.code, {\n children: \"true\"\n }), \"). Set \", _jsx(_components.code, {\n children: \"stream: false\"\n }), \" for one JSON response.\", \"\\n\", _jsxs(_components.blockquote, {\n children: [\"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Tip:\"\n }), \" For prompts where you expect a long output (e.g., \", _jsx(_components.code, {\n children: \"max_tokens > 500\"\n }), \"), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"tools\"\n }), \" (optional): List of tools/functions available to the model\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"tool_choice\"\n }), \" (optional): Tool selection mode (\", _jsx(_components.code, {\n children: \"auto\"\n }), \", \", _jsx(_components.code, {\n children: \"none\"\n }), \", or specific tool)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"top_p\"\n }), \" (optional): Nucleus sampling parameter\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"top_k\"\n }), \" (optional): Top-k sampling parameter\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"n\"\n }), \" (optional): Number of completions to generate (default: 1)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"reasoning\"\n }), \" (optional): Reasoning configuration object with:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"effort\"\n }), \": Reasoning effort level (\", _jsx(_components.code, {\n children: \"xhigh\"\n }), \", \", _jsx(_components.code, {\n children: \"high\"\n }), \", \", _jsx(_components.code, {\n children: \"medium\"\n }), \", \", _jsx(_components.code, {\n children: \"low\"\n }), \", \", _jsx(_components.code, {\n children: \"minimal\"\n }), \", \", _jsx(_components.code, {\n children: \"none\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"max_tokens\"\n }), \": Token limit for reasoning\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"exclude\"\n }), \": Set true to exclude reasoning tokens from response\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"enabled\"\n }), \": Enable reasoning with default parameters\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Optional Headers:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"X-Session-ID\"\n }), \": Session identifier for multi-turn conversation tracking\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Returns:\"\n })\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Non-streaming mode\"\n }), \" -\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"id\"\n }), \": Unique identifier for the response\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"object\"\n }), \": Object type (always \", _jsx(_components.code, {\n children: \"chat.completion\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"created\"\n }), \": Unix timestamp when completion was created\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"model\"\n }), \": Model used for chat completion\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"choices\"\n }), \": List of completion choices, each containing:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"index\"\n }), \": Index of the choice\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"message\"\n }), \": Response message with:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"role\"\n }), \": Role of the author (always \", _jsx(_components.code, {\n children: \"assistant\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"content\"\n }), \": Generated response text\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"tool_calls\"\n }), \" (optional): Tool calls made by the model (for function calling)\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"finish_reason\"\n }), \": Reason model stopped (\", _jsx(_components.code, {\n children: \"stop\"\n }), \" for natural stop, \", _jsx(_components.code, {\n children: \"length\"\n }), \" if max tokens reached)\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"usage\"\n }), \": Token usage statistics:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"prompt_tokens\"\n }), \": Number of tokens in the prompt\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"completion_tokens\"\n }), \": Number of tokens generated\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"total_tokens\"\n }), \": Total tokens used (prompt + completion)\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"confidence_score\"\n }), \" (optional): Confidence score, 0-100, on aligned models; null on base models\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.strong, {\n children: \"Streaming mode\"\n }), \" - \", _jsx(_components.code, {\n children: \"ChatCompletionChunk\"\n }), \" stream with:\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"id\"\n }), \": Unique identifier\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"created\"\n }), \": Timestamp\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"model\"\n }), \": Model ID\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"choices\"\n }), \": List of chunk choices with:\", \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"index\"\n }), \": ChatCompletionChoice index\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"delta\"\n }), \": Delta content with \", _jsx(_components.code, {\n children: \"role\"\n }), \" and \", _jsx(_components.code, {\n children: \"content\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"finish_reason\"\n }), \": Reason for stopping (only in final chunk)\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"usage\"\n }), \" (optional): Only present in final chunk\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Text Chat):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"19\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"19\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"system\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"You are a helpful assistant.\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"What is the capital of France?\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"max_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"500\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"temperature\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0.7\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"false\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Response (Text Chat):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"22\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"22\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"id\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"nugen-abc123\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"object\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"chat.completion\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"created\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"1704123600.0\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"choices\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"index\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"message\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"assistant\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"The capital of France is Paris.\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"finish_reason\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"stop\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"usage\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"prompt_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"20\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"completion_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"8\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"total_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"28\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"confidence_score\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"89.5454\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Using Domain-Aligned Model):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"15\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"15\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"How do I return a product?\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"max_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"500\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"temperature\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0.7\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"false\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Response (Domain-Aligned Model):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"22\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"22\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"id\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"nugen-abc456\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"object\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"chat.completion\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"created\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"1704123700.0\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"choices\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"index\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"0\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"message\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"assistant\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"finish_reason\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"stop\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"usage\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"prompt_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"15\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"completion_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"25\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"total_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"40\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"confidence_score\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"95.8\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"How to get your aligned model ID:\"\n })\n }), \"\\n\", _jsxs(_components.ol, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [\"Create an alignment project using \", _jsx(_components.code, {\n children: \"POST /api/v3/alignment-projects/create\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Poll \", _jsx(_components.code, {\n children: \"GET /api/v3/alignment-projects/{id}/status\"\n }), \" until status is \", _jsx(_components.code, {\n children: \"READY\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Use the \", _jsx(_components.code, {\n children: \"model_id\"\n }), \" field from the response (e.g., \", _jsx(_components.code, {\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), \")\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Deploy the model using \", _jsx(_components.code, {\n children: \"POST /api/v3/models/{model_id}/deployment\"\n }), \" (optional - for evaluation/production use)\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Use the \", _jsx(_components.code, {\n children: \"model_id\"\n }), \" in the \", _jsx(_components.code, {\n children: \"model\"\n }), \" parameter for inference requests\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Vision - Image URL):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"25\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"25\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"text\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"text\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Describe what you see in this image.\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"image_url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"image_url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"https://example.com/image.jpg\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ]\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"max_tokens\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"1000\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"false\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Vision - Base64 Image):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"24\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"24\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"text\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"text\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"What's in this image?\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" },\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"image_url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"image_url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"url\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\\\"\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ]\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"false\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Function Calling):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"26\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"26\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"What is the status of INC-4821?\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"tools\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" {\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"function\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"function\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"name\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"get_incident\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"description\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Get incident status\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"parameters\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"object\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"properties\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"incident_id\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"type\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"string\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" }\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \" ],\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"tool_choice\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"auto\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"false\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Request (Streaming):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"8\",\n language: \"json\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"json\",\n children: _jsxs(_components.code, {\n language: \"json\",\n numberOfLines: \"8\",\n children: [_jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"POST /api/v\"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#B5CEA8\"\n },\n children: \"3\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"/inference/chat/completions\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"Headers: {\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"Authorization\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Bearer \u003capi_key>\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\"\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"{\"\n })\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"model\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"model_01kmqm4nrn9fw6r\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \",\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"messages\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": [{\"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"role\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"user\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \", \"\n }), _jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \"\\\"content\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0A3069\",\n \"--shiki-dark\": \"#CE9178\"\n },\n children: \"\\\"Tell me a story\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}],\"\n })]\n }), \"\\n\", _jsxs(_components.span, {\n className: \"line\",\n children: [_jsx(_components.span, {\n style: {\n color: \"#116329\",\n \"--shiki-dark\": \"#9CDCFE\"\n },\n children: \" \\\"stream\\\"\"\n }), _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \": \"\n }), _jsx(_components.span, {\n style: {\n color: \"#0550AE\",\n \"--shiki-dark\": \"#569CD6\"\n },\n children: \"true\"\n })]\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n style: {\n color: \"#1F2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n children: \"}\"\n })\n }), \"\\n\"]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Example Response (Streaming):\"\n })\n }), \"\\n\", _jsx(CodeBlock, {\n numberOfLines: \"8\",\n language: \"text\",\n children: _jsx(_components.pre, {\n className: \"shiki shiki-themes github-light-default dark-plus\",\n style: {\n backgroundColor: \"#ffffff\",\n \"--shiki-dark-bg\": \"#0B0C0E\",\n color: \"#1f2328\",\n \"--shiki-dark\": \"#D4D4D4\"\n },\n language: \"text\",\n children: _jsxs(_components.code, {\n language: \"text\",\n numberOfLines: \"8\",\n children: [_jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n children: \"data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"Once\\\"},\\\"finish_reason\\\":null}]}\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {})\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n children: \"data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" upon\\\"},\\\"finish_reason\\\":null}]}\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {})\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n children: \"data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" a time\\\"},\\\"finish_reason\\\":\\\"stop\\\"}],\\\"usage\\\":{\\\"prompt_tokens\\\":10,\\\"completion_tokens\\\":5,\\\"total_tokens\\\":15}}\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {})\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {\n children: \"data: [DONE]\"\n })\n }), \"\\n\", _jsx(_components.span, {\n className: \"line\",\n children: _jsx(_components.span, {})\n })]\n })\n })\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Provisioned throughput:\"\n })\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Reserve inference capacity for production workloads. Pass your provisioned id in \", _jsx(_components.code, {\n children: \"model\"\n }), \" as \", _jsx(_components.code, {\n children: \"ptm_id:model_id\"\n }), \" in place of the plain \", _jsx(_components.code, {\n children: \"model_id\"\n }), \". The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.\"]\n }), \"\\n\", _jsx(_components.p, {\n children: _jsx(_components.strong, {\n children: \"Notes:\"\n })\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"Supports both text-only and vision/multimodal inputs depending on the model\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.strong, {\n children: \"Using Domain-Aligned Models\"\n }), \": Pass the \", _jsx(_components.code, {\n children: \"model_id\"\n }), \" from your completed alignment project as the \", _jsx(_components.code, {\n children: \"model\"\n }), \" parameter. Get your aligned model IDs from \", _jsx(_components.code, {\n children: \"GET /api/v3/alignment-projects/{id}/status\"\n }), \" or \", _jsx(_components.code, {\n children: \"GET /api/v3/models/aligned\"\n })]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Function calling enables models to invoke external tools via \", _jsx(_components.code, {\n children: \"tools\"\n }), \" and \", _jsx(_components.code, {\n children: \"tool_choice\"\n }), \" parameters\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.code, {\n children: \"confidence_score\"\n }), \" (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own \", _jsx(_components.code, {\n children: \"{\\\"object\\\": \\\"confidence\\\", ...}\"\n }), \" events interleaved with content chunks, one per generated span, rather than a single value on the final chunk\"]\n }), \"\\n\", _jsx(_components.li, {\n children: \"For streaming, usage statistics are included only in the final chunk\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Conversations are automatically saved to S3 if enabled in user settings\"\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Include \", _jsx(_components.code, {\n children: \"X-Session-ID\"\n }), \" header for multi-turn conversation tracking\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"Use \", _jsx(_components.code, {\n children: \"prompt_truncate_len\"\n }), \" to control context window usage for long conversations\"]\n }), \"\\n\", _jsxs(_components.li, {\n children: [\"The \", _jsx(_components.code, {\n children: \"reasoning\"\n }), \" parameter enables advanced reasoning capabilities for supported models\"]\n }), \"\\n\"]\n })]\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};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Generate Chat Completions","description":"Generate conversational responses with streaming support and multimodal capabilities.\n\n\nThis endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`); base text models (e.g. `model_01kmqm4nrn9fw6r`) also work if you have not aligned a model yet. For reserved capacity pass `ptm_id:model_id`\n- `messages`: Array of message objects (required, minimum 1), each containing:\n - `role`: Message role (`system`, `user`, or `assistant`)\n - `content`: Text string OR array of content objects (for multimodal)\n - Text: `{\"type\": \"text\", \"text\": \"your message\"}`\n - Image URL: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"https://...\"}}`\n - Image Base64: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,...\"}}`\n - `name` (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)\n- `max_tokens` (optional): Maximum tokens to generate in completion\n- `prompt_truncate_len` (optional): Size to truncate chat prompts (default: 1500)\n- `temperature` (optional): Sampling temperature between 0 and 2 (default: 1)\n- `stream` (optional): Stream the response as server-sent events (default: `true`). Set `stream: false` for one JSON response.\n > **Tip:** For prompts where you expect a long output (e.g., `max_tokens > 500`), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.\n- `tools` (optional): List of tools/functions available to the model\n- `tool_choice` (optional): Tool selection mode (`auto`, `none`, or specific tool)\n- `top_p` (optional): Nucleus sampling parameter\n- `top_k` (optional): Top-k sampling parameter\n- `n` (optional): Number of completions to generate (default: 1)\n- `reasoning` (optional): Reasoning configuration object with:\n - `effort`: Reasoning effort level (`xhigh`, `high`, `medium`, `low`, `minimal`, `none`)\n - `max_tokens`: Token limit for reasoning\n - `exclude`: Set true to exclude reasoning tokens from response\n - `enabled`: Enable reasoning with default parameters\n\n\n**Optional Headers:**\n\n- `X-Session-ID`: Session identifier for multi-turn conversation tracking\n\n\n**Returns:**\n\n**Non-streaming mode** -\n- `id`: Unique identifier for the response\n- `object`: Object type (always `chat.completion`)\n- `created`: Unix timestamp when completion was created\n- `model`: Model used for chat completion\n- `choices`: List of completion choices, each containing:\n - `index`: Index of the choice\n - `message`: Response message with:\n - `role`: Role of the author (always `assistant`)\n - `content`: Generated response text\n - `tool_calls` (optional): Tool calls made by the model (for function calling)\n - `finish_reason`: Reason model stopped (`stop` for natural stop, `length` if max tokens reached)\n- `usage`: Token usage statistics:\n - `prompt_tokens`: Number of tokens in the prompt\n - `completion_tokens`: Number of tokens generated\n - `total_tokens`: Total tokens used (prompt + completion)\n- `confidence_score` (optional): Confidence score, 0-100, on aligned models; null on base models\n\n**Streaming mode** - `ChatCompletionChunk` stream with:\n- `id`: Unique identifier\n- `created`: Timestamp\n- `model`: Model ID\n- `choices`: List of chunk choices with:\n - `index`: ChatCompletionChoice index\n - `delta`: Delta content with `role` and `content`\n - `finish_reason`: Reason for stopping (only in final chunk)\n- `usage` (optional): Only present in final chunk\n\n\n**Example Request (Text Chat):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Text Chat):**\n\n```json\n{\n \"id\": \"nugen-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1704123600.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The capital of France is Paris.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 20,\n \"completion_tokens\": 8,\n \"total_tokens\": 28\n },\n \"confidence_score\": 89.5454\n}\n```\n\n\n**Example Request (Using Domain-Aligned Model):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do I return a product?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Domain-Aligned Model):**\n\n```json\n{\n \"id\": \"nugen-abc456\",\n \"object\": \"chat.completion\",\n \"created\": 1704123700.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 15,\n \"completion_tokens\": 25,\n \"total_tokens\": 40\n },\n \"confidence_score\": 95.8\n}\n```\n\n**How to get your aligned model ID:**\n1. Create an alignment project using `POST /api/v3/alignment-projects/create`\n2. Poll `GET /api/v3/alignment-projects/{id}/status` until status is `READY`\n3. Use the `model_id` field from the response (e.g., `\"model_01kmqm4nrn9fw6r\"`)\n4. Deploy the model using `POST /api/v3/models/{model_id}/deployment` (optional - for evaluation/production use)\n5. Use the `model_id` in the `model` parameter for inference requests\n\n\n**Example Request (Vision - Image URL):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe what you see in this image.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 1000,\n \"stream\": false\n}\n```\n\n\n**Example Request (Vision - Base64 Image):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n }\n ]\n }\n ],\n \"stream\": false\n}\n```\n\n\n**Example Request (Function Calling):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the status of INC-4821?\"}\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_incident\",\n \"description\": \"Get incident status\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"incident_id\": {\"type\": \"string\"}\n }\n }\n }\n }\n ],\n \"tool_choice\": \"auto\",\n \"stream\": false\n}\n```\n\n\n**Example Request (Streaming):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Tell me a story\"}],\n \"stream\": true\n}\n```\n\n\n**Example Response (Streaming):**\n\n```\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"Once\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" upon\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" a time\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":5,\"total_tokens\":15}}\n\ndata: [DONE]\n```\n\n\n**Provisioned throughput:**\n\nReserve inference capacity for production workloads. Pass your provisioned id in `model` as `ptm_id:model_id` in place of the plain `model_id`. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.\n\n**Notes:**\n\n- Supports both text-only and vision/multimodal inputs depending on the model\n- **Using Domain-Aligned Models**: Pass the `model_id` from your completed alignment project as the `model` parameter. Get your aligned model IDs from `GET /api/v3/alignment-projects/{id}/status` or `GET /api/v3/models/aligned`\n- Function calling enables models to invoke external tools via `tools` and `tool_choice` parameters\n- `confidence_score` (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own `{\"object\": \"confidence\", ...}` events interleaved with content chunks, one per generated span, rather than a single value on the final chunk\n- For streaming, usage statistics are included only in the final chunk\n- Conversations are automatically saved to S3 if enabled in user settings\n- Include `X-Session-ID` header for multi-turn conversation tracking\n- Use `prompt_truncate_len` to control context window usage for long conversations\n- The `reasoning` parameter enables advanced reasoning capabilities for supported models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/chat/completions","href":"/api-reference/inference/generate-chat-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Inference"],"summary":"Generate Chat Completions","description":"Generate conversational responses with streaming support and multimodal capabilities.\n\n\nThis endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`); base text models (e.g. `model_01kmqm4nrn9fw6r`) also work if you have not aligned a model yet. For reserved capacity pass `ptm_id:model_id`\n- `messages`: Array of message objects (required, minimum 1), each containing:\n - `role`: Message role (`system`, `user`, or `assistant`)\n - `content`: Text string OR array of content objects (for multimodal)\n - Text: `{\"type\": \"text\", \"text\": \"your message\"}`\n - Image URL: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"https://...\"}}`\n - Image Base64: `{\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,...\"}}`\n - `name` (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars)\n- `max_tokens` (optional): Maximum tokens to generate in completion\n- `prompt_truncate_len` (optional): Size to truncate chat prompts (default: 1500)\n- `temperature` (optional): Sampling temperature between 0 and 2 (default: 1)\n- `stream` (optional): Stream the response as server-sent events (default: `true`). Set `stream: false` for one JSON response.\n > **Tip:** For prompts where you expect a long output (e.g., `max_tokens > 500`), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses.\n- `tools` (optional): List of tools/functions available to the model\n- `tool_choice` (optional): Tool selection mode (`auto`, `none`, or specific tool)\n- `top_p` (optional): Nucleus sampling parameter\n- `top_k` (optional): Top-k sampling parameter\n- `n` (optional): Number of completions to generate (default: 1)\n- `reasoning` (optional): Reasoning configuration object with:\n - `effort`: Reasoning effort level (`xhigh`, `high`, `medium`, `low`, `minimal`, `none`)\n - `max_tokens`: Token limit for reasoning\n - `exclude`: Set true to exclude reasoning tokens from response\n - `enabled`: Enable reasoning with default parameters\n\n\n**Optional Headers:**\n\n- `X-Session-ID`: Session identifier for multi-turn conversation tracking\n\n\n**Returns:**\n\n**Non-streaming mode** -\n- `id`: Unique identifier for the response\n- `object`: Object type (always `chat.completion`)\n- `created`: Unix timestamp when completion was created\n- `model`: Model used for chat completion\n- `choices`: List of completion choices, each containing:\n - `index`: Index of the choice\n - `message`: Response message with:\n - `role`: Role of the author (always `assistant`)\n - `content`: Generated response text\n - `tool_calls` (optional): Tool calls made by the model (for function calling)\n - `finish_reason`: Reason model stopped (`stop` for natural stop, `length` if max tokens reached)\n- `usage`: Token usage statistics:\n - `prompt_tokens`: Number of tokens in the prompt\n - `completion_tokens`: Number of tokens generated\n - `total_tokens`: Total tokens used (prompt + completion)\n- `confidence_score` (optional): Confidence score, 0-100, on aligned models; null on base models\n\n**Streaming mode** - `ChatCompletionChunk` stream with:\n- `id`: Unique identifier\n- `created`: Timestamp\n- `model`: Model ID\n- `choices`: List of chunk choices with:\n - `index`: ChatCompletionChoice index\n - `delta`: Delta content with `role` and `content`\n - `finish_reason`: Reason for stopping (only in final chunk)\n- `usage` (optional): Only present in final chunk\n\n\n**Example Request (Text Chat):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"system\",\n \"content\": \"You are a helpful assistant.\"\n },\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Text Chat):**\n\n```json\n{\n \"id\": \"nugen-abc123\",\n \"object\": \"chat.completion\",\n \"created\": 1704123600.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The capital of France is Paris.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 20,\n \"completion_tokens\": 8,\n \"total_tokens\": 28\n },\n \"confidence_score\": 89.5454\n}\n```\n\n\n**Example Request (Using Domain-Aligned Model):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"How do I return a product?\"\n }\n ],\n \"max_tokens\": 500,\n \"temperature\": 0.7,\n \"stream\": false\n}\n```\n\n\n**Example Response (Domain-Aligned Model):**\n\n```json\n{\n \"id\": \"nugen-abc456\",\n \"object\": \"chat.completion\",\n \"created\": 1704123700.0,\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\"\n },\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 15,\n \"completion_tokens\": 25,\n \"total_tokens\": 40\n },\n \"confidence_score\": 95.8\n}\n```\n\n**How to get your aligned model ID:**\n1. Create an alignment project using `POST /api/v3/alignment-projects/create`\n2. Poll `GET /api/v3/alignment-projects/{id}/status` until status is `READY`\n3. Use the `model_id` field from the response (e.g., `\"model_01kmqm4nrn9fw6r\"`)\n4. Deploy the model using `POST /api/v3/models/{model_id}/deployment` (optional - for evaluation/production use)\n5. Use the `model_id` in the `model` parameter for inference requests\n\n\n**Example Request (Vision - Image URL):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"Describe what you see in this image.\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"https://example.com/image.jpg\"\n }\n }\n ]\n }\n ],\n \"max_tokens\": 1000,\n \"stream\": false\n}\n```\n\n\n**Example Request (Vision - Base64 Image):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"What's in this image?\"\n },\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\"\n }\n }\n ]\n }\n ],\n \"stream\": false\n}\n```\n\n\n**Example Request (Function Calling):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"What is the status of INC-4821?\"}\n ],\n \"tools\": [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_incident\",\n \"description\": \"Get incident status\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"incident_id\": {\"type\": \"string\"}\n }\n }\n }\n }\n ],\n \"tool_choice\": \"auto\",\n \"stream\": false\n}\n```\n\n\n**Example Request (Streaming):**\n\n```json\nPOST /api/v3/inference/chat/completions\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Tell me a story\"}],\n \"stream\": true\n}\n```\n\n\n**Example Response (Streaming):**\n\n```\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"Once\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" upon\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"nugen-abc123\",\"created\":1704123600.0,\"model\":\"model_01kmqm4nrn9fw6r\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" a time\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":10,\"completion_tokens\":5,\"total_tokens\":15}}\n\ndata: [DONE]\n```\n\n\n**Provisioned throughput:**\n\nReserve inference capacity for production workloads. Pass your provisioned id in `model` as `ptm_id:model_id` in place of the plain `model_id`. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition.\n\n**Notes:**\n\n- Supports both text-only and vision/multimodal inputs depending on the model\n- **Using Domain-Aligned Models**: Pass the `model_id` from your completed alignment project as the `model` parameter. Get your aligned model IDs from `GET /api/v3/alignment-projects/{id}/status` or `GET /api/v3/models/aligned`\n- Function calling enables models to invoke external tools via `tools` and `tool_choice` parameters\n- `confidence_score` (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own `{\"object\": \"confidence\", ...}` events interleaved with content chunks, one per generated span, rather than a single value on the final chunk\n- For streaming, usage statistics are included only in the final chunk\n- Conversations are automatically saved to S3 if enabled in user settings\n- Include `X-Session-ID` header for multi-turn conversation tracking\n- Use `prompt_truncate_len` to control context window usage for long conversations\n- The `reasoning` parameter enables advanced reasoning capabilities for supported models","operationId":"inference_chat_completions","security":["a1c495bb-b5e0-4d70-a4de-d9f135d9d59e"],"parameters":["3a99d274-4856-4aa5-bb2a-1aa306e0eef7"],"requestBody":"26c05617-8a85-43f4-b39e-3d1c47b97c6a","responses":{"200":"b33ac2fc-00de-4979-80a6-f5c83d15b8e5","401":"74ed27d3-d483-4932-8419-ed9287f28f61","403":"f8452011-7b84-40ef-b171-5676cb86babd","422":"8fe01068-c27b-4624-b1c1-785fae9ff4aa","429":"17925752-62fb-4cd2-9721-8e23fdd692e9","504":"5a1c6a17-e972-4c42-800e-9d58b94106f6"},"x-order":39,"method":"post","type":"path","servers":["f2e8d2a7-ba73-49ff-aa3d-fa8b212b7b35"],"path":"/api/v3/inference/chat/completions","baseUrlOptions":["https://api.nugen.in"],"title":"Generate Chat Completions","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"3a99d274-4856-4aa5-bb2a-1aa306e0eef7":{"name":"X-Session-ID","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"X-Session-Id","description":"Session identifier for multi-turn conversation tracking","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"X-Session-Id","description":"Session identifier for multi-turn conversation tracking","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"},"description":"Session identifier for multi-turn conversation tracking"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"model":{"type":"string","title":"Model","description":"Use your aligned model id (e.g. model_01kmqm4nrn9fw6r). The same aligned id serves chat completions, embeddings and reranking.","examples":["model_01kmqm4nrn9fw6r"],"isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"items":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role","description":"The role of the messages author. One of `system`, `user`, or `assistant`.","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","title":"Content","description":"The contents of the message. `content` is required for all messages","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"title":"Content","description":"The contents of the message. `content` is required for all messages","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"Content · object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | Content · object[]"},"name":{"oneOf":[{"type":"string","title":"Name","description":"The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.","uniqueKey":"messages.items.[INDEX].name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","description":"The name of the author of this message. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.","uniqueKey":"messages.items.[INDEX].name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].name","typeLabel":"string | null"}},"type":"object","required":["role","content"],"title":"ChatCompletionRequestMessage","description":"One message of the conversation sent to the model.","uniqueKey":"messages.items.[INDEX]","typeLabel":"ChatCompletionRequestMessage · object"},"type":"array","minItems":1,"title":"Messages","description":"A list of messages comprising the conversation so far.","isRequired":true,"uniqueKey":"messages","typeLabel":"ChatCompletionRequestMessage · object[]"},"max_tokens":{"oneOf":[{"type":"integer","title":"Max Tokens","description":"The maximum number of tokens to generate in the completion.","default":200,"uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Max Tokens","description":"The maximum number of tokens to generate in the completion.","default":200,"uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer | null"},"prompt_truncate_len":{"oneOf":[{"type":"integer","title":"Prompt Truncate Len","description":"The size to which to truncate chat prompts.","default":1500,"uniqueKey":"prompt_truncate_len.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Prompt Truncate Len","description":"The size to which to truncate chat prompts.","default":1500,"uniqueKey":"prompt_truncate_len.oneOf.1","typeLabel":"null"}],"uniqueKey":"prompt_truncate_len","typeLabel":"integer | null"},"temperature":{"oneOf":[{"type":"number","title":"Temperature","description":"What sampling temperature to use, between 0 and 2.","default":0.75,"maximum":2,"minimum":0,"uniqueKey":"temperature.oneOf.0","typeLabel":"number"},{"type":"null","title":"Temperature","description":"What sampling temperature to use, between 0 and 2.","default":0.75,"uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number | null"},"stream":{"oneOf":[{"type":"boolean","title":"Stream","description":"Stream partial progress as server-sent events. Defaults to true; null means true. Set false for one JSON response, which must complete within 50 seconds or the call answers 504. Use true for long generations.","default":true,"uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Stream","description":"Stream partial progress as server-sent events. Defaults to true; null means true. Set false for one JSON response, which must complete within 50 seconds or the call answers 504. Use true for long generations.","default":true,"uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"tools":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"type":"object","uniqueKey":"tools.oneOf.0.items.[INDEX]","typeLabel":"object"},"title":"Tools","description":"List of tools/functions","uniqueKey":"tools.oneOf.0","typeLabel":"Tools · object[]"},{"type":"null","title":"Tools","description":"List of tools/functions","uniqueKey":"tools.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools","typeLabel":"Tools · object[] | null"},"tool_choice":{"oneOf":[{"type":"string","title":"Tool Choice","description":"'auto', 'none', or specific tool","uniqueKey":"tool_choice.oneOf.0","typeLabel":"string"},{"type":"object","title":"Tool Choice","description":"'auto', 'none', or specific tool","additionalProperties":true,"uniqueKey":"tool_choice.oneOf.1","typeLabel":"Tool Choice · object"},{"type":"null","title":"Tool Choice","description":"'auto', 'none', or specific tool","uniqueKey":"tool_choice.oneOf.2","typeLabel":"null"}],"uniqueKey":"tool_choice","typeLabel":"string | Tool Choice · object | null"},"top_p":{"oneOf":[{"type":"number","title":"Top P","description":"Nucleus sampling","uniqueKey":"top_p.oneOf.0","typeLabel":"number"},{"type":"null","title":"Top P","description":"Nucleus sampling","uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number | null"},"top_k":{"oneOf":[{"type":"integer","title":"Top K","description":"Top-k sampling","uniqueKey":"top_k.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Top K","description":"Top-k sampling","uniqueKey":"top_k.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_k","typeLabel":"integer | null"},"n":{"oneOf":[{"type":"integer","title":"N","description":"Number of completions","default":1,"uniqueKey":"n.oneOf.0","typeLabel":"integer"},{"type":"null","title":"N","description":"Number of completions","default":1,"uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer | null"},"reasoning":{"oneOf":[{"type":"object","title":"ChatCompletionReasoning","description":"Reasoning configuration for the model","properties":{"effort":{"oneOf":[{"type":"string","title":"Effort","description":"Reasoning effort level (OpenAI-style)","enum":["xhigh","high","medium","low","minimal","none"],"uniqueKey":"reasoning.oneOf.0.effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Effort","description":"Reasoning effort level (OpenAI-style)","uniqueKey":"reasoning.oneOf.0.effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning.oneOf.0.effort","typeLabel":"enum\u003cstring> | null"},"max_tokens":{"oneOf":[{"type":"integer","title":"Max Tokens","description":"Specific token limit for reasoning (Anthropic-style)","uniqueKey":"reasoning.oneOf.0.max_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Max Tokens","description":"Specific token limit for reasoning (Anthropic-style)","uniqueKey":"reasoning.oneOf.0.max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning.oneOf.0.max_tokens","typeLabel":"integer | null"},"exclude":{"oneOf":[{"type":"boolean","title":"Exclude","description":"Set to true to exclude reasoning tokens from response","default":false,"uniqueKey":"reasoning.oneOf.0.exclude.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Exclude","description":"Set to true to exclude reasoning tokens from response","default":false,"uniqueKey":"reasoning.oneOf.0.exclude.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning.oneOf.0.exclude","typeLabel":"boolean | null"},"enabled":{"oneOf":[{"type":"boolean","title":"Enabled","description":"Enable reasoning with default parameters","uniqueKey":"reasoning.oneOf.0.enabled.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Enabled","description":"Enable reasoning with default parameters","uniqueKey":"reasoning.oneOf.0.enabled.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning.oneOf.0.enabled","typeLabel":"boolean | null"}},"uniqueKey":"reasoning.oneOf.0","typeLabel":"ChatCompletionReasoning · object"},{"type":"null","description":"Reasoning configuration for the model","uniqueKey":"reasoning.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning","typeLabel":"ChatCompletionReasoning · object | null"},"stream_options":{"oneOf":[{"type":"object","title":"Stream Options","description":"Options for streaming responses, e.g., {'include_usage': true}","additionalProperties":true,"uniqueKey":"stream_options.oneOf.0","typeLabel":"Stream Options · object"},{"type":"null","title":"Stream Options","description":"Options for streaming responses, e.g., {'include_usage': true}","uniqueKey":"stream_options.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options","typeLabel":"Stream Options · object | null"}},"type":"object","required":["model","messages"],"title":"ChatCompletionRequest","description":"A chat completion request in the OpenAI format.","uniqueKey":"","typeLabel":"ChatCompletionRequest · object"},"examples":{"Example":{"title":"Example","value":{"model":"model_01kmqm4nrn9fw6r","messages":[{"content":"\u003cstring>","name":"\u003cstring>"}],"max_tokens":200,"prompt_truncate_len":1500,"temperature":0.75,"stream":true,"tools":[{}],"tool_choice":"\u003cstring>","top_p":123,"top_k":123,"n":1,"reasoning":{"max_tokens":123,"exclude":false,"enabled":true},"stream_options":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"b33ac2fc-00de-4979-80a6-f5c83d15b8e5":{"description":"Streaming chat completion responses or complete response depending on stream parameter","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","title":"Id","description":"A unique identifier of the response.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"created":{"type":"number","title":"Created","description":"The Unix time in seconds when the response was generated.","isRequired":true,"uniqueKey":"created","typeLabel":"number"},"model":{"type":"string","title":"Model","description":"The model used for the chat completion.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"choices":{"items":{"properties":{"index":{"type":"integer","title":"Index","description":"The index of the chat completion choice.","isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"properties":{"role":{"type":"string","enum":["system","user","assistant"],"title":"Role","description":"The role of the author of this message.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","title":"Content","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Content","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"}},"type":"object","required":["role"],"title":"ChatCompletionResponseMessage","description":"The message object containing the response.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"ChatCompletionResponseMessage · object"},"finish_reason":{"type":"string","enum":["stop","length"],"title":"Finish Reason","description":"The reason the model stopped generating tokens. This will be \"stop\" if the model hit a natural stop point or a provided stop sequence, or \"length\" if the maximum number of tokens specified in the request was reached.","isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"}},"type":"object","required":["index","message","finish_reason"],"title":"ChatCompletionChoice","description":"One generated alternative in a chat completion response.","uniqueKey":"choices.items.[INDEX]","typeLabel":"ChatCompletionChoice · object"},"type":"array","title":"Choices","description":"The list of chat completion choices.","isRequired":true,"uniqueKey":"choices","typeLabel":"ChatCompletionChoice · object[]"},"confidence_score":{"oneOf":[{"type":"number","title":"Confidence Score","description":"Confidence Score from Domain-Aligned AI","isRequired":true,"uniqueKey":"confidence_score.oneOf.0","typeLabel":"number"},{"type":"null","title":"Confidence Score","description":"Confidence Score from Domain-Aligned AI","isRequired":true,"uniqueKey":"confidence_score.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"confidence_score","typeLabel":"number | null"},"object":{"type":"string","const":"chat.completion","title":"Object","description":"The object type, which is always \"chat.completion\".","default":"chat.completion","uniqueKey":"object","typeLabel":"string"},"usage":{"oneOf":[{"type":"object","title":"ChatCompletionUsage","description":"Usage statistics.\n\nFor streaming responses, `usage` field is included in the very last response chunk returned.\n\nNote that returning `usage` for streaming requests is a popular LLM API extension. If you use any popular LLM SDK, you might access the field directly even if it's not present in the type signature in the SDK.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"The number of tokens in the prompt.","isRequired":true,"uniqueKey":"usage.oneOf.0.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"The number of tokens in the generated completion.","isRequired":true,"uniqueKey":"usage.oneOf.0.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"The total number of tokens used in the request (prompt + completion).","isRequired":true,"uniqueKey":"usage.oneOf.0.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage.oneOf.0","typeLabel":"ChatCompletionUsage · object"},{"type":"null","description":"Usage statistics.\n\nFor streaming responses, `usage` field is included in the very last response chunk returned.\n\nNote that returning `usage` for streaming requests is a popular LLM API extension. If you use any popular LLM SDK, you might access the field directly even if it's not present in the type signature in the SDK.","uniqueKey":"usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage","typeLabel":"ChatCompletionUsage · object | null"}},"type":"object","required":["id","created","model","choices","confidence_score"],"title":"ChatCompletionResponse","description":"A chat completion response in the OpenAI format, with a confidence score on aligned models.","example":{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"I'm here to help you with anything you need!","role":"assistant"}}],"confidence_score":89.5454,"created":16285464635.5454,"id":"nugen-1234","model":"model_01kmqm4nrn9fw6r","object":"chat.completion","usage":{"completion_tokens":7,"prompt_tokens":5,"total_tokens":12}},"uniqueKey":"","typeLabel":"ChatCompletionResponse · object"},"examples":{"Example":{"title":"Example","value":{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"I'm here to help you with anything you need!","role":"assistant"}}],"confidence_score":89.5454,"created":16285464635.5454,"id":"nugen-1234","model":"model_01kmqm4nrn9fw6r","object":"chat.completion","usage":{"completion_tokens":7,"prompt_tokens":5,"total_tokens":12}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"oneOf":[{"type":"object","title":"ChatCompletionChunk","description":"Server-sent events. Each data line is one JSON event, and the stream ends with data: [DONE].","required":["id","choices","created","model","object"],"properties":{"id":{"title":"Id","type":"string","isRequired":true,"uniqueKey":"oneOf.0.id","typeLabel":"string"},"choices":{"items":{"additionalProperties":true,"properties":{"delta":{"additionalProperties":true,"description":"A chat completion delta generated by streamed model responses.","properties":{"content":{"oneOf":[{"type":"string","title":"Content","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content.oneOf.0","typeLabel":"string"},{"type":"null","title":"Content","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.content","typeLabel":"string | null"},"function_call":{"oneOf":[{"type":"object","title":"ChoiceDeltaFunctionCall","description":"Deprecated and replaced by `tool_calls`.\n\nThe name and arguments of a function that should be called, as generated by the model.","properties":{"arguments":{"oneOf":[{"type":"string","title":"Arguments","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.arguments.oneOf.0","typeLabel":"string"},{"type":"null","title":"Arguments","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.arguments.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.arguments","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","title":"Name","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0.name","typeLabel":"string | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.0","typeLabel":"ChoiceDeltaFunctionCall · object"},{"type":"null","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.function_call","typeLabel":"ChoiceDeltaFunctionCall · object | null"},"refusal":{"oneOf":[{"type":"string","title":"Refusal","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.refusal.oneOf.0","typeLabel":"string"},{"type":"null","title":"Refusal","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.refusal","typeLabel":"string | null"},"role":{"oneOf":[{"type":"string","title":"Role","enum":["developer","system","user","assistant","tool"],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Role","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.role","typeLabel":"enum\u003cstring> | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"properties":{"index":{"title":"Index","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].index","typeLabel":"integer"},"id":{"oneOf":[{"type":"string","title":"Id","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Id","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string | null"},"function":{"oneOf":[{"type":"object","title":"ChoiceDeltaToolCallFunction","description":"The function name and arguments of a streamed tool call.","properties":{"arguments":{"oneOf":[{"type":"string","title":"Arguments","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.arguments.oneOf.0","typeLabel":"string"},{"type":"null","title":"Arguments","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.arguments.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.arguments","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","title":"Name","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.name.oneOf.0","typeLabel":"string"},{"type":"null","title":"Name","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0.name","typeLabel":"string | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0","typeLabel":"ChoiceDeltaToolCallFunction · object"},{"type":"null","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"ChoiceDeltaToolCallFunction · object | null"},"type":{"oneOf":[{"type":"string","title":"Type","const":"function","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type.oneOf.0","typeLabel":"string"},{"type":"null","title":"Type","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"string | null"}},"required":["index"],"title":"ChoiceDeltaToolCall","type":"object","description":"A tool call carried by a streamed chunk.","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"ChoiceDeltaToolCall · object"},"title":"Tool Calls","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.0","typeLabel":"ChoiceDeltaToolCall · object[]"},{"type":"null","title":"Tool Calls","uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].delta.tool_calls","typeLabel":"ChoiceDeltaToolCall · object[] | null"}},"title":"ChoiceDelta","type":"object","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].delta","typeLabel":"ChoiceDelta · object"},"index":{"title":"Index","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].index","typeLabel":"integer"},"finish_reason":{"oneOf":[{"type":"string","title":"Finish Reason","enum":["stop","length","tool_calls","content_filter","function_call"],"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Finish Reason","uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring> | null"},"logprobs":{"oneOf":[{"type":"object","title":"ChoiceLogprobs","description":"Log probability information for the choice.","properties":{"content":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"properties":{"token":{"title":"Token","type":"string","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].token","typeLabel":"string"},"logprob":{"title":"Logprob","type":"number","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].logprob","typeLabel":"number"},"top_logprobs":{"items":{"additionalProperties":true,"properties":{"token":{"title":"Token","type":"string","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"logprob":{"title":"Logprob","type":"number","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"required":["token","logprob"],"title":"TopLogprob","type":"object","description":"One of the most likely tokens at a position, with its log probability.","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"TopLogprob · object"},"title":"Top Logprobs","type":"array","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].top_logprobs","typeLabel":"TopLogprob · object[]"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"required":["token","logprob","top_logprobs"],"title":"ChatCompletionTokenLogprob","type":"object","description":"Log probability of one token.","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0.items.[INDEX]","typeLabel":"ChatCompletionTokenLogprob · object"},"title":"Content","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.0","typeLabel":"ChatCompletionTokenLogprob · object[]"},{"type":"null","title":"Content","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.content","typeLabel":"ChatCompletionTokenLogprob · object[] | null"},"refusal":{"oneOf":[{"type":"array","items":{"additionalProperties":true,"properties":{"token":{"title":"Token","type":"string","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].token","typeLabel":"string"},"logprob":{"title":"Logprob","type":"number","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].logprob","typeLabel":"number"},"top_logprobs":{"items":{"additionalProperties":true,"properties":{"token":{"title":"Token","type":"string","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"logprob":{"title":"Logprob","type":"number","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"required":["token","logprob"],"title":"TopLogprob","type":"object","description":"One of the most likely tokens at a position, with its log probability.","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"TopLogprob · object"},"title":"Top Logprobs","type":"array","isRequired":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].top_logprobs","typeLabel":"TopLogprob · object[]"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer"},"title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].bytes.oneOf.0","typeLabel":"integer[]"},{"type":"null","title":"Bytes","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX].bytes","typeLabel":"integer[] | null"}},"required":["token","logprob","top_logprobs"],"title":"ChatCompletionTokenLogprob","type":"object","description":"Log probability of one token.","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0.items.[INDEX]","typeLabel":"ChatCompletionTokenLogprob · object"},"title":"Refusal","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.0","typeLabel":"ChatCompletionTokenLogprob · object[]"},{"type":"null","title":"Refusal","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0.refusal","typeLabel":"ChatCompletionTokenLogprob · object[] | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.0","typeLabel":"ChoiceLogprobs · object"},{"type":"null","uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.choices.items.[INDEX].logprobs","typeLabel":"ChoiceLogprobs · object | null"}},"required":["delta","index"],"title":"Choice","type":"object","description":"One choice of a streamed chunk.","uniqueKey":"oneOf.0.choices.items.[INDEX]","typeLabel":"Choice · object"},"title":"Choices","type":"array","isRequired":true,"uniqueKey":"oneOf.0.choices","typeLabel":"Choice · object[]"},"created":{"title":"Created","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.created","typeLabel":"integer"},"model":{"title":"Model","type":"string","isRequired":true,"uniqueKey":"oneOf.0.model","typeLabel":"string"},"object":{"const":"chat.completion.chunk","title":"Object","type":"string","isRequired":true,"uniqueKey":"oneOf.0.object","typeLabel":"string"},"service_tier":{"oneOf":[{"type":"string","title":"Service Tier","enum":["auto","default","flex","scale","priority"],"uniqueKey":"oneOf.0.service_tier.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Service Tier","uniqueKey":"oneOf.0.service_tier.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.service_tier","typeLabel":"enum\u003cstring> | null"},"system_fingerprint":{"oneOf":[{"type":"string","title":"System Fingerprint","uniqueKey":"oneOf.0.system_fingerprint.oneOf.0","typeLabel":"string"},{"type":"null","title":"System Fingerprint","uniqueKey":"oneOf.0.system_fingerprint.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.system_fingerprint","typeLabel":"string | null"},"usage":{"oneOf":[{"type":"object","title":"CompletionUsage","description":"Usage statistics for the completion request.","required":["completion_tokens","prompt_tokens","total_tokens"],"properties":{"completion_tokens":{"title":"Completion Tokens","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens","typeLabel":"integer"},"prompt_tokens":{"title":"Prompt Tokens","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens","typeLabel":"integer"},"total_tokens":{"title":"Total Tokens","type":"integer","isRequired":true,"uniqueKey":"oneOf.0.usage.oneOf.0.total_tokens","typeLabel":"integer"},"completion_tokens_details":{"oneOf":[{"type":"object","title":"CompletionTokensDetails","description":"Breakdown of tokens used in a completion.","properties":{"accepted_prediction_tokens":{"oneOf":[{"type":"integer","title":"Accepted Prediction Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.accepted_prediction_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Accepted Prediction Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.accepted_prediction_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.accepted_prediction_tokens","typeLabel":"integer | null"},"audio_tokens":{"oneOf":[{"type":"integer","title":"Audio Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.audio_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Audio Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.audio_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.audio_tokens","typeLabel":"integer | null"},"reasoning_tokens":{"oneOf":[{"type":"integer","title":"Reasoning Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.reasoning_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Reasoning Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.reasoning_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.reasoning_tokens","typeLabel":"integer | null"},"rejected_prediction_tokens":{"oneOf":[{"type":"integer","title":"Rejected Prediction Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.rejected_prediction_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Rejected Prediction Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.rejected_prediction_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0.rejected_prediction_tokens","typeLabel":"integer | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.0","typeLabel":"CompletionTokensDetails · object"},{"type":"null","uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.completion_tokens_details","typeLabel":"CompletionTokensDetails · object | null"},"prompt_tokens_details":{"oneOf":[{"type":"object","title":"PromptTokensDetails","description":"Breakdown of tokens used in the prompt.","properties":{"audio_tokens":{"oneOf":[{"type":"integer","title":"Audio Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.audio_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Audio Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.audio_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.audio_tokens","typeLabel":"integer | null"},"cached_tokens":{"oneOf":[{"type":"integer","title":"Cached Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Cached Tokens","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0.cached_tokens","typeLabel":"integer | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.0","typeLabel":"PromptTokensDetails · object"},{"type":"null","uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage.oneOf.0.prompt_tokens_details","typeLabel":"PromptTokensDetails · object | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0.usage.oneOf.0","typeLabel":"CompletionUsage · object"},{"type":"null","uniqueKey":"oneOf.0.usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.0.usage","typeLabel":"CompletionUsage · object | null"}},"additionalProperties":true,"uniqueKey":"oneOf.0","typeLabel":"ChatCompletionChunk · object"},{"type":"object","title":"ChatCompletionConfidenceEvent","description":"Server-sent events. Each data line is one JSON event, and the stream ends with data: [DONE].","required":["confidence_score"],"properties":{"confidence_score":{"description":"Confidence score from 0 to 100","title":"Confidence Score","type":"number","isRequired":true,"uniqueKey":"oneOf.1.confidence_score","typeLabel":"number"},"id":{"oneOf":[{"type":"string","title":"Id","description":"Identifier of the streamed completion","uniqueKey":"oneOf.1.id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Id","description":"Identifier of the streamed completion","uniqueKey":"oneOf.1.id.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.id","typeLabel":"string | null"},"object":{"const":"confidence","default":"confidence","description":"Always \"confidence\"","title":"Object","type":"string","uniqueKey":"oneOf.1.object","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"oneOf.1","typeLabel":"ChatCompletionConfidenceEvent · object"}],"uniqueKey":"","typeLabel":"ChatCompletionChunk · object | ChatCompletionConfidenceEvent · object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","choices":[{"delta":{"content":"\u003cstring>","function_call":{"arguments":"\u003cstring>","name":"\u003cstring>"},"refusal":"\u003cstring>","role":"developer","tool_calls":[{"index":123,"id":"\u003cstring>","function":{"arguments":"\u003cstring>","name":"\u003cstring>"},"type":"function"}]},"index":123,"finish_reason":"stop","logprobs":{"content":[{"token":"\u003cstring>","logprob":123,"top_logprobs":[{"token":"\u003cstring>","logprob":123,"bytes":[123]}],"bytes":[123]}],"refusal":[{"token":"\u003cstring>","logprob":123,"top_logprobs":[{"token":"\u003cstring>","logprob":123,"bytes":[123]}],"bytes":[123]}]}}],"created":123,"model":"\u003cstring>","object":"chat.completion.chunk","service_tier":"auto","system_fingerprint":"\u003cstring>","usage":{"completion_tokens":123,"prompt_tokens":123,"total_tokens":123,"completion_tokens_details":{"accepted_prediction_tokens":123,"audio_tokens":123,"reasoning_tokens":123,"rejected_prediction_tokens":123},"prompt_tokens_details":{"audio_tokens":123,"cached_tokens":123}}}}},"exampleType":"generated"}},"exampleType":"generated"},"74ed27d3-d483-4932-8419-ed9287f28f61":{"description":"Invalid API key","content":{"application/json":{"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Model not found"}}},"exampleType":"generated"}},"exampleType":"generated"},"f8452011-7b84-40ef-b171-5676cb86babd":{"description":"Authorization header missing or not a Bearer token","content":{"application/json":{"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Model not found"}}},"exampleType":"generated"}},"exampleType":"generated"},"8fe01068-c27b-4624-b1c1-785fae9ff4aa":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","description":"One request validation problem.","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","description":"Body of a request validation error.","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"17925752-62fb-4cd2-9721-8e23fdd692e9":{"description":"Base model rate limit exceeded","headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"integer"}}},"content":{"application/json":{"example":{"detail":"Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."},"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Base model rate limit of 10 requests/minute reached. Use your aligned model for higher throughput."}}},"exampleType":"examples"}},"exampleType":"examples"},"5a1c6a17-e972-4c42-800e-9d58b94106f6":{"description":"A non-streaming call did not finish before the deadline. Set stream to true for long generations.","content":{"application/json":{"schema":{"description":"Body of an error response.","properties":{"detail":{"oneOf":[{"type":"string","title":"Detail","description":"Human readable explanation of the error, or an object with a message and the id of the resource concerned","example":"Model not found","isRequired":true,"uniqueKey":"detail.oneOf.0","typeLabel":"string"},{"type":"object","title":"ErrorDetail","description":"Structured error detail: a message, with the id of the resource it concerns as an extra key.","required":["message"],"example":"Model not found","properties":{"message":{"description":"Human readable explanation of the error","title":"Message","type":"string","isRequired":true,"uniqueKey":"detail.oneOf.1.message","typeLabel":"string"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"detail.oneOf.1","typeLabel":"ErrorDetail · object"}],"isRequired":true,"uniqueKey":"detail","typeLabel":"string | ErrorDetail · object"}},"required":["detail"],"title":"ErrorResponse","type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"Model not found"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"a1c495bb-b5e0-4d70-a4de-d9f135d9d59e":{"ApiKeyAuth":{"type":"http","description":"Your Nugen API key, sent as a Bearer token","scheme":"bearer","bearerFormat":"API key","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"f2e8d2a7-ba73-49ff-aa3d-fa8b212b7b35":{"url":"https://api.nugen.in","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","description":"Your Nugen API key, sent as a Bearer token","scheme":"bearer","bearerFormat":"API key","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Your Nugen API key, sent as a Bearer token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"https://api.nugen.in/openapi-public.json"},"subdomain":"courteasy","siteName":"Nugen API Reference Docs","title":"Generate Chat Completions - Nugen API Reference Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-16T14:08:30.333Z","originalFileLocation":"api-reference/inference/generate-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 conversational responses with streaming support and multimodal capabilities. This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id - messages: Array of message objects (required, minimum 1), each containing: - role: Message role (system, user, or assistant) - content: Text string OR array of content objects (for multimodal) - Text: {\u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;your message\u0026quot;} - Image URL: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;https://...\u0026quot;}} - Image Base64: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,...\u0026quot;}} - name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars) - max_tokens (optional): Maximum tokens to generate in completion - prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500) - temperature (optional): Sampling temperature between 0 and 2 (default: 1) - stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response. \u0026gt; Tip: For prompts where you expect a long output (e.g., max_tokens \u0026gt; 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses. - tools (optional): List of tools/functions available to the model - tool_choice (optional): Tool selection mode (auto, none, or specific tool) - top_p (optional): Nucleus sampling parameter - top_k (optional): Top-k sampling parameter - n (optional): Number of completions to generate (default: 1) - reasoning (optional): Reasoning configuration object with: - effort: Reasoning effort level (xhigh, high, medium, low, minimal, none) - max_tokens: Token limit for reasoning - exclude: Set true to exclude reasoning tokens from response - enabled: Enable reasoning with default parameters Optional Headers: - X-Session-ID: Session identifier for multi-turn conversation tracking Returns: Non-streaming mode - - id: Unique identifier for the response - object: Object type (always chat.completion) - created: Unix timestamp when completion was created - model: Model used for chat completion - choices: List of completion choices, each containing: - index: Index of the choice - message: Response message with: - role: Role of the author (always assistant) - content: Generated response text - tool_calls (optional): Tool calls made by the model (for function calling) - finish_reason: Reason model stopped (stop for natural stop, length if max tokens reached) - usage: Token usage statistics: - prompt_tokens: Number of tokens in the prompt - completion_tokens: Number of tokens generated - total_tokens: Total tokens used (prompt + completion) - confidence_score (optional): Confidence score, 0-100, on aligned models; null on base models Streaming mode - ChatCompletionChunk stream with: - id: Unique identifier - created: Timestamp - model: Model ID - choices: List of chunk choices with: - index: ChatCompletionChoice index - delta: Delta content with role and content - finish_reason: Reason for stopping (only in final chunk) - usage (optional): Only present in final chunk Example Request (Text Chat): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;system\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;You are a helpful assistant.\u0026quot; }, { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the capital of France?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Text Chat): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc123\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123600.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;The capital of France is Paris.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 20, \u0026quot;completion_tokens\u0026quot;: 8, \u0026quot;total_tokens\u0026quot;: 28 }, \u0026quot;confidence_score\u0026quot;: 89.5454 } Example Request (Using Domain-Aligned Model): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;How do I return a product?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Domain-Aligned Model): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc456\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123700.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 15, \u0026quot;completion_tokens\u0026quot;: 25, \u0026quot;total_tokens\u0026quot;: 40 }, \u0026quot;confidence_score\u0026quot;: 95.8 } How to get your aligned model ID: 1. Create an alignment project using POST /api/v3/alignment-projects/create 2. Poll GET /api/v3/alignment-projects/{id}/status until status is READY 3. Use the model_id field from the response (e.g., \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;) 4. Deploy the model using POST /api/v3/models/{model_id}/deployment (optional - for evaluation/production use) 5. Use the model_id in the model parameter for inference requests Example Request (Vision - Image URL): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;Describe what you see in this image.\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;https://example.com/image.jpg\u0026quot; } } ] } ], \u0026quot;max_tokens\u0026quot;: 1000, \u0026quot;stream\u0026quot;: false } Example Request (Vision - Base64 Image): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;What\u0026#x27;s in this image?\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\u0026quot; } } ] } ], \u0026quot;stream\u0026quot;: false } Example Request (Function Calling): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ {\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the status of INC-4821?\u0026quot;} ], \u0026quot;tools\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;function\u0026quot;, \u0026quot;function\u0026quot;: { \u0026quot;name\u0026quot;: \u0026quot;get_incident\u0026quot;, \u0026quot;description\u0026quot;: \u0026quot;Get incident status\u0026quot;, \u0026quot;parameters\u0026quot;: { \u0026quot;type\u0026quot;: \u0026quot;object\u0026quot;, \u0026quot;properties\u0026quot;: { \u0026quot;incident_id\u0026quot;: {\u0026quot;type\u0026quot;: \u0026quot;string\u0026quot;} } } } } ], \u0026quot;tool_choice\u0026quot;: \u0026quot;auto\u0026quot;, \u0026quot;stream\u0026quot;: false } Example Request (Streaming): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [{\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;Tell me a story\u0026quot;}], \u0026quot;stream\u0026quot;: true } Example Response (Streaming): data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;role\u0026quot;:\u0026quot;assistant\u0026quot;,\u0026quot;content\u0026quot;:\u0026quot;Once\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; upon\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; a time\u0026quot;},\u0026quot;finish_reason\u0026quot;:\u0026quot;stop\u0026quot;}],\u0026quot;usage\u0026quot;:{\u0026quot;prompt_tokens\u0026quot;:10,\u0026quot;completion_tokens\u0026quot;:5,\u0026quot;total_tokens\u0026quot;:15}} data: [DONE] Provisioned throughput: Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition. Notes: - Supports both text-only and vision/multimodal inputs depending on the model - Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned - Function calling enables models to invoke external tools via tools and tool_choice parameters - confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {\u0026quot;object\u0026quot;: \u0026quot;confidence\u0026quot;, ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk - For streaming, usage statistics are included only in the final chunk - Conversations are automatically saved to S3 if enabled in user settings - Include X-Session-ID header for multi-turn conversation tracking - Use prompt_truncate_len to control context window usage for long conversations - The reasoning parameter enables advanced reasoning capabilities for supported models\">\u003cmeta data-mint-head name=\"application-name\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate Chat Completions - Nugen API Reference Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate conversational responses with streaming support and multimodal capabilities. This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id - messages: Array of message objects (required, minimum 1), each containing: - role: Message role (system, user, or assistant) - content: Text string OR array of content objects (for multimodal) - Text: {\u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;your message\u0026quot;} - Image URL: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;https://...\u0026quot;}} - Image Base64: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,...\u0026quot;}} - name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars) - max_tokens (optional): Maximum tokens to generate in completion - prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500) - temperature (optional): Sampling temperature between 0 and 2 (default: 1) - stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response. \u0026gt; Tip: For prompts where you expect a long output (e.g., max_tokens \u0026gt; 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses. - tools (optional): List of tools/functions available to the model - tool_choice (optional): Tool selection mode (auto, none, or specific tool) - top_p (optional): Nucleus sampling parameter - top_k (optional): Top-k sampling parameter - n (optional): Number of completions to generate (default: 1) - reasoning (optional): Reasoning configuration object with: - effort: Reasoning effort level (xhigh, high, medium, low, minimal, none) - max_tokens: Token limit for reasoning - exclude: Set true to exclude reasoning tokens from response - enabled: Enable reasoning with default parameters Optional Headers: - X-Session-ID: Session identifier for multi-turn conversation tracking Returns: Non-streaming mode - - id: Unique identifier for the response - object: Object type (always chat.completion) - created: Unix timestamp when completion was created - model: Model used for chat completion - choices: List of completion choices, each containing: - index: Index of the choice - message: Response message with: - role: Role of the author (always assistant) - content: Generated response text - tool_calls (optional): Tool calls made by the model (for function calling) - finish_reason: Reason model stopped (stop for natural stop, length if max tokens reached) - usage: Token usage statistics: - prompt_tokens: Number of tokens in the prompt - completion_tokens: Number of tokens generated - total_tokens: Total tokens used (prompt + completion) - confidence_score (optional): Confidence score, 0-100, on aligned models; null on base models Streaming mode - ChatCompletionChunk stream with: - id: Unique identifier - created: Timestamp - model: Model ID - choices: List of chunk choices with: - index: ChatCompletionChoice index - delta: Delta content with role and content - finish_reason: Reason for stopping (only in final chunk) - usage (optional): Only present in final chunk Example Request (Text Chat): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;system\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;You are a helpful assistant.\u0026quot; }, { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the capital of France?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Text Chat): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc123\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123600.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;The capital of France is Paris.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 20, \u0026quot;completion_tokens\u0026quot;: 8, \u0026quot;total_tokens\u0026quot;: 28 }, \u0026quot;confidence_score\u0026quot;: 89.5454 } Example Request (Using Domain-Aligned Model): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;How do I return a product?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Domain-Aligned Model): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc456\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123700.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 15, \u0026quot;completion_tokens\u0026quot;: 25, \u0026quot;total_tokens\u0026quot;: 40 }, \u0026quot;confidence_score\u0026quot;: 95.8 } How to get your aligned model ID: 1. Create an alignment project using POST /api/v3/alignment-projects/create 2. Poll GET /api/v3/alignment-projects/{id}/status until status is READY 3. Use the model_id field from the response (e.g., \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;) 4. Deploy the model using POST /api/v3/models/{model_id}/deployment (optional - for evaluation/production use) 5. Use the model_id in the model parameter for inference requests Example Request (Vision - Image URL): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;Describe what you see in this image.\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;https://example.com/image.jpg\u0026quot; } } ] } ], \u0026quot;max_tokens\u0026quot;: 1000, \u0026quot;stream\u0026quot;: false } Example Request (Vision - Base64 Image): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;What\u0026#x27;s in this image?\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\u0026quot; } } ] } ], \u0026quot;stream\u0026quot;: false } Example Request (Function Calling): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ {\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the status of INC-4821?\u0026quot;} ], \u0026quot;tools\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;function\u0026quot;, \u0026quot;function\u0026quot;: { \u0026quot;name\u0026quot;: \u0026quot;get_incident\u0026quot;, \u0026quot;description\u0026quot;: \u0026quot;Get incident status\u0026quot;, \u0026quot;parameters\u0026quot;: { \u0026quot;type\u0026quot;: \u0026quot;object\u0026quot;, \u0026quot;properties\u0026quot;: { \u0026quot;incident_id\u0026quot;: {\u0026quot;type\u0026quot;: \u0026quot;string\u0026quot;} } } } } ], \u0026quot;tool_choice\u0026quot;: \u0026quot;auto\u0026quot;, \u0026quot;stream\u0026quot;: false } Example Request (Streaming): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [{\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;Tell me a story\u0026quot;}], \u0026quot;stream\u0026quot;: true } Example Response (Streaming): data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;role\u0026quot;:\u0026quot;assistant\u0026quot;,\u0026quot;content\u0026quot;:\u0026quot;Once\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; upon\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; a time\u0026quot;},\u0026quot;finish_reason\u0026quot;:\u0026quot;stop\u0026quot;}],\u0026quot;usage\u0026quot;:{\u0026quot;prompt_tokens\u0026quot;:10,\u0026quot;completion_tokens\u0026quot;:5,\u0026quot;total_tokens\u0026quot;:15}} data: [DONE] Provisioned throughput: Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition. Notes: - Supports both text-only and vision/multimodal inputs depending on the model - Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned - Function calling enables models to invoke external tools via tools and tool_choice parameters - confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {\u0026quot;object\u0026quot;: \u0026quot;confidence\u0026quot;, ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk - For streaming, usage statistics are included only in the final chunk - Conversations are automatically saved to S3 if enabled in user settings - Include X-Session-ID header for multi-turn conversation tracking - Use prompt_truncate_len to control context window usage for long conversations - The reasoning parameter enables advanced reasoning capabilities for supported models\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.nugen.in/api-reference/inference/generate-chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://courteasy.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Generate+Chat+Completions\u0026amp;description=Generate+conversational+responses+with+streaming+support+and+multimodal+capabilities.%0A%0A%0AThis+endpoint+generates+chat+completions+using+language+models%2C+supporti\u0026amp;theme=4bbb9e0a87338e6afdf0d548\u0026amp;signature=6c7f9b5fc298487ce583eda56e9f8124a38299c9aa69d12459e3a1c125d7d3fe\">\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=\"Generate Chat Completions - Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate conversational responses with streaming support and multimodal capabilities. This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id - messages: Array of message objects (required, minimum 1), each containing: - role: Message role (system, user, or assistant) - content: Text string OR array of content objects (for multimodal) - Text: {\u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;your message\u0026quot;} - Image URL: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;https://...\u0026quot;}} - Image Base64: {\u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: {\u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,...\u0026quot;}} - name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars) - max_tokens (optional): Maximum tokens to generate in completion - prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500) - temperature (optional): Sampling temperature between 0 and 2 (default: 1) - stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response. \u0026gt; Tip: For prompts where you expect a long output (e.g., max_tokens \u0026gt; 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses. - tools (optional): List of tools/functions available to the model - tool_choice (optional): Tool selection mode (auto, none, or specific tool) - top_p (optional): Nucleus sampling parameter - top_k (optional): Top-k sampling parameter - n (optional): Number of completions to generate (default: 1) - reasoning (optional): Reasoning configuration object with: - effort: Reasoning effort level (xhigh, high, medium, low, minimal, none) - max_tokens: Token limit for reasoning - exclude: Set true to exclude reasoning tokens from response - enabled: Enable reasoning with default parameters Optional Headers: - X-Session-ID: Session identifier for multi-turn conversation tracking Returns: Non-streaming mode - - id: Unique identifier for the response - object: Object type (always chat.completion) - created: Unix timestamp when completion was created - model: Model used for chat completion - choices: List of completion choices, each containing: - index: Index of the choice - message: Response message with: - role: Role of the author (always assistant) - content: Generated response text - tool_calls (optional): Tool calls made by the model (for function calling) - finish_reason: Reason model stopped (stop for natural stop, length if max tokens reached) - usage: Token usage statistics: - prompt_tokens: Number of tokens in the prompt - completion_tokens: Number of tokens generated - total_tokens: Total tokens used (prompt + completion) - confidence_score (optional): Confidence score, 0-100, on aligned models; null on base models Streaming mode - ChatCompletionChunk stream with: - id: Unique identifier - created: Timestamp - model: Model ID - choices: List of chunk choices with: - index: ChatCompletionChoice index - delta: Delta content with role and content - finish_reason: Reason for stopping (only in final chunk) - usage (optional): Only present in final chunk Example Request (Text Chat): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;system\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;You are a helpful assistant.\u0026quot; }, { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the capital of France?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Text Chat): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc123\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123600.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;The capital of France is Paris.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 20, \u0026quot;completion_tokens\u0026quot;: 8, \u0026quot;total_tokens\u0026quot;: 28 }, \u0026quot;confidence_score\u0026quot;: 89.5454 } Example Request (Using Domain-Aligned Model): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;How do I return a product?\u0026quot; } ], \u0026quot;max_tokens\u0026quot;: 500, \u0026quot;temperature\u0026quot;: 0.7, \u0026quot;stream\u0026quot;: false } Example Response (Domain-Aligned Model): json { \u0026quot;id\u0026quot;: \u0026quot;nugen-abc456\u0026quot;, \u0026quot;object\u0026quot;: \u0026quot;chat.completion\u0026quot;, \u0026quot;created\u0026quot;: 1704123700.0, \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;choices\u0026quot;: [ { \u0026quot;index\u0026quot;: 0, \u0026quot;message\u0026quot;: { \u0026quot;role\u0026quot;: \u0026quot;assistant\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\u0026quot; }, \u0026quot;finish_reason\u0026quot;: \u0026quot;stop\u0026quot; } ], \u0026quot;usage\u0026quot;: { \u0026quot;prompt_tokens\u0026quot;: 15, \u0026quot;completion_tokens\u0026quot;: 25, \u0026quot;total_tokens\u0026quot;: 40 }, \u0026quot;confidence_score\u0026quot;: 95.8 } How to get your aligned model ID: 1. Create an alignment project using POST /api/v3/alignment-projects/create 2. Poll GET /api/v3/alignment-projects/{id}/status until status is READY 3. Use the model_id field from the response (e.g., \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;) 4. Deploy the model using POST /api/v3/models/{model_id}/deployment (optional - for evaluation/production use) 5. Use the model_id in the model parameter for inference requests Example Request (Vision - Image URL): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;Describe what you see in this image.\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;https://example.com/image.jpg\u0026quot; } } ] } ], \u0026quot;max_tokens\u0026quot;: 1000, \u0026quot;stream\u0026quot;: false } Example Request (Vision - Base64 Image): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ { \u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;text\u0026quot;, \u0026quot;text\u0026quot;: \u0026quot;What\u0026#x27;s in this image?\u0026quot; }, { \u0026quot;type\u0026quot;: \u0026quot;image_url\u0026quot;, \u0026quot;image_url\u0026quot;: { \u0026quot;url\u0026quot;: \u0026quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\u0026quot; } } ] } ], \u0026quot;stream\u0026quot;: false } Example Request (Function Calling): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [ {\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;What is the status of INC-4821?\u0026quot;} ], \u0026quot;tools\u0026quot;: [ { \u0026quot;type\u0026quot;: \u0026quot;function\u0026quot;, \u0026quot;function\u0026quot;: { \u0026quot;name\u0026quot;: \u0026quot;get_incident\u0026quot;, \u0026quot;description\u0026quot;: \u0026quot;Get incident status\u0026quot;, \u0026quot;parameters\u0026quot;: { \u0026quot;type\u0026quot;: \u0026quot;object\u0026quot;, \u0026quot;properties\u0026quot;: { \u0026quot;incident_id\u0026quot;: {\u0026quot;type\u0026quot;: \u0026quot;string\u0026quot;} } } } } ], \u0026quot;tool_choice\u0026quot;: \u0026quot;auto\u0026quot;, \u0026quot;stream\u0026quot;: false } Example Request (Streaming): json POST /api/v3/inference/chat/completions Headers: {\u0026quot;Authorization\u0026quot;: \u0026quot;Bearer \u0026quot;} { \u0026quot;model\u0026quot;: \u0026quot;model_01kmqm4nrn9fw6r\u0026quot;, \u0026quot;messages\u0026quot;: [{\u0026quot;role\u0026quot;: \u0026quot;user\u0026quot;, \u0026quot;content\u0026quot;: \u0026quot;Tell me a story\u0026quot;}], \u0026quot;stream\u0026quot;: true } Example Response (Streaming): data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;role\u0026quot;:\u0026quot;assistant\u0026quot;,\u0026quot;content\u0026quot;:\u0026quot;Once\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; upon\u0026quot;},\u0026quot;finish_reason\u0026quot;:null}]} data: {\u0026quot;id\u0026quot;:\u0026quot;nugen-abc123\u0026quot;,\u0026quot;created\u0026quot;:1704123600.0,\u0026quot;model\u0026quot;:\u0026quot;model_01kmqm4nrn9fw6r\u0026quot;,\u0026quot;choices\u0026quot;:[{\u0026quot;index\u0026quot;:0,\u0026quot;delta\u0026quot;:{\u0026quot;content\u0026quot;:\u0026quot; a time\u0026quot;},\u0026quot;finish_reason\u0026quot;:\u0026quot;stop\u0026quot;}],\u0026quot;usage\u0026quot;:{\u0026quot;prompt_tokens\u0026quot;:10,\u0026quot;completion_tokens\u0026quot;:5,\u0026quot;total_tokens\u0026quot;:15}} data: [DONE] Provisioned throughput: Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition. Notes: - Supports both text-only and vision/multimodal inputs depending on the model - Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned - Function calling enables models to invoke external tools via tools and tool_choice parameters - confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {\u0026quot;object\u0026quot;: \u0026quot;confidence\u0026quot;, ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk - For streaming, usage statistics are included only in the final chunk - Conversations are automatically saved to S3 if enabled in user settings - Include X-Session-ID header for multi-turn conversation tracking - Use prompt_truncate_len to control context window usage for long conversations - The reasoning parameter enables advanced reasoning capabilities for supported models\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://courteasy.mintlify.site/_mintlify/api/og/v2?division=Inference\u0026amp;title=Generate+Chat+Completions\u0026amp;description=Generate+conversational+responses+with+streaming+support+and+multimodal+capabilities.%0A%0A%0AThis+endpoint+generates+chat+completions+using+language+models%2C+supporti\u0026amp;theme=4bbb9e0a87338e6afdf0d548\u0026amp;signature=6c7f9b5fc298487ce583eda56e9f8124a38299c9aa69d12459e3a1c125d7d3fe\">\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/courteasy/0D-fi3HjPY3grfJo/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Nugen API Reference Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#005b96\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.nugen.in/api-reference/inference/generate-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-reference/inference/generate-chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.nugen.in/#organization\",\"name\":\"Nugen API Reference Docs\",\"url\":\"https://docs.nugen.in\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/courteasy/YYugGl8ZAoQlnBYp/logo/light.svg?fit=max\u0026auto=format\u0026n=YYugGl8ZAoQlnBYp\u0026q=85\u0026s=f5f462b08161252f94dca4827e8055a0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.nugen.in#website\",\"name\":\"Nugen API Reference Docs\",\"url\":\"https://docs.nugen.in\",\"publisher\":{\"@id\":\"https://docs.nugen.in/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions#webpage\",\"url\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions\",\"name\":\"Generate Chat Completions\",\"description\":\"Generate conversational responses with streaming support and multimodal capabilities. This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id - messages: Array of message objects (required, minimum 1), each containing: - role: Message role (system, user, or assistant) - content: Text string OR array of content objects (for multimodal) - Text: {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"your message\\\"} - Image URL: {\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"https://...\\\"}} - Image Base64: {\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"data:image/jpeg;base64,...\\\"}} - name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars) - max_tokens (optional): Maximum tokens to generate in completion - prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500) - temperature (optional): Sampling temperature between 0 and 2 (default: 1) - stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response. > Tip: For prompts where you expect a long output (e.g., max_tokens > 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses. - tools (optional): List of tools/functions available to the model - tool_choice (optional): Tool selection mode (auto, none, or specific tool) - top_p (optional): Nucleus sampling parameter - top_k (optional): Top-k sampling parameter - n (optional): Number of completions to generate (default: 1) - reasoning (optional): Reasoning configuration object with: - effort: Reasoning effort level (xhigh, high, medium, low, minimal, none) - max_tokens: Token limit for reasoning - exclude: Set true to exclude reasoning tokens from response - enabled: Enable reasoning with default parameters Optional Headers: - X-Session-ID: Session identifier for multi-turn conversation tracking Returns: Non-streaming mode - - id: Unique identifier for the response - object: Object type (always chat.completion) - created: Unix timestamp when completion was created - model: Model used for chat completion - choices: List of completion choices, each containing: - index: Index of the choice - message: Response message with: - role: Role of the author (always assistant) - content: Generated response text - tool_calls (optional): Tool calls made by the model (for function calling) - finish_reason: Reason model stopped (stop for natural stop, length if max tokens reached) - usage: Token usage statistics: - prompt_tokens: Number of tokens in the prompt - completion_tokens: Number of tokens generated - total_tokens: Total tokens used (prompt + completion) - confidence_score (optional): Confidence score, 0-100, on aligned models; null on base models Streaming mode - ChatCompletionChunk stream with: - id: Unique identifier - created: Timestamp - model: Model ID - choices: List of chunk choices with: - index: ChatCompletionChoice index - delta: Delta content with role and content - finish_reason: Reason for stopping (only in final chunk) - usage (optional): Only present in final chunk Example Request (Text Chat): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"system\\\", \\\"content\\\": \\\"You are a helpful assistant.\\\" }, { \\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"What is the capital of France?\\\" } ], \\\"max_tokens\\\": 500, \\\"temperature\\\": 0.7, \\\"stream\\\": false } Example Response (Text Chat): json { \\\"id\\\": \\\"nugen-abc123\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1704123600.0, \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"The capital of France is Paris.\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 20, \\\"completion_tokens\\\": 8, \\\"total_tokens\\\": 28 }, \\\"confidence_score\\\": 89.5454 } Example Request (Using Domain-Aligned Model): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"How do I return a product?\\\" } ], \\\"max_tokens\\\": 500, \\\"temperature\\\": 0.7, \\\"stream\\\": false } Example Response (Domain-Aligned Model): json { \\\"id\\\": \\\"nugen-abc456\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1704123700.0, \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 15, \\\"completion_tokens\\\": 25, \\\"total_tokens\\\": 40 }, \\\"confidence_score\\\": 95.8 } How to get your aligned model ID: 1. Create an alignment project using POST /api/v3/alignment-projects/create 2. Poll GET /api/v3/alignment-projects/{id}/status until status is READY 3. Use the model_id field from the response (e.g., \\\"model_01kmqm4nrn9fw6r\\\") 4. Deploy the model using POST /api/v3/models/{model_id}/deployment (optional - for evaluation/production use) 5. Use the model_id in the model parameter for inference requests Example Request (Vision - Image URL): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Describe what you see in this image.\\\" }, { \\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": { \\\"url\\\": \\\"https://example.com/image.jpg\\\" } } ] } ], \\\"max_tokens\\\": 1000, \\\"stream\\\": false } Example Request (Vision - Base64 Image): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's in this image?\\\" }, { \\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": { \\\"url\\\": \\\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\\\" } } ] } ], \\\"stream\\\": false } Example Request (Function Calling): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ {\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"What is the status of INC-4821?\\\"} ], \\\"tools\\\": [ { \\\"type\\\": \\\"function\\\", \\\"function\\\": { \\\"name\\\": \\\"get_incident\\\", \\\"description\\\": \\\"Get incident status\\\", \\\"parameters\\\": { \\\"type\\\": \\\"object\\\", \\\"properties\\\": { \\\"incident_id\\\": {\\\"type\\\": \\\"string\\\"} } } } } ], \\\"tool_choice\\\": \\\"auto\\\", \\\"stream\\\": false } Example Request (Streaming): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [{\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"Tell me a story\\\"}], \\\"stream\\\": true } Example Response (Streaming): data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"Once\\\"},\\\"finish_reason\\\":null}]} data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" upon\\\"},\\\"finish_reason\\\":null}]} data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" a time\\\"},\\\"finish_reason\\\":\\\"stop\\\"}],\\\"usage\\\":{\\\"prompt_tokens\\\":10,\\\"completion_tokens\\\":5,\\\"total_tokens\\\":15}} data: [DONE] Provisioned throughput: Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition. Notes: - Supports both text-only and vision/multimodal inputs depending on the model - Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned - Function calling enables models to invoke external tools via tools and tool_choice parameters - confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {\\\"object\\\": \\\"confidence\\\", ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk - For streaming, usage statistics are included only in the final chunk - Conversations are automatically saved to S3 if enabled in user settings - Include X-Session-ID header for multi-turn conversation tracking - Use prompt_truncate_len to control context window usage for long conversations - The reasoning parameter enables advanced reasoning capabilities for supported models\",\"dateModified\":\"2026-11-16T14:08:30.333Z\",\"isPartOf\":{\"@id\":\"https://docs.nugen.in#website\"},\"breadcrumb\":{\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inference\",\"item\":\"https://docs.nugen.in/api-reference/inference/generate-embeddings\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate Chat Completions\",\"item\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions#apireference\",\"headline\":\"Generate Chat Completions\",\"name\":\"Generate Chat Completions\",\"description\":\"Generate conversational responses with streaming support and multimodal capabilities. This endpoint generates chat completions using language models, supporting both text-only conversations and vision inputs. Includes support for function calling, streaming responses, and automatic conversation tracking. Request Body: - model: Model ID (required). Use your aligned model id (e.g. model_01kmqm4nrn9fw6r); base text models (e.g. model_01kmqm4nrn9fw6r) also work if you have not aligned a model yet. For reserved capacity pass ptm_id:model_id - messages: Array of message objects (required, minimum 1), each containing: - role: Message role (system, user, or assistant) - content: Text string OR array of content objects (for multimodal) - Text: {\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"your message\\\"} - Image URL: {\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"https://...\\\"}} - Image Base64: {\\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": {\\\"url\\\": \\\"data:image/jpeg;base64,...\\\"}} - name (optional): Author name (a-z, A-Z, 0-9, underscores, max 64 chars) - max_tokens (optional): Maximum tokens to generate in completion - prompt_truncate_len (optional): Size to truncate chat prompts (default: 1500) - temperature (optional): Sampling temperature between 0 and 2 (default: 1) - stream (optional): Stream the response as server-sent events (default: true). Set stream: false for one JSON response. > Tip: For prompts where you expect a long output (e.g., max_tokens > 500), keep streaming on to avoid HTTP 504 gateway timeouts on slow or large responses. - tools (optional): List of tools/functions available to the model - tool_choice (optional): Tool selection mode (auto, none, or specific tool) - top_p (optional): Nucleus sampling parameter - top_k (optional): Top-k sampling parameter - n (optional): Number of completions to generate (default: 1) - reasoning (optional): Reasoning configuration object with: - effort: Reasoning effort level (xhigh, high, medium, low, minimal, none) - max_tokens: Token limit for reasoning - exclude: Set true to exclude reasoning tokens from response - enabled: Enable reasoning with default parameters Optional Headers: - X-Session-ID: Session identifier for multi-turn conversation tracking Returns: Non-streaming mode - - id: Unique identifier for the response - object: Object type (always chat.completion) - created: Unix timestamp when completion was created - model: Model used for chat completion - choices: List of completion choices, each containing: - index: Index of the choice - message: Response message with: - role: Role of the author (always assistant) - content: Generated response text - tool_calls (optional): Tool calls made by the model (for function calling) - finish_reason: Reason model stopped (stop for natural stop, length if max tokens reached) - usage: Token usage statistics: - prompt_tokens: Number of tokens in the prompt - completion_tokens: Number of tokens generated - total_tokens: Total tokens used (prompt + completion) - confidence_score (optional): Confidence score, 0-100, on aligned models; null on base models Streaming mode - ChatCompletionChunk stream with: - id: Unique identifier - created: Timestamp - model: Model ID - choices: List of chunk choices with: - index: ChatCompletionChoice index - delta: Delta content with role and content - finish_reason: Reason for stopping (only in final chunk) - usage (optional): Only present in final chunk Example Request (Text Chat): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"system\\\", \\\"content\\\": \\\"You are a helpful assistant.\\\" }, { \\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"What is the capital of France?\\\" } ], \\\"max_tokens\\\": 500, \\\"temperature\\\": 0.7, \\\"stream\\\": false } Example Response (Text Chat): json { \\\"id\\\": \\\"nugen-abc123\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1704123600.0, \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"The capital of France is Paris.\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 20, \\\"completion_tokens\\\": 8, \\\"total_tokens\\\": 28 }, \\\"confidence_score\\\": 89.5454 } Example Request (Using Domain-Aligned Model): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"How do I return a product?\\\" } ], \\\"max_tokens\\\": 500, \\\"temperature\\\": 0.7, \\\"stream\\\": false } Example Response (Domain-Aligned Model): json { \\\"id\\\": \\\"nugen-abc456\\\", \\\"object\\\": \\\"chat.completion\\\", \\\"created\\\": 1704123700.0, \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"choices\\\": [ { \\\"index\\\": 0, \\\"message\\\": { \\\"role\\\": \\\"assistant\\\", \\\"content\\\": \\\"To return a product, please visit our returns portal within 30 days of purchase with your order number and receipt.\\\" }, \\\"finish_reason\\\": \\\"stop\\\" } ], \\\"usage\\\": { \\\"prompt_tokens\\\": 15, \\\"completion_tokens\\\": 25, \\\"total_tokens\\\": 40 }, \\\"confidence_score\\\": 95.8 } How to get your aligned model ID: 1. Create an alignment project using POST /api/v3/alignment-projects/create 2. Poll GET /api/v3/alignment-projects/{id}/status until status is READY 3. Use the model_id field from the response (e.g., \\\"model_01kmqm4nrn9fw6r\\\") 4. Deploy the model using POST /api/v3/models/{model_id}/deployment (optional - for evaluation/production use) 5. Use the model_id in the model parameter for inference requests Example Request (Vision - Image URL): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"Describe what you see in this image.\\\" }, { \\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": { \\\"url\\\": \\\"https://example.com/image.jpg\\\" } } ] } ], \\\"max_tokens\\\": 1000, \\\"stream\\\": false } Example Request (Vision - Base64 Image): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ { \\\"role\\\": \\\"user\\\", \\\"content\\\": [ { \\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"What's in this image?\\\" }, { \\\"type\\\": \\\"image_url\\\", \\\"image_url\\\": { \\\"url\\\": \\\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD...\\\" } } ] } ], \\\"stream\\\": false } Example Request (Function Calling): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [ {\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"What is the status of INC-4821?\\\"} ], \\\"tools\\\": [ { \\\"type\\\": \\\"function\\\", \\\"function\\\": { \\\"name\\\": \\\"get_incident\\\", \\\"description\\\": \\\"Get incident status\\\", \\\"parameters\\\": { \\\"type\\\": \\\"object\\\", \\\"properties\\\": { \\\"incident_id\\\": {\\\"type\\\": \\\"string\\\"} } } } } ], \\\"tool_choice\\\": \\\"auto\\\", \\\"stream\\\": false } Example Request (Streaming): json POST /api/v3/inference/chat/completions Headers: {\\\"Authorization\\\": \\\"Bearer \\\"} { \\\"model\\\": \\\"model_01kmqm4nrn9fw6r\\\", \\\"messages\\\": [{\\\"role\\\": \\\"user\\\", \\\"content\\\": \\\"Tell me a story\\\"}], \\\"stream\\\": true } Example Response (Streaming): data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"role\\\":\\\"assistant\\\",\\\"content\\\":\\\"Once\\\"},\\\"finish_reason\\\":null}]} data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" upon\\\"},\\\"finish_reason\\\":null}]} data: {\\\"id\\\":\\\"nugen-abc123\\\",\\\"created\\\":1704123600.0,\\\"model\\\":\\\"model_01kmqm4nrn9fw6r\\\",\\\"choices\\\":[{\\\"index\\\":0,\\\"delta\\\":{\\\"content\\\":\\\" a time\\\"},\\\"finish_reason\\\":\\\"stop\\\"}],\\\"usage\\\":{\\\"prompt_tokens\\\":10,\\\"completion_tokens\\\":5,\\\"total_tokens\\\":15}} data: [DONE] Provisioned throughput: Reserve inference capacity for production workloads. Pass your provisioned id in model as ptm_id:model_id in place of the plain model_id. The request and response surface is identical, so your application code stays as it is once capacity is reserved. Available for aligned models on the Enterprise Edition. Notes: - Supports both text-only and vision/multimodal inputs depending on the model - Using Domain-Aligned Models: Pass the model_id from your completed alignment project as the model parameter. Get your aligned model IDs from GET /api/v3/alignment-projects/{id}/status or GET /api/v3/models/aligned - Function calling enables models to invoke external tools via tools and tool_choice parameters - confidence_score (0-100) comes from inference-time alignment: uncertainty is quantified across the generation trajectory, flagging any drift from your domain. Available on aligned models only; always null for base models. In streaming mode, confidence arrives as its own {\\\"object\\\": \\\"confidence\\\", ...} events interleaved with content chunks, one per generated span, rather than a single value on the final chunk - For streaming, usage statistics are included only in the final chunk - Conversations are automatically saved to S3 if enabled in user settings - Include X-Session-ID header for multi-turn conversation tracking - Use prompt_truncate_len to control context window usage for long conversations - The reasoning parameter enables advanced reasoning capabilities for supported models\",\"url\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.nugen.in/api-reference/inference/generate-chat-completions#webpage\"},\"dateModified\":\"2026-11-16T14:08:30.333Z\",\"publisher\":{\"@id\":\"https://docs.nugen.in/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.nugen.in#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Nugen API Reference Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Nugen API Reference Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/inference/generate-chat-completions.md","siteName":"Nugen API Reference Docs","nav":{"global":{"anchors":[{"anchor":"API Status","icon":"bolt-lightning","href":"https://status.nugen.in"},{"anchor":"Nugen Intelligence","icon":"earth-asia","href":"https://nugen.in"}]},"tabs":[{"tab":"API Reference","groups":[{"group":"Alignment Projects","pages":[{"title":"Create Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/create","href":"/api-reference/alignment-projects/create-alignment"},{"title":"List Alignment Projects","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/list","href":"/api-reference/alignment-projects/list-alignment-projects"},{"title":"Get Alignment Project","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/{alignment_id}","href":"/api-reference/alignment-projects/get-alignment-project"},{"title":"Delete Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/alignment-projects/{alignment_id}","href":"/api-reference/alignment-projects/delete-alignment"},{"title":"Get Alignment Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/alignment-projects/{alignment_id}/status","href":"/api-reference/alignment-projects/get-alignment-status"},{"title":"Stop Alignment","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/{alignment_id}/stop","href":"/api-reference/alignment-projects/stop-alignment"},{"title":"Start Auto-Align","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/alignment-projects/{alignment_id}/auto-align","href":"/api-reference/alignment-projects/start-auto-align"}]},{"group":"Models","pages":[{"title":"List Base Models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/base","href":"/api-reference/models/list-base-models"},{"title":"List Aligned Models","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/aligned","href":"/api-reference/models/list-aligned-models"},{"title":"Get Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/{model_id}","href":"/api-reference/models/get-model"},{"title":"Deploy Aligned Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/{model_id}/deployment","href":"/api-reference/models/deploy-aligned-model"},{"title":"Undeploy Model","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/models/{model_id}/deployment","href":"/api-reference/models/undeploy-model"},{"title":"Get Deployment Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/models/{model_id}/deployment/status","href":"/api-reference/models/get-deployment-status"},{"title":"Export to Hugging Face","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/{model_id}/export-hf","href":"/api-reference/models/export-to-hugging-face"},{"title":"Import from Hugging Face","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/models/base/import","href":"/api-reference/models/import-from-hugging-face"}]},{"group":"Documents","pages":[{"title":"Upload Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/documents/create","href":"/api-reference/documents/upload-documents"},{"title":"List Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/list","href":"/api-reference/documents/list-documents"},{"title":"Get Document Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/{document_id}/status","href":"/api-reference/documents/get-document-status"},{"title":"Get Document","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/documents/{document_id}","href":"/api-reference/documents/get-document"},{"title":"Delete Document","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/documents/{document_id}","href":"/api-reference/documents/delete-document"}]},{"group":"Benchmarks","pages":[{"title":"Create Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/benchmarks/create","href":"/api-reference/benchmarks/create-benchmark"},{"title":"Upload Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/benchmarks/upload","href":"/api-reference/benchmarks/upload-benchmark"},{"title":"List Benchmarks","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/list","href":"/api-reference/benchmarks/list-benchmarks"},{"title":"Get Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}","href":"/api-reference/benchmarks/get-benchmark"},{"title":"Delete Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/benchmarks/{benchmark_id}","href":"/api-reference/benchmarks/delete-benchmark"},{"title":"Get Benchmark Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}/status","href":"/api-reference/benchmarks/get-benchmark-status"},{"title":"Get Generated Benchmark","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/benchmarks/{benchmark_id}/data","href":"/api-reference/benchmarks/get-generated-benchmark"}]},{"group":"Evaluations","pages":[{"title":"Create Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/evaluations/create","href":"/api-reference/evaluations/create-evaluation"},{"title":"List User Evaluations","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/list","href":"/api-reference/evaluations/list-user-evaluations"},{"title":"Get Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}","href":"/api-reference/evaluations/get-evaluation"},{"title":"Delete Evaluation","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json delete /api/v3/evaluations/{evaluation_id}","href":"/api-reference/evaluations/delete-evaluation"},{"title":"Get Evaluation Status","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}/status","href":"/api-reference/evaluations/get-evaluation-status"},{"title":"Get Evaluation Results","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/evaluations/{evaluation_id}/results","href":"/api-reference/evaluations/get-evaluation-results"}]},{"group":"Inference","pages":[{"title":"Generate Embeddings","description":"Generate dense vector embeddings for input text.\n\n\nThis endpoint creates numerical vector representations (embeddings) of text using specified embedding models. Embeddings are useful for semantic search, clustering, similarity comparisons, and RAG applications.\n\n\n**Request Body:**\n\n- `model`: Model ID (required). Use your aligned model id (e.g. `model_01kmqm4nrn9fw6r`)\n- `input`: Text or list of texts to embed (required) - Single string or array of strings. Cannot be empty and must not exceed max input tokens for the model\n- `dimensions` (optional): Number of dimensions for output embeddings (only applicable for Resizable Matryoshka Embedding models)\n\n\n**Returns:**\n\n- `id`: Unique identifier for the response\n- `object`: Object type (always `embedding`)\n- `data`: List of embedding objects, each containing:\n - `object`: Object type (always `embedding`)\n - `embedding`: Vector of floats representing the text (length depends on the model)\n - `index`: Position in the input array\n- `model`: Model ID used for generation\n- `created`: Unix timestamp (seconds) when response was generated\n- `usage`: Token usage statistics containing:\n - `total_tokens`: Total number of tokens used by the request\n\n\n**Example Request (Single Text):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"text-embedding-xyz\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}\n```\n\n\n**Example Request (Multiple Texts):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": [\n \"First document for semantic search\",\n \"Second document for clustering\",\n \"Third document for similarity comparison\"\n ]\n}\n```\n\n\n**Example Request (With Dimensions):**\n\n```json\nPOST /api/v3/inference/embeddings\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"model_01kmqm4nrn9fw6r\",\n \"input\": \"Sample text to embed\",\n \"dimensions\": 512\n}\n```\n\n\n**Example Response:**\n\n```json\n{\n \"id\": \"embed-abc123xyz\",\n \"object\": \"embedding\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"embedding\": [0.00658765, -0.008665467, -0.007653789, 0.0023, -0.0091, 0.0125],\n \"index\": 0\n }\n ],\n \"model\": \"text-embedding-ada-002\",\n \"created\": 1705329600.0,\n \"usage\": {\n \"total_tokens\": 10\n }\n}\n```\n\n\n**Notes:**\n\n- Input must not exceed the maximum input tokens supported by the model\n- Input cannot be an empty string\n- For batch processing, pass multiple texts as an array to the `input` field\n- The embedding vector length varies by model - check model documentation for specifics\n- Use `dimensions` parameter only with Matryoshka embedding models that support resizing","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/embeddings","href":"/api-reference/inference/generate-embeddings"},{"title":"Generate Chat Completions","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/chat/completions","href":"/api-reference/inference/generate-chat-completions"},{"title":"Generate Responses","description":"OpenAI `responses.create` compatible endpoint.\n\nAccepts the same shape as `openai.responses.create` and returns a `Response` object.\n\n\n**Request Body:**\n\n- `model`: Model ID (required)\n- `input`: User input — a plain string or array of `{\"role\": \"system\"|\"user\"|\"assistant\", \"content\": ...}` objects\n- `instructions` (optional): System-level instructions (maps to a system message prepended to `input`)\n- `max_output_tokens` (optional): Maximum tokens to generate\n- `temperature` (optional): Sampling temperature 0–2 (default: 1.0)\n- `top_p` (optional): Nucleus sampling parameter\n- `stream` (optional): Stream partial output as SSE (default: true). Passing `null` is treated as `true`. Set `stream: false` for a single JSON response — the call must complete within the timeout or returns 504. For long generations, keep streaming on.\n\n**Example Request:**\n\n```json\nPOST /api/v3/inference/responses\nHeaders: {\"Authorization\": \"Bearer \u003capi_key>\"}\n\n{\n \"model\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n \"input\": \"What is the capital of France?\",\n \"instructions\": \"You are a helpful assistant.\",\n \"max_output_tokens\": 200,\n \"stream\": false\n}\n```\n\n**Example Response:**\n\n```json\n{\n \"id\": \"resp_abc123\",\n \"object\": \"response\",\n \"created_at\": 1704123600,\n \"model\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n \"output\": [\n {\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": [{\"type\": \"output_text\", \"text\": \"The capital of France is Paris.\"}]\n }\n ],\n \"usage\": {\"input_tokens\": 18, \"output_tokens\": 9, \"total_tokens\": 27}\n}\n```\n\n**Example Streaming Request (`stream: true`):**\n\n```json\n{\n \"model\": \"Qwen/Qwen2.5-0.5B-Instruct\",\n \"input\": \"Write a short poem about the sea.\",\n \"stream\": true\n}\n```\n\nStreaming response (SSE):\n```\ndata: {\"type\": \"response.output_text.delta\", \"delta\": \"The sea is\"}\ndata: {\"type\": \"response.output_text.delta\", \"delta\": \" vast and deep,\"}\ndata: {\"type\": \"response.completed\", \"usage\": {\"input_tokens\": 12, \"output_tokens\": 8, \"total_tokens\": 20}}\n```","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/responses","href":"/api-reference/inference/generate-responses"},{"title":"Rerank Documents","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/reranker","href":"/api-reference/inference/rerank-documents"},{"title":"Inference Settings","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/inference/capture","href":"/api-reference/inference/inference-settings"},{"title":"Update Inference Capture Settings","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json patch /api/v3/inference/capture","href":"/api-reference/inference/update-inference-capture-settings"},{"title":"Anthropic-compatible Messages","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/inference/messages/v2","href":"/api-reference/inference/anthropic-compatible-messages"}]},{"group":"BYOC","pages":[{"title":"Deploy in your own cloud or cluster","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json post /api/v3/byoc/clusters","href":"/api-reference/byoc/deploy-in-your-own-cloud-or-cluster"},{"title":"Get Cluster Health","deprecated":null,"version":null,"openapi":"https://api.nugen.in/openapi-public.json get /api/v3/byoc/clusters/{cluster_id}/status","href":"/api-reference/byoc/get-cluster-health"}]}]}]},"basePath":"","title":"Generate Chat Completions - Nugen API Reference Docs","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"]}