OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.
Optional end-user id for filtering request logs later. Length 8–128; ASCII letters, digits, -, and _ only. Invalid values return 400.
Required string length: 8 - 128
Pattern: ^[A-Za-z0-9_-]+$
Example:
"end_user_01"
Body
application/json
OpenAI Chat Completions request body. Requires model and messages; optional stream, max_tokens, max_completion_tokens, temperature, n, and reasoning_effort.
Core fields below; other fields follow OpenAI Chat Completions.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Modellix","colors":{"primary":"#605AFF","light":"#7D78FF","dark":"#3B35E8"},"logo":{"light":"https://mintcdn.com/modellix/5vxdmwCOV66pktW8/assets/logo-light.svg?fit=max\u0026auto=format\u0026n=5vxdmwCOV66pktW8\u0026q=85\u0026s=64f85bf4c6ca365db004d44fd6553c3c","dark":"https://mintcdn.com/modellix/5vxdmwCOV66pktW8/assets/logo-dark.svg?fit=max\u0026auto=format\u0026n=5vxdmwCOV66pktW8\u0026q=85\u0026s=949b3a32914f2e109ae6043c13240dc3"},"favicon":"https://mintcdn.com/modellix/5vxdmwCOV66pktW8/assets/favicon.svg?fit=max\u0026auto=format\u0026n=5vxdmwCOV66pktW8\u0026q=85\u0026s=15861b2c470a352729501a9c5fcb704b","api":{"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["bash","javascript","python","go","java","node","php","ruby","swift","powershell"],"prefill":true}},"navbar":{"links":[{"href":"https://modellix.ai/","label":"Home"},{"href":"https://modellix.ai/console/dashboard","label":"Console"}],"primary":{"type":"button","label":"Get API Key","href":"https://modellix.ai/console/api-key"}},"footer":{"socials":{"website":"https://modellix.ai","discord":"https://discord.gg/N2FbcB2cZT","github":"https://github.com/modellix","x":"https://x.com/modellixai","linkedin":"https://www.linkedin.com/company/modellix-ai","youtube":"https://www.youtube.com/@modellixai"},"links":[{"header":"Policy","items":[{"label":"Service Agreement","href":"https://modellix.ai/service-policy"},{"label":"Privacy Policy","href":"https://modellix.ai/privacy"}]}]},"seo":{"metatags":{"og:type":"website","og:site_name":"Modellix Documentation","og:locale":"en_US","canonical":"https://docs.modellix.ai","twitter:site":"@modellixai","theme-color":"#605AFF","google-site-verification":"MSDgpEOrkbSMjFl2UU6B52RTxSkSIQ15VZcLy6KABow"},"organization":{"id":"https://modellix.ai/#organization","name":"Modellix","legalName":"METAVERSE CLOUD PTE. LTD.","url":"https://modellix.ai","logo":"https://docs.modellix.ai/assets/logo-light.svg","sameAs":["https://github.com/modellix","https://x.com/modellixai","https://www.linkedin.com/company/modellix-ai/","https://discord.gg/N2FbcB2cZT","https://www.youtube.com/@modellixai","https://modellix.ai"]},"indexing":"all"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["assistant","copy","view","mcp","add-mcp","chatgpt","claude","aistudio","grok","perplexity","devin","windsurf","cursor","vscode","devin-mcp"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Support","icon":"mail","href":"mailto:support@modellix.ai"},{"anchor":"Community","icon":"discord","href":"https://discord.gg/N2FbcB2cZT"},{"anchor":"Blog","icon":"pen-line","href":"https://www.modellix.ai/blog/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"modellix","hasAudioNarration":false,"actualSubdomain":"modellix","customDomains":["docs.modellix.ai"],"gitSource":{"type":"github","owner":"modellix","repo":"modellix-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae3fe85ebcb8cc417e31858","collectionId":"1b360b72-49c0-468f-83b8-958b46a2a5f5","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae3fe85ebcb8cc417e31858"},"feedback":{"thumbs":false},"entitlements":{},"buildId":"6ae9b8a9fb19e826efc3ea88","clientVersion":"0.0.4064","searchFilterCounts":[{"language":"default","tag":"Media Models","count":349},{"language":"default","tag":"LLM","count":34},{"language":"default","tag":"Alibaba","count":30},{"language":"default","tag":"Vidu","count":24},{"language":"default","tag":"Google","count":23},{"language":"default","tag":"Guides","count":19},{"language":"default","tag":"ByteDance","count":18},{"language":"default","tag":"Kling","count":17},{"language":"default","tag":"MiniMax","count":17},{"language":"default","tag":"xAI","count":16}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"llm/chat-completions","slug":"/llm/chat-completions","pageMetadata":{"title":"Chat Completions","description":"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with `model` (provider/name format) and an OpenAI-style `messages` array; returns a chat.completion JSON object by default, or SSE (`text/event-stream`) when `stream=true`. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (`input`, `max_output_tokens`) or Anthropic Messages-only shapes on this endpoint—use `/responses` or `/messages` instead. Optional fields follow [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat); support depends on the selected model.","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/llm/api/llm.json post /chat/completions","href":"/llm/chat-completions","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with \", _jsx(_components.code, {\n children: \"model\"\n }), \" (provider/name format) and an OpenAI-style \", _jsx(_components.code, {\n children: \"messages\"\n }), \" array; returns a chat.completion JSON object by default, or SSE (\", _jsx(_components.code, {\n children: \"text/event-stream\"\n }), \") when \", _jsx(_components.code, {\n children: \"stream=true\"\n }), \". Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (\", _jsx(_components.code, {\n children: \"input\"\n }), \", \", _jsx(_components.code, {\n children: \"max_output_tokens\"\n }), \") or Anthropic Messages-only shapes on this endpoint—use \", _jsx(_components.code, {\n children: \"/responses\"\n }), \" or \", _jsx(_components.code, {\n children: \"/messages\"\n }), \" instead. Optional fields follow \", _jsx(_components.a, {\n href: \"https://platform.openai.com/docs/api-reference/chat\",\n children: \"OpenAI Chat Completions\"\n }), \"; support depends on the selected model.\"]\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":"Chat Completions","description":"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with `model` (provider/name format) and an OpenAI-style `messages` array; returns a chat.completion JSON object by default, or SSE (`text/event-stream`) when `stream=true`. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (`input`, `max_output_tokens`) or Anthropic Messages-only shapes on this endpoint—use `/responses` or `/messages` instead. Optional fields follow [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat); support depends on the selected model.","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/llm/api/llm.json post /chat/completions","href":"/llm/chat-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/modellix/0fd3da9d59294b85/rybbit_tracking_script.js"],"openApiReferenceData":{"operation":{"tags":["Chat Completions"],"summary":"Chat Completions","operationId":"createChatCompletion","x-mint":{"href":"/llm/chat-completions"},"description":"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with `model` (provider/name format) and an OpenAI-style `messages` array; returns a chat.completion JSON object by default, or SSE (`text/event-stream`) when `stream=true`. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (`input`, `max_output_tokens`) or Anthropic Messages-only shapes on this endpoint—use `/responses` or `/messages` instead. Optional fields follow [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat); support depends on the selected model.","parameters":["358ba900-9240-4f0e-8d5c-5f48b96cd721","5f84ab8d-7009-4648-9bfd-eb312cb8c3ae"],"requestBody":"f8ea4c9f-3414-40d2-8fdb-a7a7471a142d","responses":{"200":"871768d2-4f64-4983-956a-c4e2dc613e6d","400":"e45322fa-e28f-4796-94a4-3f7b8baa04d3","401":"0316a7d6-c5a8-4421-9903-9833eb851504","402":"35a60826-b0cb-44ad-8388-1b75e1f872dc","404":"076d0b50-aeea-493d-a443-256cb2d9b1d7","429":"702afb1f-b1de-4444-b906-310ccf11dde9","5XX":"a5f9be34-01a4-468a-a34a-8c532c597b62"},"method":"post","type":"path","servers":["600bb43f-9cd1-4554-b84c-a14301c5dcf4"],"security":["d0f3ce28-7e88-44e7-96a9-3f9db7f96272","ee9f377f-8608-42f1-85f6-2788bedd6341"],"path":"/chat/completions","baseUrlOptions":["https://llm.modellix.ai/v1"],"title":"Chat Completions","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go","java","node","php","ruby","swift","powershell"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"openai/gpt-5.6-sol","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.0":"Introduce yourself in one sentence","body.stream":false,"body.max_tokens":256},{"body.model":"openai/gpt-5.6-sol","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.0":"ping","body.stream":true,"body.max_tokens":256},{"body.model":"google/gemini-3.7-flash","body.messages.items.0.role":"user","body.messages.items.0.content.oneOf.1.items.0":{"type":"text","text":"What appears in this video?"},"body.messages.items.0.content.oneOf.1.items.1":{"type":"file","file":{"file_id":"https://example.com/clip.mp4","format":"video/mp4"}},"body.stream":false,"body.max_tokens":256}]},"dependencies":{"parameters":{"358ba900-9240-4f0e-8d5c-5f48b96cd721":{"name":"X-Mdlx-Session-Id","in":"header","required":false,"description":"Optional session affinity header. Length 8–128; alphanumeric, `-`, and `_` only.","schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","example":"my-conversation-001","isRequired":false,"description":"Optional session affinity header. Length 8–128; alphanumeric, `-`, and `_` only.","uniqueKey":"","typeLabel":"string"}},"5f84ab8d-7009-4648-9bfd-eb312cb8c3ae":{"name":"X-Mdlx-User-Id","in":"header","required":false,"description":"Optional end-user id for filtering request logs later. Length 8–128; ASCII letters, digits, `-`, and `_` only. Invalid values return 400.","schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","example":"end_user_01","isRequired":false,"description":"Optional end-user id for filtering request logs later. Length 8–128; ASCII letters, digits, `-`, and `_` only. Invalid values return 400.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"description":"OpenAI Chat Completions request body. Requires model and messages; optional stream, max_tokens, max_completion_tokens, temperature, n, and reasoning_effort.","content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"additionalProperties":true,"description":"Core fields below; other fields follow OpenAI Chat Completions.","properties":{"model":{"type":"string","description":"Model ID in `provider/name` form","examples":["openai/gpt-5.5","openai/gpt-5.6-sol","anthropic/claude-sonnet-5","google/gemini-3.6-flash"],"isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","minItems":1,"description":"OpenAI Chat Completions message list (min 1). Each item has role and content; roles include system, user, assistant, and tool.","items":{"type":"object","required":["role","content"],"additionalProperties":true,"description":"A single OpenAI Chat Completions message with role and content.","properties":{"role":{"type":"string","description":"e.g. system / user / assistant / tool","isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","description":"String, or array of parts: `text`, `image_url`, `input_audio`, `file`. HTTPS URL in `image_url.url` or `file.file_id` (for video, set `file.format`, e.g. `video/mp4`). Inline media: `data:\u003cmime>;base64,...` in the same field. Audio: `input_audio.data` (raw Base64) and `format` (`wav` or `mp3`).","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","additionalProperties":true,"description":"Chat Completions content part (`text`, `image_url`, `input_audio`, or `file`).","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"String, or array of parts: `text`, `image_url`, `input_audio`, `file`. HTTPS URL in `image_url.url` or `file.file_id` (for video, set `file.format`, e.g. `video/mp4`). Inline media: `data:\u003cmime>;base64,...` in the same field. Audio: `input_audio.data` (raw Base64) and `format` (`wav` or `mp3`).","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[]"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"stream":{"type":"boolean","default":false,"description":"Default false. When true, returns SSE chat.completion.chunk events ending with data: [DONE].","uniqueKey":"stream","typeLabel":"boolean"},"max_tokens":{"type":"integer","minimum":1,"description":"Optional maximum number of tokens to generate. Model-dependent.","uniqueKey":"max_tokens","typeLabel":"integer"},"max_completion_tokens":{"type":"integer","minimum":1,"description":"Optional generation cap preferred by some newer OpenAI-style models.","uniqueKey":"max_completion_tokens","typeLabel":"integer"},"temperature":{"type":"number","description":"Sampling temperature for Chat Completions. Model-dependent.","uniqueKey":"temperature","typeLabel":"number"},"n":{"type":"integer","minimum":1,"description":"Number of chat completion choices to generate.","uniqueKey":"n","typeLabel":"integer"},"reasoning_effort":{"type":"string","description":"Optional reasoning level. Follows OpenAI Chat Completions. Support and allowed values depend on the model.","uniqueKey":"reasoning_effort","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"nonStream":{"title":"nonStream","value":{"model":"openai/gpt-5.6-sol","stream":false,"max_tokens":256,"messages":[{"role":"user","content":"Introduce yourself in one sentence"}]}},"stream":{"title":"stream","value":{"model":"openai/gpt-5.6-sol","stream":true,"max_tokens":256,"messages":[{"role":"user","content":"ping"}]}},"videoHttps":{"title":"videoHttps","value":{"model":"google/gemini-3.7-flash","stream":false,"max_tokens":256,"messages":[{"role":"user","content":[{"type":"text","text":"What appears in this video?"},{"type":"file","file":{"file_id":"https://example.com/clip.mp4","format":"video/mp4"}}]}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"871768d2-4f64-4983-956a-c4e2dc613e6d":{"description":"Success. Non-streaming returns JSON; streaming returns SSE.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Shape follows OpenAI chat.completion","properties":{"id":{"type":"string","description":"Unique identifier for this chat completion.","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","example":"chat.completion","description":"Object type. Typically chat.completion for non-streaming responses.","uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","description":"Unix timestamp (seconds) when the chat completion was created.","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","description":"Model ID that produced this chat completion.","uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","description":"List of chat completion choices.","items":{"type":"object","additionalProperties":true,"description":"A single OpenAI chat completion choice (message, finish_reason, index, and related fields).","uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","additionalProperties":true,"description":"OpenAI chat.completion token usage counts.","properties":{"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt for Chat Completions.","uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","description":"Number of tokens in the generated completion.","uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","description":"Total tokens used (prompt plus completion).","uniqueKey":"usage.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"type":"object","additionalProperties":true,"description":"Optional breakdown. Some models include video_tokens, audio_tokens, and text_tokens. These counts are already included in prompt_tokens; billing uses prompt_tokens and completion_tokens, not a separate video rate.","properties":{"cached_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens_details.cached_tokens","typeLabel":"integer"},"text_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens_details.text_tokens","typeLabel":"integer"},"audio_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens_details.audio_tokens","typeLabel":"integer"},"video_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens_details.video_tokens","typeLabel":"integer"}},"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"chat.completion","created":123,"model":"\u003cstring>","choices":[{}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123,"prompt_tokens_details":{"cached_tokens":123,"text_tokens":123,"audio_tokens":123,"video_tokens":123}}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"string","description":"SSE: `data: {chat.completion.chunk}` lines, terminated by `data: [DONE]`","uniqueKey":"","typeLabel":"string"},"examples":{"Example":{"title":"Example","value":"\u003cstring>"}},"exampleType":"generated"}},"exampleType":"generated"},"e45322fa-e28f-4796-94a4-3f7b8baa04d3":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"0316a7d6-c5a8-4421-9903-9833eb851504":{"description":"Missing or invalid API key, or conflicting Authorization and x-api-key values","content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"invalid API key","type":"invalid_request_error"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"invalid API key","type":"invalid_request_error"}}}},"exampleType":"examples"}},"exampleType":"examples"},"35a60826-b0cb-44ad-8388-1b75e1f872dc":{"description":"Insufficient account balance","content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"insufficient balance, please recharge your account","type":"insufficient_quota"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"insufficient balance, please recharge your account","type":"insufficient_quota"}}}},"exampleType":"examples"}},"exampleType":"examples"},"076d0b50-aeea-493d-a443-256cb2d9b1d7":{"description":"Unknown path, or the selected model is unavailable","content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"modelUnavailable":{"title":"modelUnavailable","value":{"error":{"message":"the selected model is unavailable","type":"invalid_request_error"}}}},"exampleType":"examples"}},"exampleType":"examples"},"702afb1f-b1de-4444-b906-310ccf11dde9":{"description":"Rate limited (RPM or other request limits), or the selected model is temporarily unavailable (e.g. upstream deployment cooldown)","headers":{"X-RateLimit-Limit":{"description":"Maximum number of requests allowed in the current rate-limit window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Number of requests remaining in the current rate-limit window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp (seconds) when the current rate-limit window resets.","schema":{"type":"integer"}},"Retry-After":{"schema":{"type":"integer"},"description":"May be returned when the model is temporarily unavailable; value in seconds"}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rpm":{"title":"rpm","value":{"error":{"message":"rate limit exceeded","type":"rate_limit_exceeded"}}},"modelCooldown":{"title":"modelCooldown","value":{"error":{"message":"the selected model is temporarily unavailable, please retry later or try another model","type":"api_error"}}}},"exampleType":"examples"}},"exampleType":"examples"},"a5f9be34-01a4-468a-a34a-8c532c597b62":{"description":"Temporary service unavailability or upstream error (client-facing message may be sanitized)","content":{"application/json":{"schema":{"type":"object","required":["error"],"description":"Gateway error envelope shared by Chat Completions, Responses, and Messages.","properties":{"error":{"type":"object","required":["message","type"],"additionalProperties":true,"description":"Error details object.","properties":{"message":{"type":"string","description":"Human-readable error message.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"Error type string (for example invalid_request_error, rate_limit_exceeded, insufficient_quota).","examples":["invalid_request_error","api_error","rate_limit_exceeded","request_limited","insufficient_quota"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional machine-readable error code, or null.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"Optional parameter name related to the error, or null.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"d0f3ce28-7e88-44e7-96a9-3f9db7f96272":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Authorization: Bearer \u003cModellix API Key> (OpenAI SDK, Codex, OpenCode, etc.)","scopes":[],"schemeName":"BearerAuth"}},"ee9f377f-8608-42f1-85f6-2788bedd6341":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"x-api-key: \u003cModellix API Key> (Anthropic SDK, Claude Code, etc.). Equivalent to Bearer; if both are present they must be the same key.","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"600bb43f-9cd1-4554-b84c-a14301c5dcf4":{"url":"https://llm.modellix.ai/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Authorization: Bearer \u003cModellix API Key> (OpenAI SDK, Codex, OpenCode, etc.)","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Authorization: Bearer \u003cModellix API Key> (OpenAI SDK, Codex, OpenCode, etc.)","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"x-api-key: \u003cModellix API Key> (Anthropic SDK, Claude Code, etc.). Equivalent to Bearer; if both are present they must be the same key.","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"x-api-key: \u003cModellix API Key> (Anthropic SDK, Claude Code, etc.). Equivalent to Bearer; if both are present they must be the same key.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"x-api-key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"llm/api/llm.json"},"subdomain":"modellix","siteName":"Modellix","title":"Chat Completions - Modellix","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-13T02:54:01.678Z","originalFileLocation":"llm/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Modellix\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_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/modellix/GC_RLQcykuHMFCWa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat Completions - Modellix\">\u003cmeta data-mint-head property=\"og:description\" content=\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Modellix Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.modellix.ai/llm/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://modellix.mintlify.app/_mintlify/api/og/v2?division=API\u0026amp;title=Chat+Completions\u0026amp;description=OpenAI+Chat+Completions%E2%80%93compatible+endpoint+on+the+Modellix+LLM+gateway.+Accepts+a+synchronous+request+with+%60model%60+%28provider%2Fname+format%29+and+an+OpenAI-style+%60\u0026amp;theme=8475f4d58d9dab44679f5d45\u0026amp;signature=b0c55cbfad9961eb38c9feabe9342fbb360881eff4385df97f818cdb7df8cd92\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat Completions - Modellix\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://modellix.mintlify.app/_mintlify/api/og/v2?division=API\u0026amp;title=Chat+Completions\u0026amp;description=OpenAI+Chat+Completions%E2%80%93compatible+endpoint+on+the+Modellix+LLM+gateway.+Accepts+a+synchronous+request+with+%60model%60+%28provider%2Fname+format%29+and+an+OpenAI-style+%60\u0026amp;theme=8475f4d58d9dab44679f5d45\u0026amp;signature=b0c55cbfad9961eb38c9feabe9342fbb360881eff4385df97f818cdb7df8cd92\">\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/modellix/GC_RLQcykuHMFCWa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Modellix\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#605AFF\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"theme-color\" content=\"#605AFF\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"MSDgpEOrkbSMjFl2UU6B52RTxSkSIQ15VZcLy6KABow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.modellix.ai/llm/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/llm/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://modellix.ai/#organization\",\"name\":\"Modellix\",\"legalName\":\"METAVERSE CLOUD PTE. LTD.\",\"url\":\"https://modellix.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.modellix.ai/assets/logo-light.svg\"},\"sameAs\":[\"https://github.com/modellix\",\"https://x.com/modellixai\",\"https://www.linkedin.com/company/modellix-ai/\",\"https://discord.gg/N2FbcB2cZT\",\"https://www.youtube.com/@modellixai\",\"https://modellix.ai\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.modellix.ai#website\",\"name\":\"Modellix\",\"url\":\"https://docs.modellix.ai\",\"publisher\":{\"@id\":\"https://modellix.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.modellix.ai/llm/chat-completions#webpage\",\"url\":\"https://docs.modellix.ai/llm/chat-completions\",\"name\":\"Chat Completions\",\"description\":\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.\",\"dateModified\":\"2026-10-13T02:54:01.678Z\",\"isPartOf\":{\"@id\":\"https://docs.modellix.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.modellix.ai/llm/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.modellix.ai/llm/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API\",\"item\":\"https://docs.modellix.ai/llm/api/api\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat Completions\",\"item\":\"https://docs.modellix.ai/llm/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.modellix.ai/llm/chat-completions#apireference\",\"headline\":\"Chat Completions\",\"name\":\"Chat Completions\",\"description\":\"OpenAI Chat Completions–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with model (provider/name format) and an OpenAI-style messages array; returns a chat.completion JSON object by default, or SSE (text/event-stream) when stream=true. Use this path for the OpenAI SDK, Codex, and most OpenAI-compatible chat clients. Do not send Responses fields (input, max_output_tokens) or Anthropic Messages-only shapes on this endpoint—use /responses or /messages instead. Optional fields follow OpenAI Chat Completions; support depends on the selected model.\",\"url\":\"https://docs.modellix.ai/llm/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.modellix.ai/llm/chat-completions#webpage\"},\"dateModified\":\"2026-10-13T02:54:01.678Z\",\"publisher\":{\"@id\":\"https://modellix.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.modellix.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Modellix\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Modellix","nav":{"global":{"anchors":[{"anchor":"Support","icon":"mail","href":"mailto:support@modellix.ai"},{"anchor":"Community","icon":"discord","href":"https://discord.gg/N2FbcB2cZT"},{"anchor":"Blog","icon":"pen-line","href":"https://www.modellix.ai/blog/"}]},"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/get-started"}]},{"tab":"Media Models","pages":[{"title":"Media Models","href":"/alibaba/happyhorse-1-1-t2v"}]},{"tab":"LLM","groups":[{"group":"Get Started","pages":[{"title":"Modellix LLM Overview","sidebarTitle":"Overview","icon":"message-square","href":"/llm/overview"}]},{"group":"API","pages":[{"title":"Modellix LLM API Guide","sidebarTitle":"Guide","description":"Call Modellix LLM with OpenAI-compatible Chat Completions and Responses or Anthropic-compatible Messages—sync requests, streaming SSE, multimodal content parts, auth, model list, request logs, errors, and billing.","icon":"book-open","href":"/llm/api/api"},{"title":"Chat Completions","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/llm/api/llm.json post /chat/completions","href":"/llm/chat-completions"},{"title":"Responses","description":"OpenAI Responses–compatible endpoint on the Modellix LLM gateway. Accepts a synchronous request with `model` (provider/name format) and `input` (string or content array); returns a Responses JSON object by default, or SSE (`text/event-stream`) when `stream=true`. Use `max_output_tokens` for output limits. Prefer this path when the client targets the OpenAI Responses API rather than classic Chat Completions. Do not send Chat Completions-style `messages`/`max_tokens` or Anthropic Messages shapes on this endpoint—use `/chat/completions` or `/messages` instead. Optional fields follow [OpenAI Responses](https://platform.openai.com/docs/api-reference/responses); support depends on the selected model.","deprecated":null,"version":null,"sidebarTitle":"Responses","openapi":"/llm/api/llm.json post /responses","href":"/llm/responses"},{"title":"Messages","deprecated":null,"version":null,"sidebarTitle":"Messages","openapi":"/llm/api/llm.json post /messages","href":"/llm/messages"},{"title":"List models","deprecated":null,"version":null,"sidebarTitle":"List models","openapi":"/llm/api/llm.json get /models","href":"/llm/list-models"},{"title":"Get LLM logs","deprecated":null,"version":null,"sidebarTitle":"Get llm logs","openapi":"/llm/api/llm.json get /logs","href":"/llm/get-llm-logs"}]},{"group":"Agent","pages":[{"title":"Use Modellix LLM with Claude Code","sidebarTitle":"Claude Code","icon":"terminal","href":"/llm/agent/claude-code"},{"title":"Use Modellix LLM with CodeBuddy","sidebarTitle":"CodeBuddy","icon":"terminal","href":"/llm/agent/codebuddy"},{"title":"Use Modellix LLM with Codex CLI","sidebarTitle":"Codex","icon":"terminal","href":"/llm/agent/codex"},{"title":"Use Modellix LLM with DeepSeek Harness","sidebarTitle":"DeepSeek Harness","icon":"terminal","href":"/llm/agent/deepseek-harness"},{"title":"Use Modellix LLM with Grok Build","sidebarTitle":"Grok Build","icon":"terminal","href":"/llm/agent/grok-build"},{"title":"Use Modellix LLM with Hermes Agent","sidebarTitle":"Hermes Agent","icon":"terminal","href":"/llm/agent/hermes"},{"title":"Use Modellix LLM with Junie CLI","sidebarTitle":"Junie CLI","icon":"terminal","href":"/llm/agent/junie"},{"title":"Use Modellix LLM with Kilo Code","sidebarTitle":"Kilo Code","icon":"terminal","href":"/llm/agent/kilo-code"},{"title":"Use Modellix LLM with OpenClaw 🦞","sidebarTitle":"OpenClaw 🦞","icon":"terminal","href":"/llm/agent/openclaw"},{"title":"Use Modellix LLM with OpenCode","sidebarTitle":"OpenCode","icon":"terminal","href":"/llm/agent/opencode"},{"title":"Use Modellix LLM with Pi Agent","sidebarTitle":"Pi Agent","icon":"terminal","href":"/llm/agent/pi"},{"title":"Use Modellix LLM with Qwen Code","sidebarTitle":"Qwen Code","icon":"terminal","href":"/llm/agent/qwen-code"},{"title":"Use Modellix LLM with Reasonix","sidebarTitle":"Reasonix","icon":"terminal","href":"/llm/agent/reasonix"},{"title":"Use Modellix LLM with WorkBuddy","sidebarTitle":"WorkBuddy","icon":"terminal","href":"/llm/agent/workbuddy"}]},{"group":"SDK","pages":[{"title":"Use Modellix LLM with the OpenAI SDK","sidebarTitle":"OpenAI SDK","icon":"code","href":"/llm/sdk/openai-sdk"},{"title":"Use Modellix LLM with the Anthropic SDK","sidebarTitle":"Anthropic SDK","icon":"code","href":"/llm/sdk/anthropic-sdk"},{"title":"Use Modellix LLM with the OpenAI Agents SDK","sidebarTitle":"OpenAI Agents SDK","icon":"code","href":"/llm/sdk/openai-agents"},{"title":"Use Modellix LLM with the Claude Agent SDK","sidebarTitle":"Claude Agent SDK","icon":"code","href":"/llm/sdk/claude-agent-sdk"},{"title":"Use Modellix LLM with the Vercel AI SDK","sidebarTitle":"Vercel AI SDK","icon":"code","href":"/llm/sdk/vercel-ai-sdk"}]},{"group":"Framework","pages":[{"title":"Use Modellix LLM with LangChain","sidebarTitle":"LangChain","icon":"code","href":"/llm/framework/langchain"},{"title":"Use Modellix LLM with Mastra","sidebarTitle":"Mastra","icon":"code","href":"/llm/framework/mastra"},{"title":"Use Modellix LLM with CrewAI","sidebarTitle":"CrewAI","icon":"code","href":"/llm/framework/crewai"},{"title":"Use Modellix LLM with Agno","sidebarTitle":"Agno","icon":"code","href":"/llm/framework/agno"},{"title":"Use Modellix LLM with Microsoft Agent Framework","sidebarTitle":"Microsoft Agent Framework","icon":"code","href":"/llm/framework/microsoft-agent-framework"}]},{"group":"IDE","pages":[{"title":"Use Modellix LLM with Cursor","sidebarTitle":"Cursor","icon":"terminal","href":"/llm/ide/cursor"},{"title":"Use Modellix LLM with Cline","sidebarTitle":"Cline","icon":"terminal","href":"/llm/ide/cline"}]},{"group":"Tool","pages":[{"title":"Use Modellix LLM with CC Switch","sidebarTitle":"CC Switch","icon":"terminal","href":"/llm/tool/cc-switch"}]}]},{"tab":"Live","pages":[{"title":"Live","href":"/live/overview"}]},{"tab":"Tools","pages":[{"title":"Tools","href":"/tools/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/product-updates"}]}]},"basePath":"","title":"Chat Completions - Modellix","buildId":"dpl_2gSLkbMoF5kkLsBqYzq9KWtDyJRo","deploymentId":"dpl_2gSLkbMoF5kkLsBqYzq9KWtDyJRo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-hfTk6MZX.js","utils-Bfp7HcY4.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D8dSW7yV.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CFgQXcZO.js","snippetPresets-dMW1-pV3.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-DyrCOido.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Bwwdcyh3.js","shallow-drVXTg79.js","getApiPlaygroundDisplay-GMPxUzWV.js","CodeSnippet-wTmV0wP6.js","CodeSnippets-D_QxCJEq.js","Page-BsZAA8xk.js","getPastedJson-Dev-X0Xy.js","icon-7L2WL0jD.js","MethodPill-Ble59Dl_.js","DuplicateIcon-r-98uLGh.js","createIcon-DaFzipjW.js","DynamicMarkdown-Jk8YAWGN.js","SectionHeading-nLgrCDOg.js","axios-vUo_bRtp.js","Markdown-_QGow1Wo.js","clsx-v8ssfMzu.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CjboTi0T.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DkAyo-p5.js"]}