The Chat Completions API uses OpenAI-compatible request and response formats, with model-specific capabilities and limits. Use it to generate text-only and multimodal responses from Perceptron Mk1.Perceptron Mk1 triggers thinking and structured grounding through the typed vision_config body field.
Asking several independent questions about the same image or video? Use Multilook to send up to 16 prompts over one shared context in a single request and pay for the context once.
If you’ve already sampled frames client-side, pass them inline with a video_frames content part instead of a single video_url. Each frame carries an image_url (HTTP(S) URL or base64 data URL) and a timestamp_ms offset from the start of the clip. Provide between two and 256 frames, ordered by non-decreasing timestamp_ms. For optimal performance, follow a uniform sampling strategy aligned with the Video Token Counting guide.
Set "stream": true to receive Server-Sent Events (SSE). Opt into token usage with stream_options.include_usage: true. Handle a trailing usage-only chunk with choices: [] before data: [DONE]; do not assume usage arrives on the chunk carrying finish_reason.Inspect finish_reason: stop means normal completion, while length means the output was cut off. Clients shared with tool-capable models must also handle tool_calls. Treat error events and interrupted streams as failures or incomplete output; [DONE] alone does not prove a successful answer.
Thinking pairs well with text and clipping; not with spatial detection. Turn enable_thinking on for text Q&A, captioning, OCR, and annotation_format: "clip". Turn it off for "point", "box", and "polygon".
Leave temperature unset. The default is 0.0 (deterministic). Only set a non-zero value if you want more varied outputs.
Image format: HTTP(S) URLs and base64 data URLs are both supported. MIME types: image/png, image/jpeg, image/webp, video/mp4, video/webm.
Inline frames vs. video_url: Send a whole clip with video_url, or — if you’ve already sampled frames — pass them inline with video_frames (two to 256 frames, timestamp_ms non-decreasing). Inline frames give you precise control over exactly which frames the model sees; for optimal performance, sample uniformly in line with the Video Token Counting guide.
Token limits: 32K context, 8K output.
Many questions, one input: batch them with Multilook instead of repeating the media on every call. The shared context is prefilled once, and reused tokens are billed at the cache-read rate.
How much the model reasons before it answers: none, minimal, low, medium or high.
A tier other than none turns reasoning on. vision_config.enable_thinking, when set,
decides whether the model reasons; the tier then only applies while reasoning is on.
An object specifying the format that the model must output.
Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs
which ensures the model will match your supplied JSON schema.
Whether the model may call the declared functions: auto (the default) or none. none is
best effort and does not guarantee a response without tool calls. Forcing a call (required
or a named function) is not supported and is rejected with a 400. Ignored without functions
in tools.
Functions the model may call and the caller executes. Cannot be combined with a
json_schemaresponse_format or regex.
Functions require a model that supports tool calling: other models reject them, and tool
calls or results in messages, with a 400. Generation stops at the first turn that calls
functions, so a response carries at most one turn of tool_calls.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Perceptron Docs","colors":{"primary":"#3B63FF","light":"#8BA6FF","dark":"#193BFF"},"logo":{"light":"https://mintcdn.com/perceptron/CuyGah1e2BqRrsVm/logo/perceptron-full-logo-light.svg?fit=max\u0026auto=format\u0026n=CuyGah1e2BqRrsVm\u0026q=85\u0026s=f5d2ffd0aaf71daba362f13fc9f7decf","dark":"https://mintcdn.com/perceptron/CuyGah1e2BqRrsVm/logo/perceptron-full-logo-dark.svg?fit=max\u0026auto=format\u0026n=CuyGah1e2BqRrsVm\u0026q=85\u0026s=859b1eeb3fa33674275135e6590684df"},"favicon":{"light":"https://mintcdn.com/perceptron/h8MQ12qmkOCPxnyY/logo/favicon_light.png?fit=max\u0026auto=format\u0026n=h8MQ12qmkOCPxnyY\u0026q=85\u0026s=9fed764e4a310a0a735776364bae108f","dark":"https://mintcdn.com/perceptron/h8MQ12qmkOCPxnyY/logo/favicon_dark.png?fit=max\u0026auto=format\u0026n=h8MQ12qmkOCPxnyY\u0026q=85\u0026s=c3ee1fadf844c0278101787211ea413c"},"navbar":{"links":[{"href":"https://www.perceptron.inc/demo","label":"Demo"},{"href":"mailto:support@perceptron.inc","label":"Support"},{"href":"https://discord.gg/fgBeaACQzE","label":"Discord"}]},"footer":{"socials":{"discord":"https://discord.gg/fgBeaACQzE","github":"https://github.com/perceptron-ai-inc","linkedin":"https://www.linkedin.com/company/perceptron-ai-inc","x":"https://x.com/perceptroninc"}},"contextual":{"options":["copy","chatgpt","claude","cursor","mcp","perplexity","view","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"perceptron","hasAudioNarration":false,"actualSubdomain":"perceptron","customDomains":["docs.perceptron.inc"],"gitSource":{"type":"github","owner":"perceptron-ai-inc","repo":"mintlify_docs","deployBranch":"production","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ab61f6fc6fb6f41c7bf742a","collectionId":"47c4f240-aa64-46f0-a5e2-b4675a405dae","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ab61f6fc6fb6f41c7bf742a"},"entitlements":{},"buildId":"6ab61f6fc6fb6f41c7bf742a","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Docs","count":68},{"language":"default","tag":"Capabilities","count":29},{"language":"default","tag":"Developer Guides","count":23},{"language":"default","tag":"API reference","count":20},{"language":"default","tag":"Image","count":12},{"language":"default","tag":"Python SDK","count":12},{"language":"default","tag":"Video","count":8},{"language":"default","tag":"Best practices","count":6},{"language":"default","tag":"Scaling \u0026 deployment","count":6},{"language":"default","tag":"Models","count":6}]},"assistantConfig":{"enableStarterQuestions":false},"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":"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":"byok-sep-25","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":"billing-updated-9-15","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}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"@font-face{font-family:\"ABCArizonaFlare\";font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/ABCArizonaFlare/ABCArizonaFlare-Regular-Trial.woff2) format(\"woff2\")}#page-title,.api-endpoint h3,.api-section h2,.mdx-content h1,.mdx-content h2,.page-title{font-family:\"ABCArizonaFlare\";font-weight:400}.h-5,h5{text-transform:uppercase;font-size:.85rem}"}],"page":{"pagePath":"perceptron-mk1/api-reference/endpoint/chat-completions","slug":"/perceptron-mk1/api-reference/endpoint/chat-completions","pageMetadata":{"title":"Chat Completions","icon":"terminal","openapi":"api-reference/openapi.json POST /v1/chat/completions","description":"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.","href":"/perceptron-mk1/api-reference/endpoint/chat-completions"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Callout,CodeBlock,Heading,Table}=_components;if(!Callout)_missingMdxReference(`Callout`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(_components.p,{children:`The Chat Completions API uses OpenAI-compatible request and response formats, with model-specific capabilities and limits. Use it to generate text-only and multimodal responses from Perceptron Mk1.`}),`\n`,_jsxs(_components.p,{children:[`Perceptron Mk1 triggers thinking and structured grounding through the typed `,_jsx(_components.code,{children:`vision_config`}),` body field.`]}),`\n`,_jsx(Callout,{type:`tip`,children:_jsxs(_components.p,{children:[`Asking several independent questions about the same image or video? Use `,_jsx(_components.a,{href:`/perceptron-mk1/api-reference/endpoint/multilook-chat-completions`,children:`Multilook`}),` to send up to 16 prompts over one shared context in a single request and pay for the context once.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`vision_config`,children:_jsx(_components.code,{children:`vision_config`})}),`\n`,_jsxs(_components.p,{children:[`For `,_jsx(_components.code,{children:`perceptron-mk1`}),`, pass a top-level `,_jsx(_components.code,{children:`vision_config`}),` object alongside `,_jsx(_components.code,{children:`messages`}),`:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Values`}),_jsx(_components.th,{children:`Purpose`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`annotation_format`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`\"point\"`}),` / `,_jsx(_components.code,{children:`\"box\"`}),` / `,_jsx(_components.code,{children:`\"polygon\"`}),` / `,_jsx(_components.code,{children:`\"clip\"`})]}),_jsxs(_components.td,{children:[`Grounded output format. `,_jsx(_components.code,{children:`clip`}),` is video-only.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`enable_thinking`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`true`}),` / `,_jsx(_components.code,{children:`false`})]}),_jsx(_components.td,{children:`Chain-of-thought reasoning.`})]})]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`when-to-enable_thinking`,children:[`When to `,_jsx(_components.code,{children:`enable_thinking`})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On`}),` for text Q\u0026A, captioning, OCR, and video clipping (`,_jsx(_components.code,{children:`annotation_format: \"clip\"`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Off`}),` for spatial detection (`,_jsx(_components.code,{children:`annotation_format`}),` in `,_jsx(_components.code,{children:`\"point\"`}),`, `,_jsx(_components.code,{children:`\"box\"`}),`, `,_jsx(_components.code,{children:`\"polygon\"`}),`).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`example-grounded-detection`,children:`Example: Grounded detection`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.perceptron.inc/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PERCEPTRON_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"perceptron-mk1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"image_url\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_url\": { \"url\": \"\u003cimage-url>\" } },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"text\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": \"Find every worker wearing PPE.\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vision_config\": { \"annotation_format\": \"box\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`example-video-clipping`,children:`Example: Video clipping`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.perceptron.inc/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PERCEPTRON_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"perceptron-mk1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"video_url\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"video_url\": { \"url\": \"\u003cvideo-url>\" } },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"text\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": \"Clip the moment the worker scans the package.\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vision_config\": { \"annotation_format\": \"clip\", \"enable_thinking\": true }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`example-video-from-pre-decoded-frames`,children:`Example: Video from pre-decoded frames`}),`\n`,_jsxs(_components.p,{children:[`If you’ve already sampled frames client-side, pass them inline with a `,_jsx(_components.code,{children:`video_frames`}),` content part instead of a single `,_jsx(_components.code,{children:`video_url`}),`. Each frame carries an `,_jsx(_components.code,{children:`image_url`}),` (HTTP(S) URL or base64 data URL) and a `,_jsx(_components.code,{children:`timestamp_ms`}),` offset from the start of the clip. Provide between two and 256 frames, ordered by non-decreasing `,_jsx(_components.code,{children:`timestamp_ms`}),`. For optimal performance, follow a uniform sampling strategy aligned with the `,_jsx(_components.a,{href:`/perceptron-mk1/guides/tokenization#video-token-counting`,children:`Video Token Counting`}),` guide.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.perceptron.inc/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PERCEPTRON_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"perceptron-mk1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"video_frames\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"video_frames\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"frames\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"image_url\": { \"url\": \"\u003cframe-url>\" }, \"timestamp_ms\": 0 },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"image_url\": { \"url\": \"\u003cframe-url>\" }, \"timestamp_ms\": 500 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"text\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"text\": \"What changes between these frames?\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vision_config\": { \"enable_thinking\": true }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`streaming`,children:`Streaming`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`\"stream\": true`}),` to receive Server-Sent Events (SSE). Opt into token usage with `,_jsx(_components.code,{children:`stream_options.include_usage: true`}),`. Handle a trailing usage-only chunk with `,_jsx(_components.code,{children:`choices: []`}),` before `,_jsx(_components.code,{children:`data: [DONE]`}),`; do not assume usage arrives on the chunk carrying `,_jsx(_components.code,{children:`finish_reason`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Inspect `,_jsx(_components.code,{children:`finish_reason`}),`: `,_jsx(_components.code,{children:`stop`}),` means normal completion, while `,_jsx(_components.code,{children:`length`}),` means the output was cut off. Clients shared with tool-capable models must also handle `,_jsx(_components.code,{children:`tool_calls`}),`. Treat error events and interrupted streams as failures or incomplete output; `,_jsx(_components.code,{children:`[DONE]`}),` alone does not prove a successful answer.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.perceptron.inc/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$PERCEPTRON_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"perceptron-mk1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"image_url\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_url\": { \"url\": \"\u003cimage-url>\" } },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` { \"type\": \"text\", \"text\": \"Describe this scene in detail.\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"vision_config\": { \"enable_thinking\": true },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"stream\": true,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"stream_options\": { \"include_usage\": true }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Thinking pairs well with text and clipping; not with spatial detection.`}),` Turn `,_jsx(_components.code,{children:`enable_thinking`}),` on for text Q\u0026A, captioning, OCR, and `,_jsx(_components.code,{children:`annotation_format: \"clip\"`}),`. Turn it off for `,_jsx(_components.code,{children:`\"point\"`}),`, `,_jsx(_components.code,{children:`\"box\"`}),`, and `,_jsx(_components.code,{children:`\"polygon\"`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Leave `,_jsx(_components.code,{children:`temperature`}),` unset.`]}),` The default is `,_jsx(_components.code,{children:`0.0`}),` (deterministic). Only set a non-zero value if you want more varied outputs.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Image format`}),`: HTTP(S) URLs and base64 data URLs are both supported. MIME types: `,_jsx(_components.code,{children:`image/png`}),`, `,_jsx(_components.code,{children:`image/jpeg`}),`, `,_jsx(_components.code,{children:`image/webp`}),`, `,_jsx(_components.code,{children:`video/mp4`}),`, `,_jsx(_components.code,{children:`video/webm`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Inline frames vs. `,_jsx(_components.code,{children:`video_url`})]}),`: Send a whole clip with `,_jsx(_components.code,{children:`video_url`}),`, or — if you’ve already sampled frames — pass them inline with `,_jsx(_components.code,{children:`video_frames`}),` (two to 256 frames, `,_jsx(_components.code,{children:`timestamp_ms`}),` non-decreasing). Inline frames give you precise control over exactly which frames the model sees; for optimal performance, sample uniformly in line with the `,_jsx(_components.a,{href:`/perceptron-mk1/guides/tokenization#video-token-counting`,children:`Video Token Counting`}),` guide.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Token limits`}),`: 32K context, 8K output.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Many questions, one input`}),`: batch them with `,_jsx(_components.a,{href:`/perceptron-mk1/guides/multilook`,children:`Multilook`}),` instead of repeating the media on every call. The shared context is prefilled once, and reused tokens are billed at the cache-read rate.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Requests`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`300/min`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Request body size`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`20 MB`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Media upload`}),_jsx(_components.td,{children:`20 GB per 48 hours`})]})]})]}),`\n`,_jsx(Callout,{type:`tip`,children:_jsxs(_components.p,{children:[`For large images, resize client-side before uploading. See the `,_jsx(_components.a,{href:`/perceptron-mk1/guides/tokenization`,children:`Tokenization guide`}),` for optimization tips.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat Completions","icon":"terminal","openapi":"api-reference/openapi.json POST /v1/chat/completions","description":"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.","href":"/perceptron-mk1/api-reference/endpoint/chat-completions"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"vision_config","slug":"vision_config","depth":2,"children":[{"title":"When to enable_thinking","slug":"when-to-enable_thinking","depth":3,"children":[]},{"title":"Example: Grounded detection","slug":"example-grounded-detection","depth":3,"children":[]},{"title":"Example: Video clipping","slug":"example-video-clipping","depth":3,"children":[]},{"title":"Example: Video from pre-decoded frames","slug":"example-video-from-pre-decoded-frames","depth":3,"children":[]}]},{"title":"Streaming","slug":"streaming","depth":2,"children":[]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Chat Completions"],"summary":"Create chat completion","description":"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.","operationId":"handle_chat_completions","requestBody":"a19fca10-2f8b-4cb4-9c82-abf57ce6db29","responses":{"200":"20250965-fc9e-4e56-a152-bbbb05ec2bcd","400":"811cc39f-6093-41b2-bd6a-4e98cb9d842c","401":"0c954599-4338-46e6-83c0-4b3439a83f7f","429":"4126fa9a-e62e-477b-9b72-c221f2b74d20","500":"009566e3-7b0a-4fc6-b0dc-2e3533e5bf52","503":"b648b3ea-a2f5-4bbb-bddf-431f14b82cd4"},"security":["3d2a0ae9-bb10-4f72-b819-4d905a323f20"],"method":"post","type":"path","servers":["a4af1fc7-e5e1-406d-b6ec-6bcf35007984"],"path":"/v1/chat/completions","baseUrlOptions":["https://api.perceptron.inc"],"title":"Create chat completion","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["messages","model"],"properties":{"messages":{"type":"array","items":{"oneOf":[{"type":"object","title":"System","description":"Author role of the message: `system`, `developer`, `user`, `assistant`, or `tool`.","required":["role","content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Text","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","title":"Text","description":"Text chunk inside a structured message.","required":["type","text"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1.items.[INDEX]","typeLabel":"Text · object"},"title":"Content parts","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content.oneOf.1","typeLabel":"Text · object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.content","typeLabel":"string | Text · object[]"},"role":{"type":"string","enum":["system"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.0.role","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.0","typeLabel":"System · object"},{"type":"object","title":"Developer","description":"Author role of the message: `system`, `developer`, `user`, `assistant`, or `tool`.","required":["role","content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Text","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","title":"Text","description":"Text chunk inside a structured message.","required":["type","text"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1.items.[INDEX]","typeLabel":"Text · object"},"title":"Content parts","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content.oneOf.1","typeLabel":"Text · object[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.content","typeLabel":"string | Text · object[]"},"role":{"type":"string","enum":["developer"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.1.role","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.1","typeLabel":"Developer · object"},{"type":"object","title":"User","description":"Author role of the message: `system`, `developer`, `user`, `assistant`, or `tool`.","required":["role","content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Text","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Text","description":"Text chunk inside a structured message.","required":["type","text"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"Image URL","description":"Image content part containing a URL.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"Inline image reference (an HTTP(S) URL or a base64 data URL).","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","enum":["image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Image URL · object"},{"type":"object","title":"Video URL","description":"Video content part containing a URL.","required":["type","video_url"],"properties":{"video_url":{"type":"object","description":"Video asset referenced inside structured content arrays.","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.2.video_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.2.video_url","typeLabel":"object"},"type":{"type":"string","enum":["video_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"Video URL · object"},{"type":"object","title":"Video frames","description":"Content part carrying raw video frames the caller has already decoded, as an\nalternative to a single `video_url`.","required":["type","video_frames"],"properties":{"video_frames":{"type":"object","description":"An ordered sequence of decoded video frames passed inline.","required":["frames"],"properties":{"frames":{"type":"array","items":{"type":"object","description":"A single decoded video frame: an image (HTTP(S) URL or base64 data URL) plus\nits timestamp within the clip.","required":["image_url","timestamp_ms"],"properties":{"image_url":{"type":"object","description":"Inline image reference (an HTTP(S) URL or a base64 data URL).","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames.frames.items.[INDEX].image_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames.frames.items.[INDEX].image_url","typeLabel":"object"},"timestamp_ms":{"type":"integer","format":"int64","description":"Offset of this frame from the start of the clip, in milliseconds. Timestamps must\nbe non-negative and non-decreasing across the `frames` array.","minimum":0,"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames.frames.items.[INDEX].timestamp_ms","typeLabel":"integer\u003cint64>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames.frames.items.[INDEX]","typeLabel":"object"},"minItems":2,"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames.frames","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.video_frames","typeLabel":"object"},"type":{"type":"string","enum":["video_frames"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.3","typeLabel":"Video frames · object"},{"type":"object","title":"Image file ID","description":"Image content part referencing an uploaded file by id.","required":["type","image_file_id"],"properties":{"image_file_id":{"type":"object","description":"Reference to an uploaded image file by its id (e.g. `file-abc...`).","required":["file_id"],"properties":{"file_id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.4.image_file_id.file_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.4.image_file_id","typeLabel":"object"},"type":{"type":"string","enum":["image_file_id"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.4.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.4","typeLabel":"Image file ID · object"},{"type":"object","title":"Video file ID","description":"Video content part referencing an uploaded file by id.","required":["type","video_file_id"],"properties":{"video_file_id":{"type":"object","description":"Reference to an uploaded video file by its id (e.g. `file-abc...`).","required":["file_id"],"properties":{"file_id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.5.video_file_id.file_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.5.video_file_id","typeLabel":"object"},"type":{"type":"string","enum":["video_file_id"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.5.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.5","typeLabel":"Video file ID · object"},{"type":"object","title":"Input audio","description":"Audio content part carrying inline base64 audio.","required":["type","input_audio"],"properties":{"input_audio":{"type":"object","description":"Inline audio: the file bytes as base64 plus their encoding.","required":["data","format"],"properties":{"data":{"type":"string","description":"Raw audio file bytes, base64 encoded, without a `data:` URI prefix.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.6.input_audio.data","typeLabel":"string"},"format":{"type":"string","description":"Encoding of `data`: `wav`, `mp3`, or `flac`.","example":"wav","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.6.input_audio.format","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.6.input_audio","typeLabel":"object"},"type":{"type":"string","enum":["input_audio"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.6.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.6","typeLabel":"Input audio · object"},{"type":"object","title":"Audio URL","description":"Audio content part containing a URL.","required":["type","audio_url"],"properties":{"audio_url":{"type":"object","description":"Audio file reference (an HTTP(S) URL or a base64 data URL). Supported formats are WAV, MP3, and FLAC.","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.7.audio_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.7.audio_url","typeLabel":"object"},"type":{"type":"string","enum":["audio_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.7.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.7","typeLabel":"Audio URL · object"},{"type":"object","title":"Audio file ID","description":"Audio content part referencing an uploaded file by id.","required":["type","audio_file_id"],"properties":{"audio_file_id":{"type":"object","description":"Reference to an uploaded audio file by its id (e.g. `file-abc...`).","required":["file_id"],"properties":{"file_id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.8.audio_file_id.file_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.8.audio_file_id","typeLabel":"object"},"type":{"type":"string","enum":["audio_file_id"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.8.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX].oneOf.8","typeLabel":"Audio file ID · object"}],"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1.items.[INDEX]","typeLabel":"Text · object | Image URL · object | Video URL · object | Video frames · object | Image file ID · object | Video file ID · object | Input audio · object | Audio URL · object | Audio file ID · object"},"title":"Content parts","description":"Chat completion message content as either a string or structured content array.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content.oneOf.1","typeLabel":"(Text · object | Image URL · object | Video URL · object | Video frames · object | Image file ID · object | Video file ID · object | Input audio · object | Audio URL · object | Audio file ID · object)[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.content","typeLabel":"string | (Text · object | Image URL · object | Video URL · object | Video frames · object | Image file ID · object | Video file ID · object | Input audio · object | Audio URL · object | Audio file ID · object)[]"},"role":{"type":"string","enum":["user"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.2.role","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.2","typeLabel":"User · object"},{"type":"object","title":"Assistant","description":"Author role of the message: `system`, `developer`, `user`, `assistant`, or `tool`.","required":["role"],"properties":{"role":{"type":"string","enum":["assistant"],"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","title":"Text","description":"The text of the message. May be `null` or omitted when the message has `tool_calls`.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.1","typeLabel":"string"},{"type":"array","items":{"type":"object","title":"Text","description":"Text chunk inside a structured message.","required":["type","text"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2.items.[INDEX]","typeLabel":"Text · object"},"title":"Content parts","description":"The text of the message. May be `null` or omitted when the message has `tool_calls`.","uniqueKey":"messages.items.[INDEX].oneOf.3.content.oneOf.2","typeLabel":"Text · object[]"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.content","typeLabel":"null | string | Text · object[]"},"reasoning_content":{"oneOf":[{"type":"string","description":"The `reasoning_content` the model returned for this turn. Send it back with the turn's\n`tool_calls` so the model sees the reasoning it generated. Ignored on requests with neither\n`tools` nor tool calls or results in `messages`.","uniqueKey":"messages.items.[INDEX].oneOf.3.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The `reasoning_content` the model returned for this turn. Send it back with the turn's\n`tool_calls` so the model sees the reasoning it generated. Ignored on requests with neither\n`tools` nor tool calls or results in `messages`.","uniqueKey":"messages.items.[INDEX].oneOf.3.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.reasoning_content","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"A tool call the model made.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"A function the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments as the model generated them, meant to be JSON. They are not validated and\nmay be cut off when the response hit its token limit.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"},"id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The tool calls the model made in this turn. Requires a model that supports tool calling.","uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"A tool call the model made.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"A function the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments as the model generated them, meant to be JSON. They are not validated and\nmay be cut off when the response hit its token limit."},"name":{"type":"string"}}},"id":{"type":"string"},"type":{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"]}}},"description":"The tool calls the model made in this turn. Requires a model that supports tool calling.","uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"messages.items.[INDEX].oneOf.3.tool_calls","typeLabel":"object[] | null"}},"uniqueKey":"messages.items.[INDEX].oneOf.3","typeLabel":"Assistant · object"},{"type":"object","title":"Tool","description":"Author role of the message: `system`, `developer`, `user`, `assistant`, or `tool`.","required":["role","tool_call_id","content"],"properties":{"content":{"oneOf":[{"type":"string","title":"Text","description":"The result, as text or as `text`, `image_url` and `image_file_id` parts. Images count toward\nthe request's media limit and need a model that accepts image input.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"oneOf":[{"type":"object","title":"Text","description":"Text chunk inside a structured message.","required":["type","text"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.0.text","typeLabel":"string"},"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.0","typeLabel":"Text · object"},{"type":"object","title":"Image URL","description":"Image content part containing a URL.","required":["type","image_url"],"properties":{"image_url":{"type":"object","description":"Inline image reference (an HTTP(S) URL or a base64 data URL).","required":["url"],"properties":{"url":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.1.image_url","typeLabel":"object"},"type":{"type":"string","enum":["image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.1","typeLabel":"Image URL · object"},{"type":"object","title":"Image file ID","description":"Image content part referencing an uploaded file by id.","required":["type","image_file_id"],"properties":{"image_file_id":{"type":"object","description":"Reference to an uploaded image file by its id (e.g. `file-abc...`).","required":["file_id"],"properties":{"file_id":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.2.image_file_id.file_id","typeLabel":"string"}},"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.2.image_file_id","typeLabel":"object"},"type":{"type":"string","enum":["image_file_id"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX].oneOf.2","typeLabel":"Image file ID · object"}],"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1.items.[INDEX]","typeLabel":"Text · object | Image URL · object | Image file ID · object"},"title":"Content parts","description":"The result, as text or as `text`, `image_url` and `image_file_id` parts. Images count toward\nthe request's media limit and need a model that accepts image input.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content.oneOf.1","typeLabel":"(Text · object | Image URL · object | Image file ID · object)[]"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.content","typeLabel":"string | (Text · object | Image URL · object | Image file ID · object)[]"},"tool_call_id":{"type":"string","description":"The `id` of the tool call this message answers.","isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.tool_call_id","typeLabel":"string"},"role":{"type":"string","enum":["tool"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].oneOf.4.role","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].oneOf.4","typeLabel":"Tool · object"}],"uniqueKey":"messages.items.[INDEX]","typeLabel":"System · object | Developer · object | User · object | Assistant · object | Tool · object"},"description":"Conversation history listed in order. Supported roles: `system`, `developer` (treated as `system`),\n`user`, `assistant`, `tool`.","isRequired":true,"uniqueKey":"messages","typeLabel":"(System · object | Developer · object | User · object | Assistant · object | Tool · object)[]"},"model":{"type":"string","description":"The model to invoke. Use `GET /v1/models` to discover available model IDs. New Perceptron requests should use\n`perceptron-mk1.5`.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"frequency_penalty":{"oneOf":[{"type":"number","format":"float","description":"Positive values discourage the model from repeating previously used tokens.","maximum":2,"minimum":-2,"uniqueKey":"frequency_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Positive values discourage the model from repeating previously used tokens.","maximum":2,"minimum":-2,"uniqueKey":"frequency_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"frequency_penalty","typeLabel":"number\u003cfloat> | null"},"max_completion_tokens":{"oneOf":[{"type":"integer","format":"int32","description":"Maximum number of completion tokens to generate. Must fit within the selected model's context and output limits.","minimum":0,"uniqueKey":"max_completion_tokens.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"Maximum number of completion tokens to generate. Must fit within the selected model's context and output limits.","minimum":0,"uniqueKey":"max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_completion_tokens","typeLabel":"integer\u003cint32> | null"},"n":{"oneOf":[{"type":"integer","format":"int32","description":"Number of completions to generate. Only `1` is supported; greater values are rejected.","maximum":1,"minimum":1,"uniqueKey":"n.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"Number of completions to generate. Only `1` is supported; greater values are rejected.","maximum":1,"minimum":1,"uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer\u003cint32> | null"},"parallel_tool_calls":{"oneOf":[{"type":"boolean","description":"Whether the model may call several functions in one turn. Defaults to `true`. Ignored\nwithout functions in `tools`.","uniqueKey":"parallel_tool_calls.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the model may call several functions in one turn. Defaults to `true`. Ignored\nwithout functions in `tools`.","uniqueKey":"parallel_tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"parallel_tool_calls","typeLabel":"boolean | null"},"presence_penalty":{"oneOf":[{"type":"number","format":"float","description":"Positive values encourage the model to introduce new concepts.","maximum":2,"minimum":-2,"uniqueKey":"presence_penalty.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Positive values encourage the model to introduce new concepts.","maximum":2,"minimum":-2,"uniqueKey":"presence_penalty.oneOf.1","typeLabel":"null"}],"uniqueKey":"presence_penalty","typeLabel":"number\u003cfloat> | null"},"reasoning_effort":{"oneOf":[{"type":"null","uniqueKey":"reasoning_effort.oneOf.0","typeLabel":"null"},{"type":"string","description":"How much the model reasons before it answers: `none`, `minimal`, `low`, `medium` or `high`.\nA tier other than `none` turns reasoning on. `vision_config.enable_thinking`, when set,\ndecides whether the model reasons; the tier then only applies while reasoning is on.","enum":["none","minimal","low","medium","high"],"uniqueKey":"reasoning_effort.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"reasoning_effort","typeLabel":"null | enum\u003cstring>"},"regex":{"oneOf":[{"type":"string","description":"Regex pattern for constrained generation.","uniqueKey":"regex.oneOf.0","typeLabel":"string"},{"type":"null","description":"Regex pattern for constrained generation.","uniqueKey":"regex.oneOf.1","typeLabel":"null"}],"uniqueKey":"regex","typeLabel":"string | null"},"response_format":{"oneOf":[{"type":"null","uniqueKey":"response_format.oneOf.0","typeLabel":"null"},{"type":"object","description":"An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs\nwhich ensures the model will match your supplied JSON schema.","required":["type"],"properties":{"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.1","typeLabel":"object"},{"type":"object","description":"An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs\nwhich ensures the model will match your supplied JSON schema.","required":["json_schema","type"],"properties":{"json_schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema.name","typeLabel":"string"},"schema":{"oneOf":[{}],"uniqueKey":"response_format.oneOf.2.json_schema.schema","typeLabel":"any"},"strict":{"oneOf":[{"type":"boolean","description":"When true, the model output will strictly adhere to the provided schema.","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"When true, the model output will strictly adhere to the provided schema.","uniqueKey":"response_format.oneOf.2.json_schema.strict.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format.oneOf.2.json_schema.strict","typeLabel":"boolean | null"}},"isRequired":true,"uniqueKey":"response_format.oneOf.2.json_schema","typeLabel":"object"},"type":{"type":"string","enum":["json_schema"],"isRequired":true,"uniqueKey":"response_format.oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format.oneOf.2","typeLabel":"object"}],"uniqueKey":"response_format","typeLabel":"null · object · object"},"stream":{"oneOf":[{"type":"boolean","description":"Set to `true` for SSE streaming. When omitted, the API returns a single JSON response.","default":false,"uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Set to `true` for SSE streaming. When omitted, the API returns a single JSON response.","default":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":"Optional streaming flags. Token usage is always reported in the final chunk of a streaming response.","properties":{"include_usage":{"oneOf":[{"type":"boolean","description":"Include token usage metrics with streaming responses.","uniqueKey":"stream_options.oneOf.1.include_usage.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Include token usage metrics with streaming responses.","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":"Sampling temperature. Lower values yield deterministic replies; higher values explore more creative outputs.","maximum":2,"minimum":0,"uniqueKey":"temperature.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Sampling temperature. Lower values yield deterministic replies; higher values explore more creative outputs.","maximum":2,"minimum":0,"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","title":"Mode","description":"Whether the model may call the declared functions: `auto` (the default) or `none`. `none` is\nbest effort and does not guarantee a response without tool calls. Forcing a call (`required`\nor a named function) is not supported and is rejected with a 400. Ignored without functions\nin `tools`.","enum":["none","auto","required"],"uniqueKey":"tool_choice.oneOf.1","typeLabel":"enum\u003cstring>"},{"type":"object","title":"Named function","description":"Whether the model may call the declared functions: `auto` (the default) or `none`. `none` is\nbest effort and does not guarantee a response without tool calls. Forcing a call (`required`\nor a named function) is not supported and is rejected with a 400. Ignored without functions\nin `tools`.","required":["type","function"],"properties":{"function":{"type":"object","description":"The name of a function.","required":["name"],"properties":{"name":{"type":"string","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 a tool call or a named tool choice. Always `function`.","enum":["function"],"isRequired":true,"uniqueKey":"tool_choice.oneOf.2.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"tool_choice.oneOf.2","typeLabel":"Named function · object"}],"uniqueKey":"tool_choice","typeLabel":"null | enum\u003cstring> | Named function · object"},"tools":{"oneOf":[{"type":"array","items":{"type":"object","title":"Function","description":"A function the caller runs when the model calls it.","required":["function","type"],"properties":{"function":{"type":"object","description":"A function the model may call.","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].function.name","typeLabel":"string"},"description":{"oneOf":[{"type":"string","description":"What the function does, which the model uses to choose when and how to call it.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.0","typeLabel":"string"},{"type":"null","description":"What the function does, which the model uses to choose when and how to call it.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.description.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools.oneOf.0.items.[INDEX].function.description","typeLabel":"string | null"},"parameters":{"type":"object","description":"The arguments the function accepts, as a JSON Schema object. Kept exactly as sent, including\nthe order of its properties.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.parameters","typeLabel":"object"},"strict":{"oneOf":[{"type":"boolean","description":"Accepted but not enforced: the arguments the model generates are not checked against\n`parameters`.","uniqueKey":"tools.oneOf.0.items.[INDEX].function.strict.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Accepted but not enforced: the arguments the model generates are not checked against\n`parameters`.","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","enum":["function"],"isRequired":true,"uniqueKey":"tools.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"tools.oneOf.0.items.[INDEX]","typeLabel":"Function · object"},"description":"Functions the model may call and the caller executes. Cannot be combined with a\n`json_schema` `response_format` or `regex`.\n\nFunctions require a model that supports tool calling: other models reject them, and tool\ncalls or results in `messages`, with a 400. Generation stops at the first turn that calls\nfunctions, so a response carries at most one turn of `tool_calls`.","uniqueKey":"tools.oneOf.0","typeLabel":"Function · object[]"},{"type":"null","items":{"type":"object","title":"Function","description":"A function the caller runs when the model calls it.","required":["function","type"],"properties":{"function":{"type":"object","description":"A function the model may call.","required":["name"],"properties":{"description":{"oneOf":[{"type":"string","description":"What the function does, which the model uses to choose when and how to call it."},{"type":"null","description":"What the function does, which the model uses to choose when and how to call it."}]},"name":{"type":"string"},"parameters":{"type":"object","description":"The arguments the function accepts, as a JSON Schema object. Kept exactly as sent, including\nthe order of its properties."},"strict":{"oneOf":[{"type":"boolean","description":"Accepted but not enforced: the arguments the model generates are not checked against\n`parameters`."},{"type":"null","description":"Accepted but not enforced: the arguments the model generates are not checked against\n`parameters`."}]}}},"type":{"type":"string","enum":["function"]}}},"description":"Functions the model may call and the caller executes. Cannot be combined with a\n`json_schema` `response_format` or `regex`.\n\nFunctions require a model that supports tool calling: other models reject them, and tool\ncalls or results in `messages`, with a 400. Generation stops at the first turn that calls\nfunctions, so a response carries at most one turn of `tool_calls`.","uniqueKey":"tools.oneOf.1","typeLabel":"null"}],"uniqueKey":"tools","typeLabel":"Function · object[] | null"},"top_k":{"oneOf":[{"type":"integer","format":"int32","description":"Top-k sampling. The model samples from the top k most likely tokens.","minimum":0,"uniqueKey":"top_k.oneOf.0","typeLabel":"integer\u003cint32>"},{"type":"null","format":"int32","description":"Top-k sampling. The model samples from the top k most likely tokens.","minimum":0,"uniqueKey":"top_k.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_k","typeLabel":"integer\u003cint32> | null"},"top_p":{"oneOf":[{"type":"number","format":"float","description":"Nucleus sampling probability. The model samples from the smallest token set whose cumulative probability exceeds this threshold.","maximum":1,"exclusiveMinimum":0,"uniqueKey":"top_p.oneOf.0","typeLabel":"number\u003cfloat>"},{"type":"null","format":"float","description":"Nucleus sampling probability. The model samples from the smallest token set whose cumulative probability exceeds this threshold.","maximum":1,"exclusiveMinimum":0,"uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number\u003cfloat> | null"},"vision_config":{"oneOf":[{"type":"null","uniqueKey":"vision_config.oneOf.0","typeLabel":"null"},{"type":"object","description":"Perceptron vision-model controls (thinking, spatial output format,\nvideo audio). Only supported on Perceptron-owned models.","properties":{"annotation_format":{"oneOf":[{"type":"null","uniqueKey":"vision_config.oneOf.1.annotation_format.oneOf.0","typeLabel":"null"},{"type":"string","description":"Annotation format the model should emit (`point`, `box`, `polygon`, or `clip`).","enum":["point","box","polygon","clip"],"uniqueKey":"vision_config.oneOf.1.annotation_format.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"vision_config.oneOf.1.annotation_format","typeLabel":"null | enum\u003cstring>"},"enable_audio_in_video":{"oneOf":[{"type":"boolean","description":"When true, the audio track of each video in the request is analyzed along with its frames.\nDefaults to false. A video without an audio track is processed as video only. Audio content\nparts are analyzed regardless of this setting.","uniqueKey":"vision_config.oneOf.1.enable_audio_in_video.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"When true, the audio track of each video in the request is analyzed along with its frames.\nDefaults to false. A video without an audio track is processed as video only. Audio content\nparts are analyzed regardless of this setting.","uniqueKey":"vision_config.oneOf.1.enable_audio_in_video.oneOf.1","typeLabel":"null"}],"uniqueKey":"vision_config.oneOf.1.enable_audio_in_video","typeLabel":"boolean | null"},"enable_thinking":{"oneOf":[{"type":"boolean","description":"Deprecated: use the top-level `reasoning_effort`. When set, this flag decides whether the\nmodel reasons and the tier only applies while reasoning is on.","deprecated":true,"uniqueKey":"vision_config.oneOf.1.enable_thinking.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Deprecated: use the top-level `reasoning_effort`. When set, this flag decides whether the\nmodel reasons and the tier only applies while reasoning is on.","deprecated":true,"uniqueKey":"vision_config.oneOf.1.enable_thinking.oneOf.1","typeLabel":"null"}],"uniqueKey":"vision_config.oneOf.1.enable_thinking","typeLabel":"boolean | null"}},"uniqueKey":"vision_config.oneOf.1","typeLabel":"object"}],"uniqueKey":"vision_config","typeLabel":"null | object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"messages":[{"content":"\u003cstring>","role":"system"}],"model":"\u003cstring>","frequency_penalty":0,"max_completion_tokens":1,"n":1,"parallel_tool_calls":true,"presence_penalty":0,"regex":"\u003cstring>","response_format":{"type":"text"},"stream":false,"stream_options":{"include_usage":true},"temperature":1,"tools":[{"function":{"name":"\u003cstring>","description":"\u003cstring>","parameters":{},"strict":true},"type":"function"}],"top_k":1,"top_p":0,"vision_config":{"enable_audio_in_video":true,"enable_thinking":true}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"20250965-fc9e-4e56-a152-bbbb05ec2bcd":{"description":"Chat completion generated successfully.","content":{"application/json":{"schema":{"type":"object","description":"Non-streaming response body when `stream=false`.","required":["id","choices","created","model","object"],"properties":{"choices":{"type":"array","items":{"type":"object","description":"Individual completion sampled by the model.","required":["index","message"],"properties":{"index":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer\u003cint32>"},"message":{"type":"object","description":"Message object returned in the assistant's response.","required":["content","role"],"properties":{"content":{"oneOf":[{"type":"string","description":"The text of the message, `null` when there is none (for example when the model only\ncalled tools).","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","description":"The text of the message, `null` when there is none (for example when the model only\ncalled tools).","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"},"role":{"type":"string","enum":["system","user","assistant"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"reasoning_content":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.reasoning_content","typeLabel":"string | null"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"A tool call the model made.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"A function the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments as the model generated them, meant to be JSON. They are not validated and\nmay be cut off when the response hit its token limit.","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.arguments","typeLabel":"string"},"name":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function.name","typeLabel":"string"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"object"},"id":{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"description":"The tool calls the model made.","uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"A tool call the model made.","required":["id","type","function"],"properties":{"function":{"type":"object","description":"A function the model called.","required":["name","arguments"],"properties":{"arguments":{"type":"string","description":"The arguments as the model generated them, meant to be JSON. They are not validated and\nmay be cut off when the response hit its token limit."},"name":{"type":"string"}}},"id":{"type":"string"},"type":{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"]}}},"description":"The tool calls the model made.","uniqueKey":"choices.items.[INDEX].message.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.tool_calls","typeLabel":"object[] | null"}},"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"null"},{"type":"string","enum":["stop","length","tool_calls","tool_error","tool_limit","interrupted"],"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"null | enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"created":{"type":"integer","format":"int64","minimum":0,"isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"object":{"type":"string","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"usage":{"oneOf":[{"type":"null","uniqueKey":"usage.oneOf.0","typeLabel":"null"},{"type":"object","description":"Token accounting emitted with every completion.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"completion_tokens":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.completion_tokens","typeLabel":"integer\u003cint32>"},"prompt_tokens":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens","typeLabel":"integer\u003cint32>"},"total_tokens":{"type":"integer","format":"int32","minimum":0,"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":"Present when the model reports a per-modality breakdown.","required":["audio_tokens"],"properties":{"audio_tokens":{"type":"integer","format":"int32","description":"Prompt tokens produced from audio input: audio content parts and, when\n`vision_config.enable_audio_in_video` is set, video soundtracks. `0` means no audio was\nanalyzed, including when an opted-in video has no usable soundtrack.","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.1.audio_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":1,"message":{"content":"\u003cstring>","role":"system","reasoning_content":"\u003cstring>","tool_calls":[{"function":{"arguments":"\u003cstring>","name":"\u003cstring>"},"id":"\u003cstring>","type":"function"}]},"finish_reason":"stop"}],"created":1,"id":"\u003cstring>","model":"\u003cstring>","object":"\u003cstring>","usage":{"completion_tokens":1,"prompt_tokens":1,"total_tokens":1,"prompt_tokens_details":{"audio_tokens":1}}}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"object","description":"SSE response payload when `stream=true`.","required":["id","choices","created","model","object"],"properties":{"choices":{"type":"array","items":{"type":"object","description":"Streaming choice emitted per SSE chunk.","required":["index"],"properties":{"index":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer\u003cint32>"},"delta":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.0","typeLabel":"null"},{"type":"object","description":"Delta payload for streaming responses.","properties":{"content":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.content","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.reasoning_content","typeLabel":"string | null"},"role":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.role.oneOf.0","typeLabel":"null"},{"type":"string","enum":["system","user","assistant"],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.role.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.role","typeLabel":"null | enum\u003cstring>"},"tool_calls":{"oneOf":[{"type":"array","items":{"type":"object","description":"A streamed piece of a tool call. The first piece for an `index` carries the call's `id`,\n`type` and `function.name`; later pieces carry only `function.arguments`, to be appended.","required":["index"],"properties":{"index":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].index","typeLabel":"integer\u003cint32>"},"function":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.0","typeLabel":"null"},{"type":"object","description":"A streamed piece of a function call. Concatenate the `arguments` of every piece with the same\n`index`.","properties":{"arguments":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.arguments.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.arguments.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.arguments","typeLabel":"string | null"},"name":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.name.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.name.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1.name","typeLabel":"string | null"}},"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function.oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].function","typeLabel":"null | object"},"id":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].id.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].id.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].id","typeLabel":"string | null"},"type":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].type.oneOf.0","typeLabel":"null"},{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].type.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX].type","typeLabel":"null | enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","description":"A streamed piece of a tool call. The first piece for an `index` carries the call's `id`,\n`type` and `function.name`; later pieces carry only `function.arguments`, to be appended.","required":["index"],"properties":{"function":{"oneOf":[{"type":"null"},{"type":"object","description":"A streamed piece of a function call. Concatenate the `arguments` of every piece with the same\n`index`.","properties":{"arguments":{"oneOf":[{"type":"string"},{"type":"null"}]},"name":{"oneOf":[{"type":"string"},{"type":"null"}]}}}]},"id":{"oneOf":[{"type":"string"},{"type":"null"}]},"index":{"type":"integer","format":"int32","minimum":0},"type":{"oneOf":[{"type":"null"},{"type":"string","description":"The type of a tool call or a named tool choice. Always `function`.","enum":["function"]}]}}},"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].delta.oneOf.1.tool_calls","typeLabel":"object[] | null"}},"uniqueKey":"choices.items.[INDEX].delta.oneOf.1","typeLabel":"object"}],"uniqueKey":"choices.items.[INDEX].delta","typeLabel":"null | object"},"finish_reason":{"oneOf":[{"type":"null","uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"null"},{"type":"string","enum":["stop","length","tool_calls","tool_error","tool_limit","interrupted"],"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"enum\u003cstring>"}],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"null | enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"created":{"type":"integer","format":"int64","minimum":0,"isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"object":{"type":"string","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"usage":{"oneOf":[{"type":"null","uniqueKey":"usage.oneOf.0","typeLabel":"null"},{"type":"object","description":"Token accounting emitted with every completion.","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"completion_tokens":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.completion_tokens","typeLabel":"integer\u003cint32>"},"prompt_tokens":{"type":"integer","format":"int32","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens","typeLabel":"integer\u003cint32>"},"total_tokens":{"type":"integer","format":"int32","minimum":0,"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":"Present when the model reports a per-modality breakdown.","required":["audio_tokens"],"properties":{"audio_tokens":{"type":"integer","format":"int32","description":"Prompt tokens produced from audio input: audio content parts and, when\n`vision_config.enable_audio_in_video` is set, video soundtracks. `0` means no audio was\nanalyzed, including when an opted-in video has no usable soundtrack.","minimum":0,"isRequired":true,"uniqueKey":"usage.oneOf.1.prompt_tokens_details.oneOf.1.audio_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":1,"delta":{"content":"\u003cstring>","reasoning_content":"\u003cstring>","role":"system","tool_calls":[{"index":1,"function":{"arguments":"\u003cstring>","name":"\u003cstring>"},"id":"\u003cstring>","type":"function"}]},"finish_reason":"stop"}],"created":1,"id":"\u003cstring>","model":"\u003cstring>","object":"\u003cstring>","usage":{"completion_tokens":1,"prompt_tokens":1,"total_tokens":1,"prompt_tokens_details":{"audio_tokens":1}}}}},"exampleType":"generated"}},"exampleType":"generated"},"811cc39f-6093-41b2-bd6a-4e98cb9d842c":{"description":"The request was invalid or could not be processed.","content":{"application/json":{"schema":{"type":"object","description":"OpenAI-compatible error response format.","required":["error"],"properties":{"error":{"type":"object","description":"OpenAI-compatible error detail.","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","uniqueKey":"error.type.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.type.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.type","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"audio_token_limit_exceeded":{"title":"audio_token_limit_exceeded","value":{"error":{"message":"Audio at messages[0].content[1] is 912.4 s (11405 audio tokens). This model accepts at most 8192 audio tokens per item (about 655 s). Audio is not truncated; shorten or split it.","type":"invalid_request_error","param":"messages[0].content[1].input_audio","code":"audio_token_limit_exceeded"}}},"tool_calling_not_supported":{"title":"tool_calling_not_supported","value":{"error":{"message":"Model 'perceptron-mk1' does not support tool calling","type":"invalid_request_error","param":"tools","code":"unsupported_parameter"}}},"unsupported_input":{"title":"unsupported_input","value":{"error":{"message":"Model 'test' does not support video input","type":"invalid_request_error","param":null,"code":null}}}},"exampleType":"examples"}},"exampleType":"examples"},"0c954599-4338-46e6-83c0-4b3439a83f7f":{"description":"Authentication failed. Invalid or missing API key.","content":{"application/json":{"schema":{"type":"object","description":"OpenAI-compatible error response format.","required":["error"],"properties":{"error":{"type":"object","description":"OpenAI-compatible error detail.","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","uniqueKey":"error.type.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.type.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.type","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Invalid API key","type":"authentication_error","param":null,"code":null}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Invalid API key","type":"authentication_error","param":null,"code":null}}}},"exampleType":"examples"}},"exampleType":"examples"},"4126fa9a-e62e-477b-9b72-c221f2b74d20":{"description":"Rate limit exceeded or quota exceeded. Too many requests or insufficient credits.","content":{"application/json":{"schema":{"type":"object","description":"OpenAI-compatible error response format.","required":["error"],"properties":{"error":{"type":"object","description":"OpenAI-compatible error detail.","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","uniqueKey":"error.type.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.type.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.type","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Organization rate limit exceeded (300 requests/minute). Please retry after 30 seconds.","type":"rate_limit_error","param":null,"code":"rate_limit_exceeded"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Organization rate limit exceeded (300 requests/minute). Please retry after 30 seconds.","type":"rate_limit_error","param":null,"code":"rate_limit_exceeded"}}}},"exampleType":"examples"}},"exampleType":"examples"},"009566e3-7b0a-4fc6-b0dc-2e3533e5bf52":{"description":"Internal server error while processing the request.","content":{"application/json":{"schema":{"type":"object","description":"OpenAI-compatible error response format.","required":["error"],"properties":{"error":{"type":"object","description":"OpenAI-compatible error detail.","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","uniqueKey":"error.type.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.type.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.type","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":null}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The server had an error while processing your request.","type":"server_error","param":null,"code":null}}}},"exampleType":"examples"}},"exampleType":"examples"},"b648b3ea-a2f5-4bbb-bddf-431f14b82cd4":{"description":"The model is temporarily overloaded and dropped the request before processing it. Retry after the number of seconds in the Retry-After header.","content":{"application/json":{"schema":{"type":"object","description":"OpenAI-compatible error response format.","required":["error"],"properties":{"error":{"type":"object","description":"OpenAI-compatible error detail.","required":["message"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"type":{"oneOf":[{"type":"string","uniqueKey":"error.type.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.type.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.type","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"The model is currently overloaded with other requests. Please retry after a short wait.","type":"server_error","param":null,"code":"model_overloaded"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The model is currently overloaded with other requests. Please retry after a short wait.","type":"server_error","param":null,"code":"model_overloaded"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"3d2a0ae9-bb10-4f72-b819-4d905a323f20":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication using your Perceptron API key","scopes":[]}}},"servers":{"a4af1fc7-e5e1-406d-b6ec-6bcf35007984":{"url":"https://api.perceptron.inc"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Bearer token authentication using your Perceptron API key","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer token authentication using your Perceptron API key","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKeyAuth","name":"Authorization"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"perceptron","siteName":"Perceptron Docs","title":"Chat Completions - Perceptron Docs","navMaps":{"firstHrefInVersion":{"Perceptron Mk1.5":{"href":"/perceptron-mk1.5","matchLevel":4},"Perceptron Mk1":{"href":"/perceptron-mk1/api-reference/endpoint/chat-completions","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-09-24T11:59:37.459Z","originalFileLocation":"perceptron-mk1/api-reference/endpoint/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Perceptron Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_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/perceptron/b-1oIqD5B-JgaDLb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat Completions - Perceptron Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Perceptron Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://perceptron.mintlify.app/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Chat+Completions\u0026amp;description=Generate+a+response+for+a+text+or+multimodal+conversation%2C+using+the+OpenAI+chat+completions+request+and+response+format.\u0026amp;theme=ceaeb19d1c5c0da2f2187829\u0026amp;signature=b36e815e1b4348233363cfc7d0d38120f8f7d555d866ebb5ace697ce6d9698a2\">\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 - Perceptron Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://perceptron.mintlify.app/_mintlify/api/og/v2?division=Documentation\u0026amp;title=Chat+Completions\u0026amp;description=Generate+a+response+for+a+text+or+multimodal+conversation%2C+using+the+OpenAI+chat+completions+request+and+response+format.\u0026amp;theme=ceaeb19d1c5c0da2f2187829\u0026amp;signature=b36e815e1b4348233363cfc7d0d38120f8f7d555d866ebb5ace697ce6d9698a2\">\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/perceptron/b-1oIqD5B-JgaDLb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Perceptron Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B63FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/perceptron-mk1/api-reference/endpoint/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.perceptron.inc/#organization\",\"name\":\"Perceptron Docs\",\"url\":\"https://docs.perceptron.inc\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/perceptron/CuyGah1e2BqRrsVm/logo/perceptron-full-logo-light.svg?fit=max\u0026auto=format\u0026n=CuyGah1e2BqRrsVm\u0026q=85\u0026s=f5d2ffd0aaf71daba362f13fc9f7decf\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.perceptron.inc#website\",\"name\":\"Perceptron Docs\",\"url\":\"https://docs.perceptron.inc\",\"publisher\":{\"@id\":\"https://docs.perceptron.inc/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions#webpage\",\"url\":\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions\",\"name\":\"Chat Completions\",\"description\":\"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\",\"dateModified\":\"2026-09-24T11:59:37.459Z\",\"isPartOf\":{\"@id\":\"https://docs.perceptron.inc#website\"}},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions#apireference\",\"headline\":\"Chat Completions\",\"name\":\"Chat Completions\",\"description\":\"Generate a response for a text or multimodal conversation, using the OpenAI chat completions request and response format.\",\"url\":\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://docs.perceptron.inc/perceptron-mk1/api-reference/endpoint/chat-completions#webpage\"},\"dateModified\":\"2026-09-24T11:59:37.459Z\",\"publisher\":{\"@id\":\"https://docs.perceptron.inc/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.perceptron.inc#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Perceptron Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Perceptron Docs","nav":{"global":null,"versions":[{"version":"Perceptron Mk1.5","default":true,"tag":"Latest","pages":[{"title":"Perceptron Mk1.5","href":"/perceptron-mk1.5"}]},{"version":"Perceptron Mk1","tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/perceptron-mk1"}]},{"tab":"Models","pages":[{"title":"Models","href":"/perceptron-mk1/models"}]},{"tab":"API reference","pages":[{"title":"Chat Completions","icon":"terminal","openapi":"api-reference/openapi.json POST /v1/chat/completions","href":"/perceptron-mk1/api-reference/endpoint/chat-completions"},{"title":"Multilook Chat Completions","sidebarTitle":"Multilook","icon":"layer-group","openapi":"api-reference/openapi.json POST /v1/chat/completions/multilook","description":"Run several independent prompts over one shared, prefilled context.","href":"/perceptron-mk1/api-reference/endpoint/multilook-chat-completions"},{"title":"Detect","icon":"crosshairs","openapi":"api-reference/openapi.json POST /v1/detect","href":"/perceptron-mk1/api-reference/endpoint/detect"},{"title":"List Models","icon":"cube","openapi":"api-reference/openapi.json GET /v1/models","href":"/perceptron-mk1/api-reference/endpoint/list-models"},{"title":"Retrieve Model","icon":"cube","openapi":"api-reference/openapi.json GET /v1/models/{model_id}","href":"/perceptron-mk1/api-reference/endpoint/retrieve-model"},{"title":"Upload File","icon":"upload","openapi":"api-reference/openapi.json POST /v1/files","href":"/perceptron-mk1/api-reference/endpoint/upload-file"},{"title":"List Files","icon":"list","openapi":"api-reference/openapi.json GET /v1/files","href":"/perceptron-mk1/api-reference/endpoint/list-files"},{"title":"Retrieve File","icon":"file","openapi":"api-reference/openapi.json GET /v1/files/{file_id}","href":"/perceptron-mk1/api-reference/endpoint/retrieve-file"},{"title":"Retrieve File Content","icon":"download","openapi":"api-reference/openapi.json GET /v1/files/{file_id}/content","href":"/perceptron-mk1/api-reference/endpoint/retrieve-file-content"},{"title":"Delete File","icon":"trash","openapi":"api-reference/openapi.json DELETE /v1/files/{file_id}","href":"/perceptron-mk1/api-reference/endpoint/delete-file"}],"groups":[{"group":"Chat Completions","pages":[{"title":"Create chat completion","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-chat-completion"},{"title":"Create multilook chat completions","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/chat/completions/multilook","href":"/api-reference/chat-completions/create-multilook-chat-completions"}]},{"group":"Detection","pages":[{"title":"Detect objects","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/detect","href":"/api-reference/detection/detect-objects"}]},{"group":"Files","pages":[{"title":"List files","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/files","href":"/api-reference/files/list-files"},{"title":"Upload a file","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/files","href":"/api-reference/files/upload-a-file"},{"title":"Retrieve a file","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/files/{file_id}","href":"/api-reference/files/retrieve-a-file"},{"title":"Delete a file","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/files/{file_id}","href":"/api-reference/files/delete-a-file"},{"title":"Download a file's contents","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/files/{file_id}/content","href":"/api-reference/files/download-a-files-contents"}]},{"group":"Models","pages":[{"title":"List available models","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/models","href":"/api-reference/models/list-available-models"},{"title":"Retrieve a model","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/models/{model_id}","href":"/api-reference/models/retrieve-a-model"}]}]}]}]},"basePath":"","title":"Chat Completions - Perceptron Docs","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js","Markdown-BOgQCTwD.js","clsx-BIWXJmsZ.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DKZWslLH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-UDqbR6xh.js"]}