Theo implements the OpenAI Chat Completions wire protocol at POST /api/v1/chat/completions. Any application that uses the OpenAI SDK can point baseURL at https://www.hitheo.ai/api/v1, swap in a Theo API key, and keep working — the endpoint accepts the same { model, messages, stream, temperature, ... } shape and returns the same chat.completion / chat.completion.chunk objects.
The response shape is identical to OpenAI. The routing underneath is Theo — intent classification, model selection, and automatic failover. Pass model: "theo-1-auto" to let Theo pick the best engine per request.
Base URL
Use the canonical www host. The OpenAI SDK appends /chat/completions, so this base URL resolves to the real POST /api/v1/chat/completions route:
https://www.hitheo.ai/api/v1
Always use the www host. The apex https://hitheo.ai 307-redirects to www, and most HTTP clients strip the Authorization header across that redirect — the request arrives unauthenticated and returns 401.
Authentication
Uses the standard Bearer-token header. Your Theo API key replaces your OpenAI key.
Authorization: Bearer theo_sk_...
Drop-in Example (OpenAI SDK)
import OpenAI from "openai";const theo = new OpenAI({ apiKey: process.env.THEO_API_KEY, baseURL: "https://www.hitheo.ai/api/v1",});const res = await theo.chat.completions.create({ model: "theo-1-auto", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "Write me a haiku about Miami." }, ],});console.log(res.choices[0].message.content);
from openai import OpenAItheo = OpenAI( api_key=os.environ["THEO_API_KEY"], base_url="https://www.hitheo.ai/api/v1",)res = theo.chat.completions.create( model="theo-1-auto", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Write me a haiku about Miami."}, ],)print(res.choices[0].message.content)
curl -X POST https://www.hitheo.ai/api/v1/chat/completions \ -H "Authorization: Bearer $THEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "theo-1-auto", "messages": [ { "role": "user", "content": "Write me a haiku about Miami." } ] }'
Streaming
Set stream: true to receive an SSE stream of chat.completion.chunk objects terminated by data: [DONE], exactly as OpenAI does.
const stream = await theo.chat.completions.create({ model: "theo-1-auto", messages: [{ role: "user", content: "Stream me a short poem." }], stream: true,});for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? "");}
Supported model Values
Pass any Theo-branded model ID. theo-1-auto is recommended so Theo’s intent classifier picks the best engine per request; pass a specific engine if you want to pin the routing.
Model ID
Theo Mode
Best For
theo-1-auto
auto
Let Theo pick the right engine per prompt
theo-1-flash
fast
Quick responses, short chats, classification
theo-1-reason
think
Deep reasoning, analysis, planning
theo-1-code
code
Code generation and review
theo-1-create
image
Image generation
theo-1-motion
video
Video generation
theo-1-research
research
Multi-step web research with citations
theo-1-roast
roast
Unfiltered humor and sharp critique
theo-1-genui
genui
Generative UI components
theo-1-analyze
domain_analysis
Domain-specific analysis for business operations, finance, and compliance
theo-1-extract
data_extraction
OCR and structured data extraction
theo-1-vision
vision
Multimodal image analysis
Unknown model strings fall back to auto and Theo routes the request like any other prompt.
Request Body
The body is the standard OpenAI Chat Completion shape. Fields not listed below are accepted but ignored (e.g. top_p, n, max_tokens, user).
string
default:"theo-1-auto"
A Theo model ID. See the table above for valid values.
object[]
required
The conversation so far. Each message has { role, content }. Supported roles: system, user, assistant. tool messages are accepted but ignored (Theo owns tool-call state internally).The last user message is treated as the prompt. All system messages are merged into a single system prompt that overrides Theo’s default persona. Prior user/assistant turns are injected as conversation context.
boolean
default:"false"
When true, returns an SSE stream of chat.completion.chunk objects terminated by data: [DONE].
number
Sampling temperature (0–2).
string
OpenAI-style thinking control. none or minimal = answer directly; low, medium or high = think before answering. Theo also accepts reasoning: auto (default), on or off, which wins when both are sent. Applies to tool calls too.
string
Theo-specific. Attach this completion to an existing Theo conversation so its memory persists across channels. Omit to send a stateless request.
string[]
Theo-specific. Activate skills by slug for this request. Merged with the user’s installed skills.
object
Theo-specific. Arbitrary key-value data attached to the audit log.
Response
A standard OpenAI chat.completion (or chat.completion.chunk for streaming). Theo-specific metadata is returned under a theo_metadata extension so it doesn’t collide with existing OpenAI client expectations.
This endpoint runs the same per-key orchestration as the native endpoint: whatever you configured for the API key — the Orchestrator graph, model pins, Gateway Guardrails, Routing Studio preferences, the model allowlist, and the context-window guard — governs requests here too. So a key you shaped in the dashboard or via the MCP tools behaves identically whether you call it through the OpenAI SDK or the native API. Guardrails can deny (422), a model outside the key’s allowlist is rejected (403), and an oversize request returns 400 context_length_exceeded. Keys with no such configuration are unaffected — they route on Theo’s defaults exactly as before.
Errors
Returns the same error envelope as every other v1 endpoint:
{ "error": { "message": "Validation failed: messages must contain at least one message.", "type": "invalid_request_error", "code": "validation_error" }}
Status
Code
Description
400
validation_error
messages is missing, empty, or malformed
400
empty_prompt
messages contained only system/tool messages
400
context_length_exceeded
Request is larger than any model on the key can hold — add a larger-context model to the orchestrator or shorten the request
401
invalid_api_key
Missing or invalid Authorization: Bearer theo_sk_...
402
insufficient_credits
Account balance is too low for the pre-flight reservation
403
model_not_allowed
The request resolved to a model outside this key’s model allowlist
422
guardrail_violation
A Gateway Guardrails policy on this key denied the request
422
orchestrator_no_path
The key’s orchestrator graph couldn’t resolve a path for this request
{"docsConfig":{"theme":"sequoia","$schema":"https://mintlify.com/docs.json","name":"Theo API Docs","colors":{"primary":"#715eac","light":"#00eefd","dark":"#ff00aa"},"logo":"https://mintcdn.com/theoai/1GrRXquT3RmYCAKc/images/theo-logo-v1.png?fit=max\u0026auto=format\u0026n=1GrRXquT3RmYCAKc\u0026q=85\u0026s=8b015a7610e195426a8c23f5991cc4fd","favicon":"https://mintcdn.com/theoai/e1gmlMTZO-f4Ir99/images/theo-icon-512px.png?fit=max\u0026auto=format\u0026n=e1gmlMTZO-f4Ir99\u0026q=85\u0026s=24571b1a570eb2a94af2b187ed34ebdd","appearance":{"default":"dark"},"background":{"decoration":"grid"},"navbar":{"links":[]},"search":{"prompt":"Search Theo docs..."},"seo":{"indexing":"all"},"fonts":{"family":"PT Sans","weight":300},"icons":{"library":"lucide"},"styling":{"eyebrows":"section","latex":true},"banner":{"content":"Welcome to Theo Docs — the AI orchestration API.","dismissible":true},"thumbnails":{"appearance":"dark"},"interaction":{"drilldown":true},"metadata":{"timestamp":false},"navigation":{"languages":[{"language":"en","default":true,"href":""},{"language":"es","href":"es/changelog"},{"language":"zh","href":"zh"},{"language":"zh-HK","href":"zh-HK"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"theoai","hasAudioNarration":false,"actualSubdomain":"theoai","customDomains":["docs.hitheo.ai"],"gitSource":{"type":"github","owner":"arihealthbird","repo":"hitheo","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10de369ffae5051c410436"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad0f075d7c9ed5c31aaab6d","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"en","tag":"API Reference","count":102},{"language":"zh-HK","tag":"API 參考","count":99},{"language":"zh","tag":"API 参考","count":99},{"language":"en","tag":"Documentation","count":66},{"language":"zh-HK","tag":"文檔","count":63},{"language":"zh","tag":"文档","count":63},{"language":"en","tag":"SDK","count":17},{"language":"en","tag":"SDK Reference","count":17},{"language":"en","tag":"Resources","count":16},{"language":"en","tag":"Embed Widgets","count":16},{"language":"zh-HK","tag":"資源","count":16},{"language":"zh-HK","tag":"SDK","count":16},{"language":"zh-HK","tag":"SDK 參考","count":16},{"language":"zh","tag":"资源","count":16},{"language":"zh","tag":"SDK","count":16},{"language":"zh","tag":"SDK 参考","count":16},{"language":"en","tag":"Guides","count":15},{"language":"zh-HK","tag":"嵌入式組件","count":15},{"language":"zh","tag":"嵌入式组件","count":15},{"language":"zh-HK","tag":"指南","count":14},{"language":"zh","tag":"指南","count":14},{"language":"en","tag":"Skills","count":11},{"language":"zh-HK","tag":"技能","count":11},{"language":"zh","tag":"技能","count":11},{"language":"en","tag":"Routing Studio","count":10},{"language":"zh-HK","tag":"Routing Studio","count":10},{"language":"zh","tag":"Routing Studio","count":10},{"language":"en","tag":"Webhooks","count":9},{"language":"zh-HK","tag":"Webhooks","count":9},{"language":"zh","tag":"Webhooks","count":9},{"language":"es","tag":"Documentación","count":1},{"language":"es","tag":"Registro de cambios","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"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":"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":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/completions/openai-compat","slug":"/api-reference/completions/openai-compat","pageMetadata":{"title":"OpenAI-Compatible Chat Completions","description":"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.","api":"POST /api/v1/chat/completions","href":"/api-reference/completions/openai-compat"},"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: \"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\"\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`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Note,ParamField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Theo implements the OpenAI Chat Completions wire protocol at `,_jsx(_components.code,{children:`POST /api/v1/chat/completions`}),`. Any application that uses the OpenAI SDK can point `,_jsx(_components.code,{children:`baseURL`}),` at `,_jsx(_components.code,{children:`https://www.hitheo.ai/api/v1`}),`, swap in a Theo API key, and keep working — the endpoint accepts the same `,_jsx(_components.code,{children:`{ model, messages, stream, temperature, ... }`}),` shape and returns the same `,_jsx(_components.code,{children:`chat.completion`}),` / `,_jsx(_components.code,{children:`chat.completion.chunk`}),` objects.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`response shape`}),` is identical to OpenAI. The `,_jsx(_components.strong,{children:`routing`}),` underneath is Theo — intent classification, model selection, and automatic failover. Pass `,_jsx(_components.code,{children:`model: \"theo-1-auto\"`}),` to let Theo pick the best engine per request.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`base-url`,children:`Base URL`}),`\n`,_jsxs(_components.p,{children:[`Use the canonical `,_jsx(_components.code,{children:`www`}),` host. The OpenAI SDK appends `,_jsx(_components.code,{children:`/chat/completions`}),`, so this base URL resolves to the real `,_jsx(_components.code,{children:`POST /api/v1/chat/completions`}),` route:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://www.hitheo.ai/api/v1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Always use the `,_jsx(_components.code,{children:`www`}),` host. The apex `,_jsx(_components.code,{children:`https://hitheo.ai`}),` 307-redirects to `,_jsx(_components.code,{children:`www`}),`, and most HTTP clients strip the `,_jsx(_components.code,{children:`Authorization`}),` header across that redirect — the request arrives unauthenticated and returns `,_jsx(_components.code,{children:`401`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`Uses the standard Bearer-token header. Your Theo API key replaces your OpenAI key.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,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:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Bearer`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` theo_sk_...`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`drop-in-example-openai-sdk`,children:`Drop-in Example (OpenAI SDK)`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`16`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` theo`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` OpenAI`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`THEO_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseURL:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://www.hitheo.ai/api/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` theo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"theo-1-auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a helpful assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Write me a haiku about Miami.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`16`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`theo `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"THEO_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://www.hitheo.ai/api/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`res `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` theo.chat.completions.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"theo-1-auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"system\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Write me a haiku about Miami.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(res.choices[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].message.content)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`curl`,numberOfLines:`9`,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:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://www.hitheo.ai/api/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:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$THEO_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:` -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:` -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\": \"theo-1-auto\",`})}),`\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\", \"content\": \"Write me a haiku about Miami.\" }`})}),`\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`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`streaming`,children:`Streaming`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`stream: true`}),` to receive an SSE stream of `,_jsx(_components.code,{children:`chat.completion.chunk`}),` objects terminated by `,_jsx(_components.code,{children:`data: [DONE]`}),`, exactly as OpenAI does.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`typescript`,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:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` stream`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` theo`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`completions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"theo-1-auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Stream me a short poem.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stream:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` chunk`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stream`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`stdout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`write`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`chunk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`choices`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`delta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`2`,id:`supported-model-values`,children:[`Supported `,_jsx(_components.code,{children:`model`}),` Values`]}),`\n`,_jsxs(_components.p,{children:[`Pass any Theo-branded model ID. `,_jsx(_components.code,{children:`theo-1-auto`}),` is recommended so Theo’s intent classifier picks the best engine per request; pass a specific engine if you want to pin the routing.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model ID`}),_jsx(_components.th,{children:`Theo Mode`}),_jsx(_components.th,{children:`Best For`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-auto`})}),_jsx(_components.td,{children:`auto`}),_jsx(_components.td,{children:`Let Theo pick the right engine per prompt`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-flash`})}),_jsx(_components.td,{children:`fast`}),_jsx(_components.td,{children:`Quick responses, short chats, classification`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-reason`})}),_jsx(_components.td,{children:`think`}),_jsx(_components.td,{children:`Deep reasoning, analysis, planning`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-code`})}),_jsx(_components.td,{children:`code`}),_jsx(_components.td,{children:`Code generation and review`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-create`})}),_jsx(_components.td,{children:`image`}),_jsx(_components.td,{children:`Image generation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-motion`})}),_jsx(_components.td,{children:`video`}),_jsx(_components.td,{children:`Video generation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-research`})}),_jsx(_components.td,{children:`research`}),_jsx(_components.td,{children:`Multi-step web research with citations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-roast`})}),_jsx(_components.td,{children:`roast`}),_jsx(_components.td,{children:`Unfiltered humor and sharp critique`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-genui`})}),_jsx(_components.td,{children:`genui`}),_jsx(_components.td,{children:`Generative UI components`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-analyze`})}),_jsx(_components.td,{children:`domain_analysis`}),_jsx(_components.td,{children:`Domain-specific analysis for business operations, finance, and compliance`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-extract`})}),_jsx(_components.td,{children:`data_extraction`}),_jsx(_components.td,{children:`OCR and structured data extraction`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`theo-1-vision`})}),_jsx(_components.td,{children:`vision`}),_jsx(_components.td,{children:`Multimodal image analysis`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Unknown model strings fall back to `,_jsx(_components.code,{children:`auto`}),` and Theo routes the request like any other prompt.`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(_components.p,{children:[`The body is the standard OpenAI Chat Completion shape. Fields not listed below are accepted but ignored (e.g. `,_jsx(_components.code,{children:`top_p`}),`, `,_jsx(_components.code,{children:`n`}),`, `,_jsx(_components.code,{children:`max_tokens`}),`, `,_jsx(_components.code,{children:`user`}),`).`]}),`\n`,_jsx(ParamField,{body:`model`,type:`string`,default:`theo-1-auto`,id:`param-model`,children:_jsx(_components.p,{children:`A Theo model ID. See the table above for valid values.`})}),`\n`,_jsxs(ParamField,{body:`messages`,type:`object[]`,required:true,id:`param-messages`,children:[_jsxs(_components.p,{children:[`The conversation so far. Each message has `,_jsx(_components.code,{children:`{ role, content }`}),`. Supported roles: `,_jsx(_components.code,{children:`system`}),`, `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`assistant`}),`. `,_jsx(_components.code,{children:`tool`}),` messages are accepted but ignored (Theo owns tool-call state internally).`]}),_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`last user message`}),` is treated as the prompt. All `,_jsx(_components.code,{children:`system`}),` messages are merged into a single system prompt that overrides Theo’s default persona. Prior user/assistant turns are injected as conversation context.`]})]}),`\n`,_jsx(ParamField,{body:`stream`,type:`boolean`,default:`false`,id:`param-stream`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`true`}),`, returns an SSE stream of `,_jsx(_components.code,{children:`chat.completion.chunk`}),` objects terminated by `,_jsx(_components.code,{children:`data: [DONE]`}),`.`]})}),`\n`,_jsx(ParamField,{body:`temperature`,type:`number`,id:`param-temperature`,children:_jsx(_components.p,{children:`Sampling temperature (0–2).`})}),`\n`,_jsx(ParamField,{body:`reasoning_effort`,type:`string`,id:`param-reasoning-effort`,children:_jsxs(_components.p,{children:[`OpenAI-style thinking control. `,_jsx(_components.code,{children:`none`}),` or `,_jsx(_components.code,{children:`minimal`}),` = answer directly; `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),` or `,_jsx(_components.code,{children:`high`}),` = think before answering. Theo also accepts `,_jsx(_components.code,{children:`reasoning`}),`: `,_jsx(_components.code,{children:`auto`}),` (default), `,_jsx(_components.code,{children:`on`}),` or `,_jsx(_components.code,{children:`off`}),`, which wins when both are sent. Applies to tool calls too.`]})}),`\n`,_jsx(ParamField,{body:`conversation_id`,type:`string`,id:`param-conversation-id`,children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Theo-specific.`}),` Attach this completion to an existing Theo conversation so its memory persists across channels. Omit to send a stateless request.`]})}),`\n`,_jsx(ParamField,{body:`skills`,type:`string[]`,id:`param-skills`,children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Theo-specific.`}),` Activate skills by slug for this request. Merged with the user’s installed skills.`]})}),`\n`,_jsx(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Theo-specific.`}),` Arbitrary key-value data attached to the audit log.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`A standard OpenAI `,_jsx(_components.code,{children:`chat.completion`}),` (or `,_jsx(_components.code,{children:`chat.completion.chunk`}),` for streaming). Theo-specific metadata is returned under a `,_jsx(_components.code,{children:`theo_metadata`}),` extension so it doesn’t collide with existing OpenAI client expectations.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`25`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chatcmpl_...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"chat.completion\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1715872800`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"theo-1-flash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"choices\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Neon waves on sand...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finish_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`24`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`38`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"total_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`62`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"theo_metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auto\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"resolved_mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"fast\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tools_used\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"artifacts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"engine\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"theo-core\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`2`,id:`when-to-use-/v1/completions-instead`,children:[`When to use `,_jsx(_components.code,{children:`/v1/completions`}),` instead`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You need a `,_jsx(_components.strong,{children:`single-turn prompt`}),` string instead of a message array.`]}),`\n`,_jsxs(_components.li,{children:[`You want the richer `,_jsx(_components.strong,{children:`native Theo response`}),` (follow-ups, artifacts, tool traces) instead of the OpenAI shape.`]}),`\n`,_jsxs(_components.li,{children:[`You want to control `,_jsx(_components.code,{children:`persona`}),` or `,_jsx(_components.code,{children:`response_style`}),` per request.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/api-reference/completions/create`,children:`Create Completion`}),` for the native endpoint.`]}),`\n`,_jsx(Heading,{level:`2`,id:`per-key-orchestration-applies`,children:`Per-key orchestration applies`}),`\n`,_jsxs(_components.p,{children:[`This endpoint runs the `,_jsx(_components.strong,{children:`same per-key orchestration`}),` as the native endpoint: whatever you configured for the API key — the `,_jsx(_components.a,{href:`/dashboard/orchestrator`,children:`Orchestrator graph`}),`, model pins, `,_jsx(_components.a,{href:`/guides/guardrails`,children:`Gateway Guardrails`}),`, `,_jsx(_components.a,{href:`/core-concepts/model-routing`,children:`Routing Studio`}),` preferences, the model allowlist, and the `,_jsx(_components.a,{href:`/api-reference/completions/openai-compat#errors`,children:`context-window guard`}),` — governs requests here too. So a key you shaped in the dashboard or via the `,_jsx(_components.a,{href:`/mcp/tools`,children:`MCP tools`}),` behaves identically whether you call it through the OpenAI SDK or the native API. Guardrails can deny (`,_jsx(_components.code,{children:`422`}),`), a model outside the key’s allowlist is rejected (`,_jsx(_components.code,{children:`403`}),`), and an oversize request returns `,_jsx(_components.code,{children:`400 context_length_exceeded`}),`. Keys with no such configuration are unaffected — they route on Theo’s defaults exactly as before.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsx(_components.p,{children:`Returns the same error envelope as every other v1 endpoint:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Validation failed: messages must contain at least one message.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"invalid_request_error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"validation_error\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`validation_error`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`messages`}),` is missing, empty, or malformed`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`empty_prompt`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`messages`}),` contained only system/tool messages`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`context_length_exceeded`})}),_jsx(_components.td,{children:`Request is larger than any model on the key can hold — add a larger-context model to the orchestrator or shorten the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_api_key`})}),_jsxs(_components.td,{children:[`Missing or invalid `,_jsx(_components.code,{children:`Authorization: Bearer theo_sk_...`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`402`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`insufficient_credits`})}),_jsx(_components.td,{children:`Account balance is too low for the pre-flight reservation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`403`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`model_not_allowed`})}),_jsx(_components.td,{children:`The request resolved to a model outside this key’s model allowlist`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`guardrail_violation`})}),_jsx(_components.td,{children:`A Gateway Guardrails policy on this key denied the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`422`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`orchestrator_no_path`})}),_jsx(_components.td,{children:`The key’s orchestrator graph couldn’t resolve a path for this request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`not_found`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`conversation_id`}),` not found`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`rate_limit_exceeded`})}),_jsxs(_components.td,{children:[`Check `,_jsx(_components.code,{children:`Retry-After`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`500`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`server_error`})}),_jsx(_components.td,{children:`Internal error`})]})]})]})]})}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":"OpenAI-Compatible Chat Completions","description":"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.","api":"POST /api/v1/chat/completions","href":"/api-reference/completions/openai-compat"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Base URL","slug":"base-url","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Drop-in Example (OpenAI SDK)","slug":"drop-in-example-openai-sdk","depth":2,"children":[]},{"title":"Streaming","slug":"streaming","depth":2,"children":[]},{"title":"Supported model Values","slug":"supported-model-values","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"When to use /v1/completions instead","slug":"when-to-use-/v1/completions-instead","depth":2,"children":[]},{"title":"Per-key orchestration applies","slug":"per-key-orchestration-applies","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"OpenAI-Compatible Chat Completions","path":"/api/v1/chat/completions","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"model":[{"type":"string","description":"A Theo model ID. See the table above for valid values."}],"messages":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"The conversation so far. Each message has `{ role, content }` . Supported roles: `system` , `user` , `assistant` . `tool` messages are accepted but ignored (Theo owns tool-call state internally). The last user message is treated as the prompt. All `system` messages are merged into a single system prompt that overrides Theo’s default persona. Prior user/assistant turns are injected as conversation context.","required":true}],"stream":[{"type":"boolean","description":"When `true` , returns an SSE stream of `chat.completion.chunk` objects terminated by `data: [DONE]` ."}],"temperature":[{"type":"number","description":"Sampling temperature (0–2)."}],"reasoning_effort":[{"type":"string","description":"OpenAI-style thinking control. `none` or `minimal` = answer directly; `low` , `medium` or `high` = think before answering. Theo also accepts `reasoning` : `auto` (default), `on` or `off` , which wins when both are sent. Applies to tool calls too."}],"conversation_id":[{"type":"string","description":"Theo-specific. Attach this completion to an existing Theo conversation so its memory persists across channels. Omit to send a stateless request."}],"skills":[{"type":"array","items":[{"type":"string"}],"description":"Theo-specific. Activate skills by slug for this request. Merged with the user’s installed skills."}],"metadata":[{"type":"object","properties":{},"description":"Theo-specific. Arbitrary key-value data attached to the audit log."}]}}],"examples":{"example":{"value":{"model":"\u003cstring>","messages":[{}],"stream":true,"temperature":123,"reasoning_effort":"\u003cstring>","conversation_id":"\u003cstring>","skills":["\u003cstring>"],"metadata":{}}}}}}},"response":{},"deprecated":false}},"jsLinks":[],"subdomain":"theoai","siteName":"Theo API Docs","title":"OpenAI-Compatible Chat Completions - Theo API Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api-reference/completions/openai-compat","matchLevel":0},"es":{"href":"/es/changelog","matchLevel":4},"zh":{"href":"/zh/api-reference/completions/openai-compat","matchLevel":1},"zh-HK":{"href":"/zh-HK/api-reference/completions/openai-compat","matchLevel":1}}},"lastModified":"2026-10-15T15:26:06.822Z","originalFileLocation":"api-reference/completions/openai-compat.mdx","locale":"en"},"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=\"dark\"}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=\"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Theo API 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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_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/theoai/HMaTiOxhwLuEkGS5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"OpenAI-Compatible Chat Completions - Theo API Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Theo API Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hitheo.ai/api-reference/completions/openai-compat\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://theoai.mintlify.site/_mintlify/api/og/v2?division=Completions\u0026amp;title=OpenAI-Compatible+Chat+Completions\u0026amp;description=Drop-in+replacement+for+the+OpenAI+Chat+Completions+API.+Point+the+OpenAI+SDK+at+Theo+and+keep+writing+code+the+way+you+already+do.\u0026amp;theme=1223219aff4bac636125219a\u0026amp;signature=57b2718058c9dc68aa6df9adcd9b3124cdde20d0ac21d0f3d2f722345d62e439\">\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=\"OpenAI-Compatible Chat Completions - Theo API Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://theoai.mintlify.site/_mintlify/api/og/v2?division=Completions\u0026amp;title=OpenAI-Compatible+Chat+Completions\u0026amp;description=Drop-in+replacement+for+the+OpenAI+Chat+Completions+API.+Point+the+OpenAI+SDK+at+Theo+and+keep+writing+code+the+way+you+already+do.\u0026amp;theme=1223219aff4bac636125219a\u0026amp;signature=57b2718058c9dc68aa6df9adcd9b3124cdde20d0ac21d0f3d2f722345d62e439\">\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/theoai/HMaTiOxhwLuEkGS5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Theo API Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#715eac\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hitheo.ai/api-reference/completions/openai-compat\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/completions/openai-compat.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.hitheo.ai/api-reference/completions/openai-compat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.hitheo.ai/zh/api-reference/completions/openai-compat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-HK\" href=\"https://docs.hitheo.ai/zh-HK/api-reference/completions/openai-compat\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.hitheo.ai/api-reference/completions/openai-compat\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hitheo.ai/#organization\",\"name\":\"Theo API Docs\",\"url\":\"https://docs.hitheo.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/theoai/1GrRXquT3RmYCAKc/images/theo-logo-v1.png?fit=max\u0026auto=format\u0026n=1GrRXquT3RmYCAKc\u0026q=85\u0026s=8b015a7610e195426a8c23f5991cc4fd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hitheo.ai#website\",\"name\":\"Theo API Docs\",\"url\":\"https://docs.hitheo.ai\",\"publisher\":{\"@id\":\"https://docs.hitheo.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat#webpage\",\"url\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat\",\"name\":\"OpenAI-Compatible Chat Completions\",\"description\":\"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\",\"dateModified\":\"2026-10-15T15:26:06.822Z\",\"isPartOf\":{\"@id\":\"https://docs.hitheo.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Completions\",\"item\":\"https://docs.hitheo.ai/api-reference/completions/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenAI-Compatible Chat Completions\",\"item\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat#apireference\",\"headline\":\"OpenAI-Compatible Chat Completions\",\"name\":\"OpenAI-Compatible Chat Completions\",\"description\":\"Drop-in replacement for the OpenAI Chat Completions API. Point the OpenAI SDK at Theo and keep writing code the way you already do.\",\"url\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hitheo.ai/api-reference/completions/openai-compat#webpage\"},\"dateModified\":\"2026-10-15T15:26:06.822Z\",\"publisher\":{\"@id\":\"https://docs.hitheo.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hitheo.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Theo API Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Theo API Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/completions/openai-compat.md","siteName":"Theo API Docs","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API Reference Overview","href":"/api-reference/overview"},{"title":"Authentication","href":"/api-reference/authentication"}]},{"group":"Completions","pages":[{"title":"Create Completion","api":"POST /api/v1/completions","href":"/api-reference/completions/create"},{"title":"Streaming Completions","description":"Full SSE event schemas, wire format, and error semantics.","href":"/api-reference/completions/streaming"},{"title":"OpenAI-Compatible Chat Completions","api":"POST /api/v1/chat/completions","href":"/api-reference/completions/openai-compat"}]},{"group":"Media Generation","pages":[{"title":"Generate Images","description":"Generate images from text prompts using the Theo Create engine.","api":"POST /api/v1/images","href":"/api-reference/images/generate"},{"title":"Generate Video","api":"POST /api/v1/video","href":"/api-reference/video/generate"},{"title":"Generate Code","api":"POST /api/v1/code","href":"/api-reference/code/generate"},{"title":"Create Research","api":"POST /api/v1/research","href":"/api-reference/research/create"},{"title":"Generate Document","api":"POST /api/v1/documents","href":"/api-reference/documents/generate"}]},{"group":"Audio","pages":[{"title":"Text to Speech","api":"POST /api/v1/audio/tts","href":"/api-reference/audio/text-to-speech"},{"title":"Speech to Text","api":"POST /api/v1/audio/stt","href":"/api-reference/audio/speech-to-text"}]},{"group":"Skills API","pages":[{"title":"List Skills","api":"GET /api/v1/skills","href":"/api-reference/skills/list"},{"title":"Install Skill","api":"POST /api/v1/skills","href":"/api-reference/skills/install"},{"title":"Create Skill","api":"POST /api/v1/skills/create","href":"/api-reference/skills/create"},{"title":"Submit Skill","api":"POST /api/v1/skills/submit","href":"/api-reference/skills/submit"},{"title":"Get Skill","api":"GET /api/v1/skills/{id}","href":"/api-reference/skills/get"},{"title":"Skill Versions","api":"GET /api/v1/skills/{id}/versions","href":"/api-reference/skills/versions"},{"title":"Skill Reviews","api":"GET /api/v1/skills/{id}/reviews","href":"/api-reference/skills/reviews"}]},{"group":"Skill Builder","pages":[{"title":"Canvases","href":"/api-reference/evi/canvases"},{"title":"Compile Canvas","href":"/api-reference/evi/compile"},{"title":"Test Canvas","href":"/api-reference/evi/test"},{"title":"Publish Canvas","href":"/api-reference/evi/publish"}]},{"group":"Workflows","pages":[{"title":"List Workflows","api":"GET /api/v1/workflows","href":"/api-reference/workflows/list"},{"title":"Create Workflow","api":"POST /api/v1/workflows","href":"/api-reference/workflows/create"},{"title":"Get Workflow","api":"GET /api/v1/workflows/{id}","href":"/api-reference/workflows/get"},{"title":"Update Workflow","api":"PATCH /api/v1/workflows/{id}","href":"/api-reference/workflows/update"},{"title":"Run Workflow","api":"POST /api/v1/workflows/{id}/run","href":"/api-reference/workflows/run"},{"title":"Delete Workflow","api":"DELETE /api/v1/workflows/{id}","href":"/api-reference/workflows/delete"}]},{"group":"Hooks","pages":[{"title":"Create Hook","api":"POST /api/v1/hooks","href":"/api-reference/hooks/create"},{"title":"List Hooks","api":"GET /api/v1/hooks","href":"/api-reference/hooks/list"},{"title":"Get Hook Executions","api":"GET /api/v1/hooks/{id}","href":"/api-reference/hooks/get"},{"title":"Update Hook","api":"PATCH /api/v1/hooks/{id}","href":"/api-reference/hooks/update"},{"title":"Delete Hook","api":"DELETE /api/v1/hooks/{id}","href":"/api-reference/hooks/delete"}]},{"group":"Settings","pages":[{"title":"Get Settings","api":"GET /api/v1/settings","href":"/api-reference/settings/get"},{"title":"Update Settings","api":"PATCH /api/v1/settings","href":"/api-reference/settings/update"}]},{"group":"Embed Widgets","pages":[{"title":"Create Iframe Widget","api":"POST /api/v1/iframes","href":"/api-reference/iframes/create"},{"title":"List Iframe Widgets","api":"GET /api/v1/iframes","href":"/api-reference/iframes/list"},{"title":"Get Widget","api":"GET /api/v1/iframes/{id}","href":"/api-reference/iframes/get"},{"title":"Update Widget","api":"PATCH /api/v1/iframes/{id}","href":"/api-reference/iframes/update"},{"title":"Delete Widget","api":"DELETE /api/v1/iframes/{id}","href":"/api-reference/iframes/delete"},{"title":"Duplicate Widget","api":"POST /api/v1/iframes/{id}/duplicate","href":"/api-reference/iframes/duplicate"},{"title":"Bulk Delete Widgets","api":"POST /api/v1/iframes/bulk-delete","href":"/api-reference/iframes/bulk-delete"},{"title":"Widget Analytics","api":"GET /api/v1/iframes/{id}/analytics","href":"/api-reference/iframes/analytics"},{"title":"List Widget Leads","api":"GET /api/v1/iframes/{id}/leads","href":"/api-reference/iframes/leads"},{"title":"Export Widget Leads (CSV)","api":"GET /api/v1/iframes/{id}/leads/export","href":"/api-reference/iframes/leads-export"},{"title":"List Widget Conversations","api":"GET /api/v1/iframes/{id}/conversations","href":"/api-reference/iframes/conversations"},{"title":"Get Widget Conversation","api":"GET /api/v1/iframes/{id}/conversations/{sessionId}","href":"/api-reference/iframes/conversation"},{"title":"Post Operator Message","api":"POST /api/v1/iframes/{id}/conversations/{sessionId}/messages","href":"/api-reference/iframes/operator-message"},{"title":"Take Over Session","api":"POST /api/v1/iframes/{id}/conversations/{sessionId}/takeover","href":"/api-reference/iframes/takeover"},{"title":"Release Session","api":"POST /api/v1/iframes/{id}/conversations/{sessionId}/release","href":"/api-reference/iframes/release"},{"title":"Verify Widget Installation","api":"POST /api/v1/iframes/{id}/verify","href":"/api-reference/iframes/verify"}]},{"group":"Guardrails","pages":[{"title":"List Guardrail Policies","api":"GET /api/v1/guardrail-policies","href":"/api-reference/guardrails/list-policies"},{"title":"Create Guardrail Policy","api":"POST /api/v1/guardrail-policies","href":"/api-reference/guardrails/create-policy"},{"title":"Get, Update, or Delete a Policy","api":"GET/PATCH/DELETE /api/v1/guardrail-policies/{id}","href":"/api-reference/guardrails/get-policy"},{"title":"Replay a Prompt Through a Policy","api":"POST /api/v1/guardrail-policies/{id}/test","href":"/api-reference/guardrails/test-policy"},{"title":"List Keys Bound to a Policy","api":"GET /api/v1/guardrail-policies/{id}/bindings","href":"/api-reference/guardrails/policy-bindings"},{"title":"List Preset Templates","api":"GET /api/v1/guardrail-policies/presets","href":"/api-reference/guardrails/presets"},{"title":"Get or Set an API Key's Guardrail Binding","api":"GET/PUT /api/v1/keys/{id}/guardrails","href":"/api-reference/guardrails/key-binding"},{"title":"List Guardrail Executions","api":"GET /api/v1/guardrail-executions","href":"/api-reference/guardrails/executions"}]},{"group":"Routing Studio","pages":[{"title":"List Routing Preferences","api":"GET /api/v1/routing-preferences","href":"/api-reference/routing-preferences/list-preferences"},{"title":"Create Routing Preference","api":"POST /api/v1/routing-preferences","href":"/api-reference/routing-preferences/create-preference"},{"title":"Get, Update, or Delete a Preference","api":"GET/PATCH/DELETE /api/v1/routing-preferences/{id}","href":"/api-reference/routing-preferences/get-preference"},{"title":"Replay a Prompt Through a Preference","api":"POST /api/v1/routing-preferences/{id}/test · POST /api/v1/routing-preferences/test","href":"/api-reference/routing-preferences/test-preference"},{"title":"List Preset Templates","api":"GET /api/v1/routing-preferences/presets","href":"/api-reference/routing-preferences/presets"},{"title":"Record a Routing Correction","api":"POST /api/v1/routing-preferences/corrections","href":"/api-reference/routing-preferences/corrections"},{"title":"Suggest a Rule From Corrections","api":"POST /api/v1/routing-preferences/suggest-rule","href":"/api-reference/routing-preferences/suggest-rule"},{"title":"Manage a Key's Routing Rules","api":"GET/PUT/DELETE /api/v1/keys/{id}/routing-rules","href":"/api-reference/routing-preferences/key-routing-rules"},{"title":"Bind a Shared Preference to a Key","api":"GET/PUT /api/v1/keys/{id}/routing-preference","href":"/api-reference/routing-preferences/key-routing-preference"},{"title":"Inspect a Key's Effective Routing","api":"GET /api/v1/keys/{id}/effective-routing","href":"/api-reference/routing-preferences/effective-routing"}]},{"group":"Theo Browser","pages":[{"title":"Browser Sessions","href":"/api-reference/browser/sessions"},{"title":"Embed the Theo Browser","href":"/api-reference/browser/embed"}]},{"group":"Benchmarks","pages":[{"title":"Get Benchmarks","api":"GET /api/v1/benchmarks","href":"/api-reference/benchmarks/get"}]},{"group":"Webhooks","pages":[{"title":"Create Webhook","api":"POST /api/v1/webhooks","href":"/api-reference/webhooks/create"},{"title":"List Webhooks","api":"GET /api/v1/webhooks","href":"/api-reference/webhooks/list"},{"title":"Update Webhook","api":"PATCH /api/v1/webhooks/{id}","href":"/api-reference/webhooks/update"},{"title":"Delete Webhook","api":"DELETE /api/v1/webhooks/{id}","href":"/api-reference/webhooks/delete"},{"title":"Test Webhook","api":"POST /api/v1/webhooks/{id}/test","href":"/api-reference/webhooks/test"},{"title":"List Deliveries","api":"GET /api/v1/webhooks/{id}/deliveries","href":"/api-reference/webhooks/deliveries"},{"title":"Retry Delivery","api":"POST /api/v1/webhooks/{id}/deliveries/{deliveryId}/retry","href":"/api-reference/webhooks/retry"},{"title":"Rotate Secret","api":"POST /api/v1/webhooks/{id}/rotate-secret","href":"/api-reference/webhooks/rotate-secret"},{"title":"Webhook Stats","api":"GET /api/v1/webhooks/{id}/stats","href":"/api-reference/webhooks/stats"}]},{"group":"Billing","pages":[{"title":"Create a top-up checkout","api":"POST /api/v1/billing/checkout","href":"/api-reference/billing/checkout"},{"title":"Open the billing portal","api":"POST /api/v1/billing/portal","href":"/api-reference/billing/portal"},{"title":"Get Usage","api":"GET /api/v1/usage","href":"/api-reference/usage/get"},{"title":"Export Usage (CSV)","api":"GET /api/v1/usage/export","href":"/api-reference/usage/export"}]},{"group":"Resources","pages":[{"title":"List Models","api":"GET /api/v1/models","href":"/api-reference/models/list"},{"title":"List Tools","api":"GET /api/v1/tools","href":"/api-reference/tools/list"},{"title":"List Conversations","api":"GET /api/v1/conversations","href":"/api-reference/conversations/list"},{"title":"Get Conversation","api":"GET /api/v1/conversations/{id}","href":"/api-reference/conversations/get"},{"title":"Get Job Status","api":"GET /api/v1/jobs/{id}","href":"/api-reference/jobs/get"},{"title":"Publish Event","api":"POST /api/v1/events","href":"/api-reference/events/publish"},{"title":"Create Organization","api":"POST /api/v1/orgs","href":"/api-reference/organizations/create"},{"title":"Create API Key","api":"POST /api/v1/keys","href":"/api-reference/keys/create"},{"title":"Key Skill Binding","api":"GET /api/v1/keys/{id}/skills","href":"/api-reference/keys/skills"},{"title":"Key Model Allowlist","api":"GET /api/v1/keys/{id}/models","href":"/api-reference/keys/models"},{"title":"Key Model Plan","api":"GET /api/v1/keys/{id}/model-plan","href":"/api-reference/keys/model-plan"},{"title":"Key Orchestrator Graph","api":"GET /api/v1/keys/{id}/orchestrator-graph","href":"/api-reference/keys/orchestrator-graph"},{"title":"Custom Providers","api":"POST /api/v1/custom-providers","href":"/api-reference/custom-providers/manage"},{"title":"List Audit Events","api":"GET /api/v1/audit","href":"/api-reference/audit/list"},{"title":"Export Audit Log (CSV)","api":"GET /api/v1/audit/export","href":"/api-reference/audit/export"},{"title":"Health Check","api":"GET /api/v1/health","href":"/api-reference/health/check"}]}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/sdk-reference/installation"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli-reference/overview"}]}]},{"language":"es","pages":[{"title":"es","href":"/es/changelog"}]},{"language":"zh","pages":[{"title":"zh","href":"/zh/api-reference/completions/openai-compat"}]},{"language":"zh-HK","pages":[{"title":"zh-HK","href":"/zh-HK/api-reference/completions/openai-compat"}]}]},"basePath":"","title":"OpenAI-Compatible Chat Completions - Theo API Docs","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":["c2aa737661","b0f84f53ff","2b790eda92"],"chunks":["OpenApiReferenceProvider-CaRkHcld.js","snippetPresets-CbOVSLWB.js","utils-cjri0g4r.js","style-to-object-BY3JEAdk.js","utils-DINdUa17.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-B6z-PJGf.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BldndzCM.js","_Uint8Array-BFUkDgJK.js","isObject-FP1Yky1u.js","Page-DuvGhd6e.js","api-description-markdown-ja0XM5Ae.js","DynamicMarkdown-DgKZ4_wp.js","CodeSnippet-BtGQRZnK.js","use-playground-group-access-98JyaSW7.js","SectionHeading-S4Jc_qPe.js","ApiExamples-gah5G0c1.js","usePlaygroundInputsStore-DMbftGRK.js","shallow-BPuQ-dV8.js","isEqual-Du6c450V.js","CodeSnippets-BSVM0Ibi.js","MethodPill-HIsDH_bI.js","getPastedJson-BKEmMYEO.js","Check2Icon-CRFAnWm9.js","axios-CsQoIw0U.js"]}