import { AtomaSDK } from "atoma-sdk";
const atomaSDK = new AtomaSDK({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const completion = await atomaSDK.chat.create({
messages: [
{"role": "developer", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
model: "meta-llama/Llama-3.3-70B-Instruct"
});
console.log(completion.choices[0]);
}
run();
{
"choices": "[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]",
"created": 1677652288,
"id": "chatcmpl-123",
"model": "meta-llama/Llama-3.3-70B-Instruct",
"object": "chat.completion",
"service_tier": "auto",
"system_fingerprint": "fp_44709d6fcb",
"usage": {
"completion_tokens": 12,
"prompt_tokens": 9,
"total_tokens": 21,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 10
}
}
}
Chat
Create chat completions
This function processes chat completion requests by determining whether to use streaming
or non-streaming response handling based on the request payload. For streaming requests,
it configures additional options to track token usage.
Returns
Returns a Response containing either:
A streaming SSE connection for real-time completions
A single JSON response for non-streaming completions
Errors
Returns an error status code if:
The request processing fails
The streaming/non-streaming handlers encounter errors
The underlying inference service returns an error
POST
/
v1
/
chat
/
completions
import { AtomaSDK } from "atoma-sdk";
const atomaSDK = new AtomaSDK({
bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});
async function run() {
const completion = await atomaSDK.chat.create({
messages: [
{"role": "developer", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
model: "meta-llama/Llama-3.3-70B-Instruct"
});
console.log(completion.choices[0]);
}
run();
{
"choices": "[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]",
"created": 1677652288,
"id": "chatcmpl-123",
"model": "meta-llama/Llama-3.3-70B-Instruct",
"object": "chat.completion",
"service_tier": "auto",
"system_fingerprint": "fp_44709d6fcb",
"usage": {
"completion_tokens": 12,
"prompt_tokens": 9,
"total_tokens": 21,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 10
}
}
}
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Represents the create chat completion request.
This is used to represent the create chat completion request in the chat completion request.
It can be either a chat completion or a chat completion stream.
A list of messages comprising the conversation so far
A message that is part of a conversation which is based on the role
of the author of the message.
This is used to represent the message in the chat completion request.
It can be either a system message, a user message, an assistant message, or a tool message.
System
User
Assistant
Tool
Show child attributes
Example:
[
{
"role": "system",
"content": "You are a helpful AI assistant"
},
{ "role": "user", "content": "Hello!" },
{
"role": "assistant",
"content": "I'm here to help you with any questions you have. How can I assist you today?"
}
]
A list of functions the model may generate JSON inputs for
Example:
[
{
"name": "get_current_weather",
"description": "Get the current weather in a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The location to get the weather for"
}
},
"required": ["location"]
}
}
]
Modify the likelihood of specified tokens appearing in the completion.
Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer)
to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits
generated by the model prior to sampling. The exact effect will vary per model, but values
between -1 and 1 should decrease or increase likelihood of selection; values like -100 or
100 should result in a ban or exclusive selection of the relevant token.
Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:
If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.
If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.
If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.
When not set, the default behavior is 'auto'.
An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
logprobs must be set to true if this parameter is used.
"[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]"
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Atoma","colors":{"primary":"#87CEFA","light":"#87CEFA","dark":"#87CEFA"},"favicon":"/logo/Favicon_Atoma.svg","logo":{"light":"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1","dark":"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1"},"navbar":{"links":[{"label":"Support","href":"mailto:support@atoma.ai"}],"primary":null},"footer":{"socials":{"x":"https://x.com/Atoma_AI","github":"https://github.com/atoma-ai","linkedin":"https://www.linkedin.com/company/atoma-ai-2025"}},"navigation":{"global":{"anchors":[{"anchor":"Website","href":"https://www.atoma.ai","icon":"globe"},{"anchor":"Community","href":"https://discord.gg/atoma","icon":"discord"},{"anchor":"Blog","href":"https://atomanetwork.medium.com","icon":"newspaper"},{"anchor":"Github","href":"https://github.com/atoma-ai","icon":"github"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"atoma","hasAudioNarration":false,"actualSubdomain":"atoma","customDomains":["docs.atoma.ai"],"gitSource":{"type":"github","owner":"atomaai","repo":"atoma-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae9237ce0bf2909fa98acd1:success","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Cloud API Reference","count":14},{"language":"default","tag":"Documentation","count":4},{"language":"default","tag":"Get Started","count":4},{"language":"default","tag":"Changelog","count":2},{"language":"default","tag":"Models","count":2},{"language":"default","tag":"Nodes","count":2},{"language":"default","tag":"API Reference","count":1},{"language":"default","tag":"Chat","count":1},{"language":"default","tag":"Completions","count":1},{"language":"default","tag":"Confidential Chat","count":1}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"cloud-api-reference/chat/create-chat-completions","slug":"/cloud-api-reference/chat/create-chat-completions","pageMetadata":{"title":"Create chat completions","description":"This function processes chat completion requests by determining whether to use streaming\nor non-streaming response handling based on the request payload. For streaming requests,\nit configures additional options to track token usage.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/chat/completions","href":"/cloud-api-reference/chat/create-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 h2: \"h2\",\n li: \"li\",\n p: \"p\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"This function processes chat completion requests by determining whether to use streaming\\nor non-streaming response handling based on the request payload. For streaming requests,\\nit configures additional options to track token usage.\"\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Returns\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns a Response containing either:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"A streaming SSE connection for real-time completions\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"A single JSON response for non-streaming completions\"\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.h2, {\n children: \"Errors\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"Returns an error status code if:\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"The request processing fails\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"The streaming/non-streaming handlers encounter errors\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"The underlying inference service returns an error\"\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};\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":"Create chat completions","description":"This function processes chat completion requests by determining whether to use streaming\nor non-streaming response handling based on the request payload. For streaming requests,\nit configures additional options to track token usage.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/chat/completions","href":"/cloud-api-reference/chat/create-chat-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat"],"summary":"Create chat completions","description":"This function processes chat completion requests by determining whether to use streaming\nor non-streaming response handling based on the request payload. For streaming requests,\nit configures additional options to track token usage.\n\n## Returns\n\nReturns a Response containing either:\n- A streaming SSE connection for real-time completions\n- A single JSON response for non-streaming completions\n\n## Errors\n\nReturns an error status code if:\n- The request processing fails\n- The streaming/non-streaming handlers encounter errors\n- The underlying inference service returns an error","operationId":"chat_completions_create","requestBody":"5a95538f-582f-4500-bb6f-380928e43bcc","responses":{"200":"89d2e768-80ab-47b2-b0b0-0a347570078f","400":"006bea0e-f5e0-46b6-864e-4de1452a05fb","401":"3d5c1a70-39ed-44a1-8092-9c4494b20f9d","500":"e6a3806e-12f7-4a80-83ab-c592c017f94a"},"security":["decc946f-3ac5-4cd9-91fd-4c08caee0fa7"],"x-codeSamples":[{"lang":"typescript","label":"default","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.create({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n console.log(completion.choices[0]);\n}\n\nrun();"},{"lang":"typescript","label":"streaming","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.createStream({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nrun();"},{"lang":"typescript","label":"streaming","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.createStream({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nrun();"},{"lang":"python","label":"default","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n print(completion.choices[0].message)"},{"lang":"python","label":"default","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n print(completion.choices[0].message)"},{"lang":"python","label":"streaming","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].delta)"},{"lang":"python","label":"streaming","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].delta)"}],"method":"post","type":"path","servers":["dfb8e2f7-db43-4d17-8dd7-eba4e1b68421"],"path":"/v1/chat/completions","baseUrlOptions":["https://api.atoma.network"],"title":"Create chat completions","codeSamples":[{"label":"default","lang":"typescript","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.create({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n console.log(completion.choices[0]);\n}\n\nrun();"},{"label":"streaming","lang":"typescript","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.createStream({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nrun();"},{"label":"streaming","lang":"typescript","source":"import { AtomaSDK } from \"atoma-sdk\";\n\nconst atomaSDK = new AtomaSDK({\n bearerAuth: process.env[\"ATOMASDK_BEARER_AUTH\"] ?? \"\",\n});\n\nasync function run() {\n const completion = await atomaSDK.chat.createStream({\n messages: [\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ],\n model: \"meta-llama/Llama-3.3-70B-Instruct\"\n });\n\n for await (const chunk of completion) {\n console.log(chunk.choices[0].delta.content);\n }\n}\n\nrun();"},{"label":"default","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n print(completion.choices[0].message)"},{"label":"default","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n print(completion.choices[0].message)"},{"label":"streaming","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].delta)"},{"label":"streaming","lang":"python","source":"from atoma_sdk import AtomaSDK\nimport os\n\nwith AtomaSDK(\n bearer_auth=os.getenv(\"ATOMASDK_BEARER_AUTH\", \"\"),\n) as atoma_sdk:\n\n completion = atoma_sdk.chat.create_stream(\n model=\"meta-llama/Llama-3.3-70B-Instruct\",\n messages=[\n {\"role\": \"developer\", \"content\": \"You are a helpful assistant.\"},\n {\"role\": \"user\", \"content\": \"Hello!\"}\n ]\n )\n\n for chunk in completion:\n print(chunk.data.choices[0].delta)"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"Represents the create chat completion request.\n\nThis is used to represent the create chat completion request in the chat completion request.\nIt can be either a chat completion or a chat completion stream.","required":["model","messages"],"properties":{"messages":{"type":"array","items":{"oneOf":[{"type":"object","title":"System","description":"A message that is part of a conversation which is based on the role\nof the author of the message.\n\nThis is used to represent the message in the chat completion request.\nIt can be either a system message, a user message, an assistant message, or a tool message.","required":["role"],"properties":{"role":{"type":"string","enum":["system"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI expert","uniqueKey":"messages.items.[INDEX].oneOf.0.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI expert","uniqueKey":"messages.items.[INDEX].oneOf.0.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.0.name","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.0","typeLabel":"System · object"},{"type":"object","title":"User","description":"A message that is part of a conversation which is based on the role\nof the author of the message.\n\nThis is used to represent the message in the chat completion request.\nIt can be either a system message, a user message, an assistant message, or a tool message.","required":["role"],"properties":{"role":{"type":"string","enum":["user"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"John Doe","uniqueKey":"messages.items.[INDEX].oneOf.1.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"John Doe","uniqueKey":"messages.items.[INDEX].oneOf.1.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.1.name","typeLabel":"string | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.1","typeLabel":"User · object"},{"type":"object","title":"Assistant","description":"A message that is part of a conversation which is based on the role\nof the author of the message.\n\nThis is used to represent the message in the chat completion request.\nIt can be either a system message, a user message, an assistant message, or a tool message.","required":["role"],"properties":{"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI","uniqueKey":"messages.items.[INDEX].oneOf.2.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI","uniqueKey":"messages.items.[INDEX].oneOf.2.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.name","typeLabel":"string | null"},"refusal":{"oneOf":[{"type":"string","description":"The refusal message by the assistant.","uniqueKey":"messages.items.[INDEX].oneOf.2.refusal.oneOf.0","typeLabel":"string"},{"type":"null","description":"The refusal message by the assistant.","uniqueKey":"messages.items.[INDEX].oneOf.2.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.refusal","typeLabel":"string | null"},"tool_calls":{"type":"array","items":{"type":"object","description":"Represents the tool call that the model made.\n\nThis is used to represent the tool call that the model made in the chat completion request.\nIt can be either a function or a tool.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"The function that the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format.\nNote that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema.\nValidate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX].function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX].function","typeLabel":"object"},"id":{"type":"string","description":"The ID of the tool call.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"The type of the tool. Currently, only function is supported.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX].type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls.items.[INDEX]","typeLabel":"object"},"description":"The tool calls generated by the model, such as function calls.","uniqueKey":"messages.items.[INDEX].oneOf.2.tool_calls","typeLabel":"object[]"}},"uniqueKey":"messages.items.[INDEX].oneOf.2","typeLabel":"Assistant · object"},{"type":"object","title":"Tool","description":"A message that is part of a conversation which is based on the role\nof the author of the message.\n\nThis is used to represent the message in the chat completion request.\nIt can be either a system message, a user message, an assistant message, or a tool message.","required":["role"],"properties":{"role":{"type":"string","enum":["tool"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.content","typeLabel":"null | string | object[]"},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to.","uniqueKey":"messages.items.[INDEX].oneOf.3.tool_call_id","typeLabel":"string"}},"uniqueKey":"messages.items.[INDEX].oneOf.3","typeLabel":"Tool · object"}],"uniqueKey":"messages.items.[INDEX]","typeLabel":"System · object | User · object | Assistant · object | Tool · object"},"description":"A list of messages comprising the conversation so far","example":[{"role":"system","content":"You are a helpful AI assistant"},{"role":"user","content":"Hello!"},{"role":"assistant","content":"I'm here to help you with any questions you have. How can I assist you today?"}],"isRequired":true,"uniqueKey":"messages","typeLabel":"(System · object | User · object | Assistant · object | Tool · object)[]"},"model":{"type":"string","description":"ID of the model to use","example":"meta-llama/Llama-3.3-70B-Instruct","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"frequency_penalty":{"oneOf":[{"type":"number","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their\nexisting frequency in the text so far","example":0,"uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on their\nexisting frequency in the text so far","example":0,"uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number\u003cfloat> | null"},"function_call":{"description":"Controls how the model responds to function calls","uniqueKey":"function_call","typeLabel":"any"},"functions":{"oneOf":[{"type":"array","items":{"oneOf":[{}],"uniqueKey":"functions.oneOf.0.items.[INDEX]","typeLabel":"any"},"description":"A list of functions the model may generate JSON inputs for","example":[{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}],"uniqueKey":"functions.oneOf.0","typeLabel":"any[]"},{"type":"null","items":{"oneOf":[{}]},"description":"A list of functions the model may generate JSON inputs for","example":[{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}],"uniqueKey":"functions.oneOf.1","typeLabel":"null"}],"uniqueKey":"functions","typeLabel":"any[] | null"},"logit_bias":{"oneOf":[{"type":"object","description":"Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the tokenizer)\nto an associated bias value from -100 to 100. Mathematically, the bias is added to the logits\ngenerated by the model prior to sampling. The exact effect will vary per model, but values\nbetween -1 and 1 should decrease or increase likelihood of selection; values like -100 or\n100 should result in a ban or exclusive selection of the relevant token.","additionalProperties":{"type":"number","format":"float","uniqueKey":"logit_bias.oneOf.0.additionalProperties","typeLabel":"number\u003cfloat>"},"propertyNames":{"type":"integer","format":"int32","minimum":0},"example":{"1234567890":0.5,"1234567891":-0.5},"uniqueKey":"logit_bias.oneOf.0","typeLabel":"object"},{"type":"null","description":"Modify the likelihood of specified tokens appearing in the completion.\n\nAccepts a JSON object that maps tokens (specified by their token ID in the tokenizer)\nto an associated bias value from -100 to 100. Mathematically, the bias is added to the logits\ngenerated by the model prior to sampling. The exact effect will vary per model, but values\nbetween -1 and 1 should decrease or increase likelihood of selection; values like -100 or\n100 should result in a ban or exclusive selection of the relevant token.","additionalProperties":{"type":"number","format":"float","uniqueKey":"logit_bias.oneOf.1.additionalProperties","typeLabel":"number\u003cfloat>"},"propertyNames":{"type":"integer","format":"int32","minimum":0},"example":{"1234567890":0.5,"1234567891":-0.5},"uniqueKey":"logit_bias.oneOf.1","typeLabel":"null"}],"uniqueKey":"logit_bias","typeLabel":"object | null"},"max_completion_tokens":{"oneOf":[{"type":"integer","format":"int32","description":"The maximum number of tokens to generate in the chat completion","example":4096,"uniqueKey":"max_completion_tokens.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"The maximum number of tokens to generate in the chat completion","example":4096,"uniqueKey":"max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_completion_tokens","typeLabel":"integer\u003cint32> | null"},"max_tokens":{"oneOf":[{"type":"integer","format":"int32","description":"The maximum number of tokens to generate in the chat completion","deprecated":true,"example":4096,"uniqueKey":"max_tokens.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"The maximum number of tokens to generate in the chat completion","deprecated":true,"example":4096,"uniqueKey":"max_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_tokens","typeLabel":"integer\u003cint32> | null"},"n":{"oneOf":[{"type":"integer","format":"int32","description":"How many chat completion choices to generate for each input message","example":1,"uniqueKey":"n.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"How many chat completion choices to generate for each input message","example":1,"uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer\u003cint32> | null"},"parallel_tool_calls":{"oneOf":[{"type":"boolean","description":"Whether to enable parallel tool calls.","example":true,"uniqueKey":"parallel_tool_calls.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to enable parallel tool calls.","example":true,"uniqueKey":"parallel_tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"parallel_tool_calls","typeLabel":"boolean | null"},"presence_penalty":{"oneOf":[{"type":"number","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far","example":0,"uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Number between -2.0 and 2.0. Positive values penalize new tokens based on\nwhether they appear in the text so far","example":0,"uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number\u003cfloat> | null"},"response_format":{"oneOf":[{"type":"null","uniqueKey":"response_format.oneOf.0","typeLabel":"null"},{"type":"object","description":"The format to return the response in","required":["type"],"properties":{"type":{"type":"string","description":"The type of the response format.","enum":["text","json_object","json_schema"],"isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"},"json_schema":{"oneOf":[{"type":"null","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.0","typeLabel":"null"},{"type":"object","description":"The JSON schema of the response format.","required":["name"],"properties":{"name":{"type":"string","description":"The name of the response format.","isRequired":true,"uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.name","typeLabel":"string"},"description":{"oneOf":[{"type":"string","description":"The description of the response format.","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"The description of the response format.","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.description","typeLabel":"string | null"},"schema":{"description":"The JSON schema of the response format.","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.schema","typeLabel":"any"},"strict":{"oneOf":[{"type":"boolean","description":"Whether to strictly validate the JSON schema.","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to strictly validate the JSON schema.","uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1.strict","typeLabel":"boolean | null"}},"uniqueKey":"response_format.oneOf.1.json_schema.oneOf.1","typeLabel":"object"}],"uniqueKey":"response_format.oneOf.1.json_schema","typeLabel":"null | object"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"object"}],"uniqueKey":"response_format","typeLabel":"null | object"},"seed":{"oneOf":[{"type":"integer","format":"int64","description":"If specified, our system will make a best effort to sample deterministically","example":123,"uniqueKey":"seed.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"If specified, our system will make a best effort to sample deterministically","example":123,"uniqueKey":"seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer\u003cint64> | null"},"service_tier":{"oneOf":[{"type":"string","description":"Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:\n\nIf set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.\nIf set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.\nIf set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.\nWhen not set, the default behavior is 'auto'.","example":"auto","uniqueKey":"service_tier.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:\n\nIf set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.\nIf set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.\nIf set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarantee.\nWhen not set, the default behavior is 'auto'.","example":"auto","uniqueKey":"service_tier.oneOf.1","typeLabel":"null"}],"uniqueKey":"service_tier","typeLabel":"string | null"},"stop":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"stop.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens","example":"json([\"stop\", \"halt\"])","default":"[]","uniqueKey":"stop.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Up to 4 sequences where the API will stop generating further tokens","example":"json([\"stop\", \"halt\"])","default":"[]","uniqueKey":"stop.oneOf.1","typeLabel":"null"}],"uniqueKey":"stop","typeLabel":"string[] | null"},"stream":{"oneOf":[{"type":"boolean","description":"Whether to stream back partial progress. Must be false for this request type.","default":false,"example":false,"uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to stream back partial progress. Must be false for this request type.","default":false,"example":false,"uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"stream_options":{"oneOf":[{"type":"null","uniqueKey":"stream_options.oneOf.0","typeLabel":"null"},{"type":"object","description":"Options for streaming response. Only set this when you set stream: true.","properties":{"include_usage":{"oneOf":[{"type":"boolean","description":"If set, an additional chunk will be streamed before the data: [DONE] message.\nThe usage field on this chunk shows the token usage statistics for the entire request, and the choices field\nwill always be an empty array. All other chunks will also include a usage field, but with a null value.","uniqueKey":"stream_options.oneOf.1.include_usage.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"If set, an additional chunk will be streamed before the data: [DONE] message.\nThe usage field on this chunk shows the token usage statistics for the entire request, and the choices field\nwill always be an empty array. All other chunks will also include a usage field, but with a null value.","uniqueKey":"stream_options.oneOf.1.include_usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream_options.oneOf.1.include_usage","typeLabel":"boolean | null"}},"uniqueKey":"stream_options.oneOf.1","typeLabel":"object"}],"uniqueKey":"stream_options","typeLabel":"null | object"},"temperature":{"oneOf":[{"type":"number","format":"float","description":"What sampling temperature to use, between 0 and 2","example":0.7,"uniqueKey":"temperature.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"What sampling temperature to use, between 0 and 2","example":0.7,"uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number\u003cfloat> | null"},"tool_choice":{"oneOf":[{"type":"null","uniqueKey":"tool_choice.oneOf.0","typeLabel":"null"},{"type":"string","description":"Controls which (if any) tool the model should use","enum":["none","auto"],"uniqueKey":"tool_choice.oneOf.1","typeLabel":"enum\u003cstring>"},{"type":"object","description":"Controls which (if any) tool the model should use","required":["type","function"],"properties":{"function":{"type":"object","description":"The function of the tool choice.","required":["name"],"properties":{"name":{"type":"string","description":"The name of the function.","isRequired":true,"uniqueKey":"tool_choice.oneOf.2.function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"tool_choice.oneOf.2.function","typeLabel":"object"},"type":{"type":"string","description":"The type of the tool choice.","isRequired":true,"uniqueKey":"tool_choice.oneOf.2.type","typeLabel":"string"}},"uniqueKey":"tool_choice.oneOf.2","typeLabel":"object"}],"uniqueKey":"tool_choice","typeLabel":"null | enum\u003cstring> | object"},"tools":{"oneOf":[{"type":"array","items":{"type":"object","description":"A tool that can be used in a chat completion.","required":["type","function"],"properties":{"function":{"type":"object","description":"The function that the tool will call.","required":["name"],"properties":{"name":{"type":"string","description":"The name of the function.","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"description":{"oneOf":[{"type":"string","description":"The description of the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"The description of the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.description","typeLabel":"string | null"},"parameters":{"oneOf":[{"type":"object","description":"The parameters of the function.","additionalProperties":{"oneOf":[{}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters.oneOf.0.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters.oneOf.0","typeLabel":"object"},{"type":"null","description":"The parameters of the function.","additionalProperties":{"oneOf":[{}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters.oneOf.1.additionalProperties","typeLabel":"any"},"propertyNames":{"type":"string"},"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters","typeLabel":"object | null"},"strict":{"oneOf":[{"type":"boolean","description":"Whether to strictly validate the parameters of the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether to strictly validate the parameters of the function.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.strict","typeLabel":"boolean | null"}},"isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function","typeLabel":"object"},"type":{"type":"string","description":"The type of the tool.","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].type","typeLabel":"string"}},"uniqueKey":"tools.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"A list of tools the model may call","example":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}}],"uniqueKey":"tools.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"A tool that can be used in a chat completion.","required":["type","function"],"properties":{"function":{"type":"object","description":"The function that the tool will call.","required":["name"],"properties":{"description":{"oneOf":[{"type":"string","description":"The description of the function."},{"type":"null","description":"The description of the function."}]},"name":{"type":"string","description":"The name of the function."},"parameters":{"oneOf":[{"type":"object","description":"The parameters of the function.","additionalProperties":{"oneOf":[{}]},"propertyNames":{"type":"string"}},{"type":"null","description":"The parameters of the function.","additionalProperties":{"oneOf":[{}]},"propertyNames":{"type":"string"}}]},"strict":{"oneOf":[{"type":"boolean","description":"Whether to strictly validate the parameters of the function."},{"type":"null","description":"Whether to strictly validate the parameters of the function."}]}}},"type":{"type":"string","description":"The type of the tool."}}},"description":"A list of tools the model may call","example":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}}],"uniqueKey":"tools.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools","typeLabel":"object[] | null"},"top_logprobs":{"oneOf":[{"type":"integer","format":"int32","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.\nlogprobs must be set to true if this parameter is used.","example":1,"uniqueKey":"top_logprobs.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.\nlogprobs must be set to true if this parameter is used.","example":1,"uniqueKey":"top_logprobs.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_logprobs","typeLabel":"integer\u003cint32> | null"},"top_p":{"oneOf":[{"type":"number","format":"float","description":"An alternative to sampling with temperature","example":1,"uniqueKey":"top_p.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"An alternative to sampling with temperature","example":1,"uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number\u003cfloat> | null"},"user":{"oneOf":[{"type":"string","description":"A unique identifier representing your end-user","example":"user-1234","uniqueKey":"user.oneOf.0","typeLabel":"string"},{"type":"null","description":"A unique identifier representing your end-user","example":"user-1234","uniqueKey":"user.oneOf.1","typeLabel":"null"}],"uniqueKey":"user","typeLabel":"string | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"messages":[{"role":"system","content":"You are a helpful AI assistant"},{"role":"user","content":"Hello!"},{"role":"assistant","content":"I'm here to help you with any questions you have. How can I assist you today?"}],"model":"meta-llama/Llama-3.3-70B-Instruct","frequency_penalty":0,"function_call":"\u003cunknown>","functions":[{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}],"logit_bias":{"1234567890":0.5,"1234567891":-0.5},"max_completion_tokens":4096,"max_tokens":4096,"n":1,"parallel_tool_calls":true,"presence_penalty":0,"response_format":{"json_schema":{"name":"\u003cstring>","description":"\u003cstring>","schema":"\u003cunknown>","strict":true}},"seed":123,"service_tier":"auto","stop":"json([\"stop\", \"halt\"])","stream":false,"stream_options":{"include_usage":true},"temperature":0.7,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The location to get the weather for"}},"required":["location"]}}}],"top_logprobs":1,"top_p":1,"user":"user-1234"}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"89d2e768-80ab-47b2-b0b0-0a347570078f":{"description":"Chat completions","content":{"application/json":{"schema":{"type":"object","description":"Represents the chat completion response.\n\nThis is used to represent the chat completion response in the chat completion request.\nIt can be either a chat completion or a chat completion stream.","required":["id","created","model","choices","object"],"properties":{"choices":{"type":"array","items":{"type":"object","description":"Represents the chat completion choice.\n\nThis is used to represent the chat completion choice in the chat completion request.\nIt can be either a chat completion message or a chat completion chunk.","required":["index","message"],"properties":{"index":{"type":"integer","format":"int32","description":"The index of this choice in the list of choices.","example":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer\u003cint32>"},"message":{"oneOf":[{"type":"object","title":"System","description":"The chat completion message.","required":["role"],"properties":{"role":{"type":"string","enum":["system"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.0.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.0.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI expert","uniqueKey":"choices.items.[INDEX].message.oneOf.0.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI expert","uniqueKey":"choices.items.[INDEX].message.oneOf.0.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.0.name","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.0","typeLabel":"System · object"},{"type":"object","title":"User","description":"The chat completion message.","required":["role"],"properties":{"role":{"type":"string","enum":["user"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.1.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.1.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"John Doe","uniqueKey":"choices.items.[INDEX].message.oneOf.1.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"John Doe","uniqueKey":"choices.items.[INDEX].message.oneOf.1.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.1.name","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.1","typeLabel":"User · object"},{"type":"object","title":"Assistant","description":"The chat completion message.","required":["role"],"properties":{"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.2.content","typeLabel":"null | string | object[]"},"name":{"oneOf":[{"type":"string","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI","uniqueKey":"choices.items.[INDEX].message.oneOf.2.name.oneOf.0","typeLabel":"string"},{"type":"null","description":"An optional name for the participant. Provides the model information to differentiate between participants of the same role.","example":"AI","uniqueKey":"choices.items.[INDEX].message.oneOf.2.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.2.name","typeLabel":"string | null"},"refusal":{"oneOf":[{"type":"string","description":"The refusal message by the assistant.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.refusal.oneOf.0","typeLabel":"string"},{"type":"null","description":"The refusal message by the assistant.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.2.refusal","typeLabel":"string | null"},"tool_calls":{"type":"array","items":{"type":"object","description":"Represents the tool call that the model made.\n\nThis is used to represent the tool call that the model made in the chat completion request.\nIt can be either a function or a tool.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"The function that the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format.\nNote that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema.\nValidate the arguments in your code before calling your function.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"type":"string","description":"The name of the function to call.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX].function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX].function","typeLabel":"object"},"id":{"type":"string","description":"The ID of the tool call.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"The type of the tool. Currently, only function is supported.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX].type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls.items.[INDEX]","typeLabel":"object"},"description":"The tool calls generated by the model, such as function calls.","uniqueKey":"choices.items.[INDEX].message.oneOf.2.tool_calls","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.2","typeLabel":"Assistant · object"},{"type":"object","title":"Tool","description":"The chat completion message.","required":["role"],"properties":{"role":{"type":"string","enum":["tool"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.0","typeLabel":"null"},{"type":"string","description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","text"],"properties":{"text":{"type":"string","description":"The text content.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Represents a part of a message content.\n\nThis is used to represent the content of a message in the chat completion request.\nIt can be either a text or an image.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"The image URL.","required":["url"],"properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"oneOf":[{"type":"string","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.0","typeLabel":"string"},{"type":"null","description":"Specifies the detail level of the image.","uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","description":"The type of the content part.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"string"}},"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2.items.[INDEX]","typeLabel":"object"},"description":"The contents of the message.","uniqueKey":"choices.items.[INDEX].message.oneOf.3.content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"choices.items.[INDEX].message.oneOf.3.content","typeLabel":"null | string | object[]"},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to.","uniqueKey":"choices.items.[INDEX].message.oneOf.3.tool_call_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.oneOf.3","typeLabel":"Tool · object"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"System · object | User · object | Assistant · object | Tool · object"},"finish_reason":{"oneOf":[{"type":"string","description":"The reason the chat completion was finished.","example":"stop","uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"string"},{"type":"null","description":"The reason the chat completion was finished.","example":"stop","uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"string | null"},"logprobs":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.0","typeLabel":"null"},{"type":"object","description":"Log probability information for the choice, if applicable.","properties":{"content":{"oneOf":[{"type":"array","items":{"type":"object","description":"Represents the chat completion log probs content.\n\nThis is used to represent the chat completion log probs content in the chat completion request.\nIt can be either a chat completion log probs content or a chat completion log probs content choice.","required":["top_logprobs"],"properties":{"top_logprobs":{"type":"array","items":{"type":"object","description":"Represents the chat completion log prob.\n\nThis is used to represent the chat completion log prob in the chat completion request.\nIt can be either a chat completion log prob or a chat completion log prob choice.","required":["logprob","token"],"properties":{"logprob":{"type":"number","format":"float","description":"The log prob of the chat completion.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].logprob","typeLabel":"number\u003cfloat>"},"token":{"type":"string","description":"The token of the chat completion.","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].token","typeLabel":"string"},"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","format":"int32","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0.items.[INDEX]","typeLabel":"integer\u003cint32>"},"description":"A list of integers representing the UTF-8 bytes representation of the token.\nUseful in instances where characters are represented by multiple tokens and their byte\nrepresentations must be combined to generate the correct text representation.\nCan be null if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.0","typeLabel":"integer\u003cint32>[]"},{"type":"null","items":{"type":"integer","format":"int32"},"description":"A list of integers representing the UTF-8 bytes representation of the token.\nUseful in instances where characters are represented by multiple tokens and their byte\nrepresentations must be combined to generate the correct text representation.\nCan be null if there is no bytes representation for the token.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX].bytes","typeLabel":"integer\u003cint32>[] | null"}},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX].top_logprobs","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The log probs of the chat completion.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"Represents the chat completion log probs content.\n\nThis is used to represent the chat completion log probs content in the chat completion request.\nIt can be either a chat completion log probs content or a chat completion log probs content choice.","required":["top_logprobs"],"properties":{"top_logprobs":{"type":"array","items":{"type":"object","description":"Represents the chat completion log prob.\n\nThis is used to represent the chat completion log prob in the chat completion request.\nIt can be either a chat completion log prob or a chat completion log prob choice.","required":["logprob","token"],"properties":{"bytes":{"oneOf":[{"type":"array","items":{"type":"integer","format":"int32"},"description":"A list of integers representing the UTF-8 bytes representation of the token.\nUseful in instances where characters are represented by multiple tokens and their byte\nrepresentations must be combined to generate the correct text representation.\nCan be null if there is no bytes representation for the token."},{"type":"null","items":{"type":"integer","format":"int32"},"description":"A list of integers representing the UTF-8 bytes representation of the token.\nUseful in instances where characters are represented by multiple tokens and their byte\nrepresentations must be combined to generate the correct text representation.\nCan be null if there is no bytes representation for the token."}]},"logprob":{"type":"number","format":"float","description":"The log prob of the chat completion."},"token":{"type":"string","description":"The token of the chat completion."}}}}}},"description":"The log probs of the chat completion.","uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1.content","typeLabel":"object[] | null"}},"uniqueKey":"choices.items.[INDEX].logprobs.oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"null | object"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"description":"A list of chat completion choices.","example":"[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]","isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"created":{"type":"integer","format":"int64","description":"The Unix timestamp (in seconds) of when the chat completion was created.","example":1677652288,"isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"id":{"type":"string","description":"A unique identifier for the chat completion.","example":"chatcmpl-123","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"model":{"type":"string","description":"The model used for the chat completion.","example":"meta-llama/Llama-3.3-70B-Instruct","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"object":{"type":"string","description":"The object of the chat completion.","example":"chat.completion","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"service_tier":{"oneOf":[{"type":"string","description":"The service tier of the chat completion.","example":"auto","uniqueKey":"service_tier.oneOf.0","typeLabel":"string"},{"type":"null","description":"The service tier of the chat completion.","example":"auto","uniqueKey":"service_tier.oneOf.1","typeLabel":"null"}],"uniqueKey":"service_tier","typeLabel":"string | null"},"system_fingerprint":{"oneOf":[{"type":"string","description":"The system fingerprint for the completion, if applicable.","example":"fp_44709d6fcb","uniqueKey":"system_fingerprint.oneOf.0","typeLabel":"string"},{"type":"null","description":"The system fingerprint for the completion, if applicable.","example":"fp_44709d6fcb","uniqueKey":"system_fingerprint.oneOf.1","typeLabel":"null"}],"uniqueKey":"system_fingerprint","typeLabel":"string | null"},"usage":{"oneOf":[{"type":"null","uniqueKey":"usage.oneOf.0","typeLabel":"null"},{"type":"object","description":"Usage statistics for the completion request.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"completion_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the completion.","example":12,"isRequired":true,"uniqueKey":"usage.oneOf.1.completion_tokens","typeLabel":"integer\u003cint32>"},"prompt_tokens":{"type":"integer","format":"int32","description":"Number of tokens in the prompt.","example":9,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens","typeLabel":"integer\u003cint32>"},"total_tokens":{"type":"integer","format":"int32","description":"Total number of tokens used (prompt + completion).","example":21,"isRequired":true,"uniqueKey":"usage.oneOf.1.total_tokens","typeLabel":"integer\u003cint32>"},"prompt_tokens_details":{"oneOf":[{"type":"null","uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.0","typeLabel":"null"},{"type":"object","description":"Details about the prompt tokens.","required":["audio_tokens","cached_tokens"],"properties":{"audio_tokens":{"type":"integer","format":"int32","description":"The number of audio tokens","example":0,"minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.1.audio_tokens","typeLabel":"integer\u003cint32>"},"cached_tokens":{"type":"integer","format":"int32","description":"The number of cached tokens","example":10,"minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.1.cached_tokens","typeLabel":"integer\u003cint32>"}},"uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.1","typeLabel":"object"}],"uniqueKey":"usage.oneOf.1.prompt_tokens_details","typeLabel":"null | object"}},"uniqueKey":"usage.oneOf.1","typeLabel":"object"}],"uniqueKey":"usage","typeLabel":"null | object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"choices":"[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]","created":1677652288,"id":"chatcmpl-123","model":"meta-llama/Llama-3.3-70B-Instruct","object":"chat.completion","service_tier":"auto","system_fingerprint":"fp_44709d6fcb","usage":{"completion_tokens":12,"prompt_tokens":9,"total_tokens":21,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":10}}}}},"exampleType":"generated"}},"exampleType":"generated"},"006bea0e-f5e0-46b6-864e-4de1452a05fb":{"description":"Bad request","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"3d5c1a70-39ed-44a1-8092-9c4494b20f9d":{"description":"Unauthorized","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"e6a3806e-12f7-4a80-83ab-c592c017f94a":{"description":"Internal server error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"decc946f-3ac5-4cd9-91fd-4c08caee0fa7":{"bearerAuth":{"type":"http","scheme":"bearer","scopes":[]}}},"servers":{"dfb8e2f7-db43-4d17-8dd7-eba4e1b68421":{"url":"https://api.atoma.network"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"cloud-api-reference/openapi.yml"},"subdomain":"atoma","siteName":"Atoma","title":"Create chat completions - Atoma","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-08-27T12:14:43.558Z","originalFileLocation":"cloud-api-reference/chat/create-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=\"This function processes chat completion requests by determining whether to use streaming or non-streaming response handling based on the request payload. For streaming requests, it configures additional options to track token usage. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head name=\"application-name\" content=\"Atoma\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_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/atoma/HSkPayHGWCvocihP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create chat completions - Atoma\">\u003cmeta data-mint-head property=\"og:description\" content=\"This function processes chat completion requests by determining whether to use streaming or non-streaming response handling based on the request payload. For streaming requests, it configures additional options to track token usage. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Atoma\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://atoma.mintlify.site/_mintlify/api/og/v2?division=Chat\u0026amp;title=Create+chat+completions\u0026amp;description=This+function+processes+chat+completion+requests+by+determining+whether+to+use+streaming%0Aor+non-streaming+response+handling+based+on+the+request+payload.+For+st\u0026amp;theme=cafd4bab465c83e2db0edc73\u0026amp;signature=053fa30245b888deebc2055169f03b6a5a26ff590f9374620e7d90dc31202bca\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create chat completions - Atoma\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This function processes chat completion requests by determining whether to use streaming or non-streaming response handling based on the request payload. For streaming requests, it configures additional options to track token usage. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://atoma.mintlify.site/_mintlify/api/og/v2?division=Chat\u0026amp;title=Create+chat+completions\u0026amp;description=This+function+processes+chat+completion+requests+by+determining+whether+to+use+streaming%0Aor+non-streaming+response+handling+based+on+the+request+payload.+For+st\u0026amp;theme=cafd4bab465c83e2db0edc73\u0026amp;signature=053fa30245b888deebc2055169f03b6a5a26ff590f9374620e7d90dc31202bca\">\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/atoma/HSkPayHGWCvocihP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Atoma\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#87CEFA\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cloud-api-reference/chat/create-chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.atoma.ai/#organization\",\"name\":\"Atoma\",\"url\":\"https://docs.atoma.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/atoma/tjjv1G2ZJctJbnbW/logo/Favicon_Atoma.svg?fit=max\u0026auto=format\u0026n=tjjv1G2ZJctJbnbW\u0026q=85\u0026s=fb271bbe709375a10927262bb6bc73a1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.atoma.ai#website\",\"name\":\"Atoma\",\"url\":\"https://docs.atoma.ai\",\"publisher\":{\"@id\":\"https://docs.atoma.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions#webpage\",\"url\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions\",\"name\":\"Create chat completions\",\"description\":\"This function processes chat completion requests by determining whether to use streaming or non-streaming response handling based on the request payload. For streaming requests, it configures additional options to track token usage. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\",\"dateModified\":\"2025-08-27T12:14:43.558Z\",\"isPartOf\":{\"@id\":\"https://docs.atoma.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Atoma\",\"item\":\"https://docs.atoma.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create chat completions\",\"item\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions#apireference\",\"headline\":\"Create chat completions\",\"name\":\"Create chat completions\",\"description\":\"This function processes chat completion requests by determining whether to use streaming or non-streaming response handling based on the request payload. For streaming requests, it configures additional options to track token usage. ## Returns Returns a Response containing either: - A streaming SSE connection for real-time completions - A single JSON response for non-streaming completions ## Errors Returns an error status code if: - The request processing fails - The streaming/non-streaming handlers encounter errors - The underlying inference service returns an error\",\"url\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.atoma.ai/cloud-api-reference/chat/create-chat-completions#webpage\"},\"dateModified\":\"2025-08-27T12:14:43.558Z\",\"publisher\":{\"@id\":\"https://docs.atoma.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.atoma.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Atoma\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Atoma","nav":{"global":{"anchors":[{"anchor":"Website","href":"https://www.atoma.ai","icon":"globe"},{"anchor":"Community","href":"https://discord.gg/atoma","icon":"discord"},{"anchor":"Blog","href":"https://atomanetwork.medium.com","icon":"newspaper"},{"anchor":"Github","href":"https://github.com/atoma-ai","icon":"github"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/documentation/get-started/overview"}]},{"tab":"Cloud API Reference","groups":[{"group":"API Reference","pages":[{"title":"Get Started","href":"/cloud-api-reference/get-started"}]},{"group":"Completions","pages":[{"title":"Create completions","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/completions","href":"/cloud-api-reference/completions/create-completions"}]},{"group":"Confidential Completions","pages":[{"title":"Create confidential completions","description":"This handler processes completions requests in a confidential manner, providing additional\nencryption and security measures for sensitive data processing. It supports both streaming and\nnon-streaming responses while maintaining data confidentiality through AEAD encryption and TEE hardware,\nfor full private AI compute.\n\n## Returns\n\nReturns a `Result` containing either:\n* An HTTP response with the completions result\n* A streaming SSE connection for real-time completions\n* An `AtomaProxyError` error if the request processing fails\n\n## Errors\n\nReturns `AtomaProxyError::InvalidBody` if:\n* The 'stream' field is missing or invalid in the payload\n\nReturns `AtomaProxyError::InternalError` if:\n* The inference service request fails\n* Response processing encounters errors\n* State manager updates fail\n\n## Security Features\n\n* Utilizes AEAD encryption for request/response data\n* Supports TEE (Trusted Execution Environment) processing\n* Implements secure key exchange using X25519\n* Maintains confidentiality throughout the request lifecycle","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/completions","href":"/cloud-api-reference/confidential-completions/create-confidential-completions"}]},{"group":"Chat","pages":[{"title":"Create chat completions","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/chat/completions","href":"/cloud-api-reference/chat/create-chat-completions"}]},{"group":"Confidential Chat","pages":[{"title":"Create confidential chat completions","description":"This handler processes chat completion requests in a confidential manner, providing additional\nencryption and security measures for sensitive data processing. It supports both streaming and\nnon-streaming responses while maintaining data confidentiality through AEAD encryption and TEE hardware,\nfor full private AI compute.\n\n## Returns\n\nReturns a `Result` containing either:\n* An HTTP response with the chat completion result\n* A streaming SSE connection for real-time completions\n* An `AtomaProxyError` error if the request processing fails\n\n## Errors\n\nReturns `AtomaProxyError::InvalidBody` if:\n* The 'stream' field is missing or invalid in the payload\n\nReturns `AtomaProxyError::InternalError` if:\n* The inference service request fails\n* Response processing encounters errors\n* State manager updates fail\n\n## Security Features\n\n* Utilizes AEAD encryption for request/response data\n* Supports TEE (Trusted Execution Environment) processing\n* Implements secure key exchange using X25519\n* Maintains confidentiality throughout the request lifecycle","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/chat/completions","href":"/cloud-api-reference/confidential-chat/create-confidential-chat-completions"}]},{"group":"Confidential Embeddings","pages":[{"title":"Create confidential embeddings","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/embeddings","href":"/cloud-api-reference/confidential-embeddings/create-confidential-embeddings"}]},{"group":"Confidential Images","pages":[{"title":"Create confidential image","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/confidential/images/generations","href":"/cloud-api-reference/confidential-images/create-confidential-image"}]},{"group":"Embeddings","pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/embeddings","href":"/cloud-api-reference/embeddings/create-embeddings"}]},{"group":"Health","pages":[{"title":"Health","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /health","href":"/cloud-api-reference/health/health"}]},{"group":"Images","pages":[{"title":"Create image","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/images/generations","href":"/cloud-api-reference/images/create-image"}]},{"group":"Models","pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /v1/models","href":"/cloud-api-reference/models/list-models"},{"title":"OpenRouter models listing endpoint","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml get /v1/open_router/models","href":"/cloud-api-reference/models/openrouter-models-listing-endpoint"}]},{"group":"Nodes","pages":[{"title":"Create node","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/nodes","href":"/cloud-api-reference/nodes/create-node"},{"title":"Create a node lock for confidential compute","deprecated":null,"version":null,"openapi":"cloud-api-reference/openapi.yml post /v1/nodes/lock","href":"/cloud-api-reference/nodes/create-a-node-lock-for-confidential-compute"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/overview"}]}]},"basePath":"","title":"Create chat completions - Atoma","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C-hEh3I2.js","utils-CnF4QiUD.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C7PVNbel.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-8ytevL2A.js","snippetPresets-BT1alx3v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BLXC0i_W.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CyLIGI9_.js","shallow-DC0lGVIW.js","getApiPlaygroundDisplay-CgDQ85tN.js","CodeSnippet-6-I-Gpv9.js","CodeSnippets-BAk1kDdu.js","Page-C945cI-W.js","getPastedJson-B276RuWN.js","icon-BqP8etTm.js","MethodPill-DM6sbxG1.js","DuplicateIcon-PyJglOaE.js","createIcon-CMeOMAc_.js","DynamicMarkdown-BoyYAA8K.js","SectionHeading-DAYv3gvZ.js","axios-vUo_bRtp.js","Markdown-BhTTmazV.js","clsx-CR-RHrVC.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CBUH0-zX.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BmARFYNC.js"]}