OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.
Identifies one submission within your organization and API key. Reuse the same value and request body when retrying; use a new value for new work. See Idempotency.
Completion window for this request, for clients that cannot set metadata.completion_window in the body. A window in the body takes precedence. See Completion windows.
Chat completion. Returns a single JSON object by default, or a Server-Sent Events stream of chat.completion.chunk objects when stream: true (terminated by a final data: [DONE] line).
The completion window Sail selected for this request, including when no window was requested. The legacy request value standard is reported as balanced. Older stored responses may omit this field.
Available options:
asap,
balanced,
flex
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Sail Research","colors":{"primary":"#2c4681","light":"#8ba2dd","dark":"#2c4681"},"logo":{"light":"https://mintcdn.com/sailresearch/X8kOeTTR9DVS13DJ/logo/solo.svg?fit=max\u0026auto=format\u0026n=X8kOeTTR9DVS13DJ\u0026q=85\u0026s=45e472c8b5c89f0235ef55e4953f7075","dark":"https://mintcdn.com/sailresearch/X8kOeTTR9DVS13DJ/logo/solo-white.svg?fit=max\u0026auto=format\u0026n=X8kOeTTR9DVS13DJ\u0026q=85\u0026s=aa38acb72785fa2780f0b79c8ec247af"},"favicon":"https://mintcdn.com/sailresearch/aahfB_XYfgCoK57N/favicon.svg?fit=max\u0026auto=format\u0026n=aahfB_XYfgCoK57N\u0026q=85\u0026s=fa6a1adfca07b5313cfb218d6c30687d","appearance":{"default":"system"},"navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://app.sailresearch.com"}},"footer":{"socials":{"x":"https://x.com/sailresearchco","github":"https://github.com/sailresearchco","slack":"https://join.slack.com/t/sailresearchcrew/shared_invite/zt-41pdcym9j-UU0Ey~A~r6n2H0DQVQsQHQ","linkedin":"https://www.linkedin.com/company/sailresearch"}},"search":{"prompt":"Search (⌘K)"},"seo":{"metatags":{"og:image":"/images/og.png"}},"fonts":{"heading":{"family":"Geist"},"body":{"family":"Geist"}},"integrations":{"telemetry":{"enabled":false}},"contextual":{"options":["copy","chatgpt","claude","cursor","mcp"],"display":"header"},"interaction":{"drilldown":false},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sailresearch","hasAudioNarration":false,"actualSubdomain":"sailresearch","customDomains":["docs.sailresearch.com"],"gitSource":{"type":"github","owner":"sailresearchco","repo":"sail","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af246c7746b981404b9e282","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Reference","count":100},{"language":"default","tag":"Sailbox","count":82},{"language":"default","tag":"HTTP API","count":77},{"language":"default","tag":"Documentation","count":42},{"language":"default","tag":"Lifecycle","count":16},{"language":"default","tag":"Inference","count":13},{"language":"default","tag":"Sailboxes","count":13},{"language":"default","tag":"Volumes","count":13},{"language":"default","tag":"Inference APIs","count":11},{"language":"default","tag":"Exec","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@sailresearch.com","showHelpButton":false}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","href":"/_mintlify/custom/sailresearch/9dde1342574a43da/style.css"}],"page":{"pagePath":"api-reference/chat-completions-api/create-a-chat-completion","slug":"/api-reference/chat-completions-api/create-a-chat-completion","pageMetadata":{"title":"Create a chat completion","description":"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.","deprecated":null,"version":null,"openapi":"/openapi.json post /chat/completions","href":"/api-reference/chat-completions-api/create-a-chat-completion","autogeneratedByOpenApi":true},"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: \"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create a chat completion","description":"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.","deprecated":null,"version":null,"openapi":"/openapi.json post /chat/completions","href":"/api-reference/chat-completions-api/create-a-chat-completion","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/sailresearch/53cdab3a0f4c571b/navbar-auth.js","/_mintlify/custom/sailresearch/351959972cc7827e/cost-calculator-data.js","/_mintlify/custom/sailresearch/1bd7165bcfbd1e54/cost-calculator.js","/_mintlify/custom/sailresearch/7593358cae5a220f/one-shot-prompt.js","/_mintlify/custom/sailresearch/19a656aba0175d42/posthog-events.js","/_mintlify/custom/sailresearch/ee32dacc45e6eb1f/reference-fold.js","/_mintlify/custom/sailresearch/605beaca210d6425/cursor-setup.js","/_mintlify/custom/sailresearch/c2373d1aa5edcffe/price-comparison-data.js","/_mintlify/custom/sailresearch/74da3abd3a623529/price-comparison.js","/_mintlify/custom/sailresearch/3756b4c1fcdcbfd0/zdr-navigation.js","/_mintlify/custom/sailresearch/a81b3a5667a3b4e2/support-feedback.js"],"openApiReferenceData":{"operation":{"operationId":"createChatCompletion","tags":["Chat Completions API"],"summary":"Create a chat completion","description":"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.","parameters":["4674f027-d6bb-48c6-925c-e9575cf0cde6","795908ac-17ca-4264-9421-3ec167780088"],"requestBody":"655cf64b-8bc0-404a-acbe-9e9c88d198a5","responses":{"200":"67c71529-d064-4dd3-9c78-8251579aac90","400":"6b7ab34d-c531-4cc7-8ef0-16fe29bfd3a8","401":"cb2aa755-4b3c-4827-bdd7-678be2d5dd85","409":"c80682c5-782d-4416-b9f9-526a38fc5e33","500":"97287efb-9f0f-4356-8aaf-1d9c15e2298f","503":"92fd101e-0fe7-4411-8954-aa92dcd17c36","504":"296ca534-7f27-458a-85df-8178984b98a1"},"method":"post","type":"path","servers":["6507f53d-de83-41be-9f6b-e0e56f697f31"],"security":["e33de1f0-1691-4b6d-a08b-10805089f7e1"],"path":"/chat/completions","baseUrlOptions":["https://api.sailresearch.com/v1"],"title":"Create a chat completion","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"4674f027-d6bb-48c6-925c-e9575cf0cde6":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255,"isRequired":false,"description":"Identifies one submission within your organization and API key. Reuse the same value and request body when retrying; use a new value for new work. See [Idempotency](/idempotency).","uniqueKey":"","typeLabel":"string"},"description":"Identifies one submission within your organization and API key. Reuse the same value and request body when retrying; use a new value for new work. See [Idempotency](/idempotency)."},"795908ac-17ca-4264-9421-3ec167780088":{"name":"X-Sail-Completion-Window","in":"header","required":false,"schema":{"type":"string","enum":["asap","balanced","flex"],"isRequired":false,"description":"Completion window for this request, for clients that cannot set metadata.completion_window in the body. A window in the body takes precedence. See [Completion windows](/completion-windows#via-request-header).","uniqueKey":"","typeLabel":"enum\u003cstring>"},"description":"Completion window for this request, for clients that cannot set metadata.completion_window in the body. A window in the body takes precedence. See [Completion windows](/completion-windows#via-request-header)."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool","function","developer"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"null"},{"type":"array","items":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0.type","typeLabel":"enum\u003cstring>"},"text":{"type":"string","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0.text","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.0","typeLabel":"object"},{"type":"object","description":"Image content part. Image input is supported only on multimodal models; see the Models page.","required":["type","image_url"],"properties":{"type":{"type":"string","enum":["image_url"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.type","typeLabel":"enum\u003cstring>"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Public http(s) URL or a base64 data URI.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url.url","typeLabel":"string"},"detail":{"type":"string","enum":["auto","low","high"],"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url.detail","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1.image_url","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.1","typeLabel":"object"},{"type":"object","description":"PDF file content part. Sail sends the PDF's text to the model, so this works on every model. See [PDF input](/support#pdf-input).","required":["type","file"],"properties":{"type":{"type":"string","enum":["file"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.type","typeLabel":"enum\u003cstring>"},"file":{"type":"object","required":["file_data"],"properties":{"file_data":{"type":"string","description":"The PDF as a base64 data URI (data:application/pdf;base64,\u003cdata>), or raw base64 when filename ends in .pdf.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.file.file_data","typeLabel":"string"},"filename":{"type":"string","description":"Name used to label the PDF's text.","uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.file.filename","typeLabel":"string"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2.file","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX].oneOf.2","typeLabel":"object"}],"uniqueKey":"messages.items.[INDEX].content.oneOf.2.items.[INDEX]","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"object[]"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | null | object[]"},"name":{"type":"string","uniqueKey":"messages.items.[INDEX].name","typeLabel":"string"},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true,"uniqueKey":"messages.items.[INDEX].tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"messages.items.[INDEX].tool_calls","typeLabel":"object[]"},"tool_call_id":{"type":"string","uniqueKey":"messages.items.[INDEX].tool_call_id","typeLabel":"string"},"function_call":{"type":"object","additionalProperties":true,"uniqueKey":"messages.items.[INDEX].function_call","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"temperature":{"oneOf":[{"type":"number","maximum":2,"minimum":0,"uniqueKey":"temperature.oneOf.0","typeLabel":"number"},{"type":"null","uniqueKey":"temperature.oneOf.1","typeLabel":"null"}],"uniqueKey":"temperature","typeLabel":"number | null"},"top_p":{"oneOf":[{"type":"number","maximum":1,"minimum":0,"uniqueKey":"top_p.oneOf.0","typeLabel":"number"},{"type":"null","uniqueKey":"top_p.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_p","typeLabel":"number | null"},"max_completion_tokens":{"oneOf":[{"type":"integer","minimum":1,"uniqueKey":"max_completion_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","uniqueKey":"max_completion_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_completion_tokens","typeLabel":"integer | null"},"response_format":{"oneOf":[{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text"],"isRequired":true,"uniqueKey":"response_format.oneOf.0.type","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"response_format.oneOf.0","typeLabel":"object"},{"type":"object","required":["type","json_schema"],"properties":{"type":{"type":"string","enum":["json_schema"],"isRequired":true,"uniqueKey":"response_format.oneOf.1.type","typeLabel":"enum\u003cstring>"},"json_schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"response_format.oneOf.1.json_schema.name","typeLabel":"string"},"description":{"type":"string","uniqueKey":"response_format.oneOf.1.json_schema.description","typeLabel":"string"},"schema":{"type":"object","additionalProperties":true,"uniqueKey":"response_format.oneOf.1.json_schema.schema","typeLabel":"object"},"strict":{"type":"boolean","uniqueKey":"response_format.oneOf.1.json_schema.strict","typeLabel":"boolean"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"response_format.oneOf.1.json_schema","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"response_format.oneOf.1","typeLabel":"object"}],"uniqueKey":"response_format","typeLabel":"object"},"reasoning_effort":{"oneOf":[{"type":"string","description":"Reasoning effort for the model. `max` selects the same top tier as `xhigh`.","enum":["none","minimal","low","medium","high","xhigh","max"],"uniqueKey":"reasoning_effort.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","uniqueKey":"reasoning_effort.oneOf.1","typeLabel":"null"}],"uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring> | null"},"n":{"type":"integer","enum":[1],"description":"Only n=1 is currently supported.","uniqueKey":"n","typeLabel":"enum\u003cinteger>"},"modalities":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string","enum":["text"],"uniqueKey":"modalities.items.[INDEX]","typeLabel":"enum\u003cstring>"},"uniqueKey":"modalities","typeLabel":"enum\u003cstring>[]"},"stream":{"type":"boolean","description":"When true, the response is returned as a Server-Sent Events stream of chat.completion.chunk objects instead of a single JSON response.","uniqueKey":"stream","typeLabel":"boolean"},"stream_options":{"type":"object","description":"Options that apply when stream is true.","properties":{"include_usage":{"type":"boolean","description":"When true, emit a final chunk with token usage for the full request before the [DONE] terminator.","uniqueKey":"stream_options.include_usage","typeLabel":"boolean"}},"additionalProperties":false,"uniqueKey":"stream_options","typeLabel":"object"},"store":{"type":"boolean","enum":[true],"description":"Only true is supported.","uniqueKey":"store","typeLabel":"enum\u003cboolean>"},"user":{"type":"string","maxLength":256,"uniqueKey":"user","typeLabel":"string"},"prompt_cache_key":{"type":"string","description":"Optional routing hint for prompt-prefix cache locality. Requests with the same key are preferentially routed to maximize cache hit rates.","uniqueKey":"prompt_cache_key","typeLabel":"string"},"metadata":{"type":"object","description":"Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks; supercache_write stores a reusable prompt prefix.","properties":{"completion_window":{"type":"string","description":"[Completion window](/completion-windows) controls request scheduling and token pricing.\n\n**Defaults when omitted**\n- **Core model inference:** `asap` (low latency).\n- **Batch:** `flex`, including when the value is empty. Other windows are rejected.\n- **LoRA:** `flex`. Explicit `balanced` or `asap` is rejected; use background Responses or Batch.\n- **Background Responses:** an available non-ASAP window. Models that only support `asap` are rejected.\n- **Flex-only models:** `flex` is the default and only window, including for Batch and LoRA.\n\n**Requirements**\n- An explicit window must be supported by the model or Sail returns an error. See the [Pricing support matrix](/pricing).\n- Use `flex` through the Batch API or Responses with `background: true`. Synchronous Responses, Chat Completions, and Messages reject `flex`. Background Responses cannot stream.\n\nSee [default behavior](/completion-windows#default-behavior) and [Flex request requirements](/completion-windows#flex) for details.","enum":["asap","balanced","standard","flex"],"uniqueKey":"metadata.completion_window","typeLabel":"enum\u003cstring>"},"completion_webhook":{"type":"string","format":"uri","uniqueKey":"metadata.completion_webhook","typeLabel":"string\u003curi>"},"webhook_token":{"type":"string","uniqueKey":"metadata.webhook_token","typeLabel":"string"},"supercache_write":{"type":"string","description":"Write the eligible prompt prefix to Supercache for 24 hours. Supported only by the Responses and Chat Completions APIs. Omit this field for automatic reads.","enum":["24h"],"uniqueKey":"metadata.supercache_write","typeLabel":"enum\u003cstring>"}},"additionalProperties":{"type":"string","uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"uniqueKey":"metadata","typeLabel":"object"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"example":{"model":"zai-org/GLM-5.3","messages":[{"role":"system","content":"You are a concise assistant."},{"role":"user","content":"Summarize retrieval-augmented generation in 3 bullets."}],"max_completion_tokens":300},"examples":{"Example":{"title":"Example","value":{"model":"zai-org/GLM-5.3","messages":[{"role":"system","content":"You are a concise assistant."},{"role":"user","content":"Summarize retrieval-augmented generation in 3 bullets."}],"max_completion_tokens":300}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"67c71529-d064-4dd3-9c78-8251579aac90":{"description":"Chat completion. Returns a single JSON object by default, or a Server-Sent Events stream of chat.completion.chunk objects when stream: true (terminated by a final data: [DONE] line).","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","enum":["chat.completion"],"isRequired":true,"uniqueKey":"object","typeLabel":"enum\u003cstring>"},"created":{"type":"integer","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","minItems":1,"items":{"type":"object","required":["index","message","logprobs","finish_reason"],"properties":{"index":{"type":"integer","isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["assistant"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"},"reasoning_content":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].message.reasoning_content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.reasoning_content","typeLabel":"string | null"},"refusal":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].message.refusal.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].message.refusal.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.refusal","typeLabel":"string | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"logprobs":{"type":"null","isRequired":true,"uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"null"},"finish_reason":{"type":"string","enum":["stop","length","tool_calls","content_filter","function_call"],"isRequired":true,"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"type":"object","additionalProperties":true,"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","additionalProperties":true,"uniqueKey":"usage.completion_tokens_details","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"usage","typeLabel":"object"},"service_tier":{"type":"string","enum":["asap","balanced","flex"],"description":"The completion window Sail selected for this request, including when no window was requested. The legacy request value standard is reported as balanced. Older stored responses may omit this field.","uniqueKey":"service_tier","typeLabel":"enum\u003cstring>"}},"additionalProperties":true,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"chat.completion","created":123,"model":"\u003cstring>","choices":[{"index":123,"message":{"role":"assistant","content":"\u003cstring>","reasoning_content":"\u003cstring>","refusal":"\u003cstring>"},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123,"prompt_tokens_details":{},"completion_tokens_details":{}},"service_tier":"asap"}}},"exampleType":"generated"},"text/event-stream":{"schema":{"type":"object","description":"One Server-Sent Events chunk emitted when stream: true. The streamed response is a sequence of these chat.completion.chunk objects, each sent as an SSE data: line and terminated by a final data: [DONE] line.","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","enum":["chat.completion.chunk"],"isRequired":true,"uniqueKey":"object","typeLabel":"enum\u003cstring>"},"created":{"type":"integer","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","delta"],"properties":{"index":{"type":"integer","isRequired":true,"uniqueKey":"choices.items.[INDEX].index","typeLabel":"integer"},"delta":{"type":"object","properties":{"role":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.role","typeLabel":"string"},"content":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.content","typeLabel":"string"},"reasoning_content":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.reasoning_content","typeLabel":"string"},"refusal":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.refusal","typeLabel":"string"},"tool_calls":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].index","typeLabel":"integer"},"id":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].type","typeLabel":"string"},"function":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].function.name","typeLabel":"string"},"arguments":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].function.arguments","typeLabel":"string"},"input":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].function.input","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].function","typeLabel":"object"},"custom":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].custom.name","typeLabel":"string"},"arguments":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].custom.arguments","typeLabel":"string"},"input":{"type":"string","uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].custom.input","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX].custom","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"choices.items.[INDEX].delta.tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].delta.tool_calls","typeLabel":"object[]"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"choices.items.[INDEX].delta","typeLabel":"object"},"logprobs":{"type":"null","uniqueKey":"choices.items.[INDEX].logprobs","typeLabel":"null"},"finish_reason":{"oneOf":[{"type":"string","enum":["stop","length","content_filter","tool_calls",null],"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["stop","length","content_filter","tool_calls",null],"uniqueKey":"choices.items.[INDEX].finish_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring> | null"}},"additionalProperties":false,"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"type":"object","additionalProperties":true,"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","additionalProperties":true,"uniqueKey":"usage.completion_tokens_details","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"usage","typeLabel":"object"},"service_tier":{"type":"string","enum":["asap","balanced","flex"],"description":"The completion window Sail selected for this request, including when no window was requested. The legacy request value standard is reported as balanced. Older stored responses may omit this field.","uniqueKey":"service_tier","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"chat.completion.chunk","created":123,"model":"\u003cstring>","choices":[{"index":123,"delta":{"role":"\u003cstring>","content":"\u003cstring>","reasoning_content":"\u003cstring>","refusal":"\u003cstring>","tool_calls":[{"index":123,"id":"\u003cstring>","type":"\u003cstring>","function":{"name":"\u003cstring>","arguments":"\u003cstring>","input":"\u003cstring>"},"custom":{"name":"\u003cstring>","arguments":"\u003cstring>","input":"\u003cstring>"}}]},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":123,"completion_tokens":123,"total_tokens":123,"prompt_tokens_details":{},"completion_tokens_details":{}},"service_tier":"asap"}}},"exampleType":"generated"}},"exampleType":"generated"},"6b7ab34d-c531-4cc7-8ef0-16fe29bfd3a8":{"description":"Invalid request or unsupported feature.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"cb2aa755-4b3c-4827-bdd7-678be2d5dd85":{"description":"Authentication error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"c80682c5-782d-4416-b9f9-526a38fc5e33":{"description":"An ASAP request with this idempotency key has no available completion yet. Wait for Retry-After, then retry with the same key and request body. See [Idempotency](/idempotency).","headers":{"Retry-After":{"description":"Minimum number of seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"97287efb-9f0f-4356-8aaf-1d9c15e2298f":{"description":"Server error.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"92fd101e-0fe7-4411-8954-aa92dcd17c36":{"description":"The selected model is temporarily unavailable or the service is overloaded. When Retry-After is present, wait at least that number of seconds. Some server errors occur after a request is accepted. See [Retrying requests](/retries) before resubmitting. A direct capacity miss returns error type server_error with code model_capacity_unavailable. Once streaming has begun, the HTTP status stays 200 and a failure is delivered as an in-band error event.","headers":{"Retry-After":{"description":"Minimum number of seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"296ca534-7f27-458a-85df-8178984b98a1":{"description":"Timed out waiting for completion. If the error includes a retrieval URL, use it to check the request's status.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"param":{"oneOf":[{"type":"string","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"error.code.oneOf.1","typeLabel":"integer"},{"type":"null","uniqueKey":"error.code.oneOf.2","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | integer | null"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"\u003cstring>","param":"\u003cstring>","code":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e33de1f0-1691-4b6d-a08b-10805089f7e1":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"6507f53d-de83-41be-9f6b-e0e56f697f31":{"url":"https://api.sailresearch.com/v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"sailresearch","siteName":"Sail Research","title":"Create a chat completion - Sail Research","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-07T17:38:07.272Z","originalFileLocation":"api-reference/chat-completions-api/create-a-chat-completion.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Sail Research\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_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/sailresearch/BWUDTf48u3tNnszQ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a chat completion - Sail Research\">\u003cmeta data-mint-head property=\"og:description\" content=\"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Sail Research\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sailresearch.mintlify.site/images/og.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create a chat completion - Sail Research\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sailresearch.mintlify.site/images/og.png\">\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/sailresearch/BWUDTf48u3tNnszQ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Sail Research\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2c4681\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/chat-completions-api/create-a-chat-completion.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sailresearch.com/#organization\",\"name\":\"Sail Research\",\"url\":\"https://docs.sailresearch.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sailresearch/X8kOeTTR9DVS13DJ/logo/solo.svg?fit=max\u0026auto=format\u0026n=X8kOeTTR9DVS13DJ\u0026q=85\u0026s=45e472c8b5c89f0235ef55e4953f7075\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sailresearch.com#website\",\"name\":\"Sail Research\",\"url\":\"https://docs.sailresearch.com\",\"publisher\":{\"@id\":\"https://docs.sailresearch.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion#webpage\",\"url\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion\",\"name\":\"Create a chat completion\",\"description\":\"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\",\"dateModified\":\"2026-11-07T17:38:07.272Z\",\"isPartOf\":{\"@id\":\"https://docs.sailresearch.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inference APIs\",\"item\":\"https://docs.sailresearch.com/api-reference/models-api/list-supported-models\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a chat completion\",\"item\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion#apireference\",\"headline\":\"Create a chat completion\",\"name\":\"Create a chat completion\",\"description\":\"OpenAI-compatible Chat Completions endpoint. Supports streaming via stream: true, which returns a Server-Sent Events stream of chat.completion.chunk objects.\",\"url\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sailresearch.com/api-reference/chat-completions-api/create-a-chat-completion#webpage\"},\"image\":\"https://docs.sailresearch.com/images/og.png\",\"dateModified\":\"2026-11-07T17:38:07.272Z\",\"publisher\":{\"@id\":\"https://docs.sailresearch.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sailresearch.com#website\"}}]}\u003c/script>","siteName":"Sail Research","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Reference","groups":[{"group":"Inference APIs","pages":[{"group":"Models API","pages":[{"title":"List supported models","deprecated":null,"version":null,"openapi":"/openapi.json get /models","href":"/api-reference/models-api/list-supported-models"}]},{"group":"Responses API","pages":[{"title":"Create a response","deprecated":null,"version":null,"openapi":"/openapi.json post /responses","href":"/api-reference/responses-api/create-a-response"},{"title":"Retrieve a response","description":"Results can expire 10 minutes after [first successful delivery](/webhooks#delivery-behavior).","deprecated":null,"version":null,"openapi":"/openapi.json get /responses/{response_id}","href":"/api-reference/responses-api/retrieve-a-response"}]},{"group":"Chat Completions API","pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi.json post /chat/completions","href":"/api-reference/chat-completions-api/create-a-chat-completion"}]},{"group":"Messages API","pages":[{"title":"Create an Anthropic message","description":"Anthropic-compatible Messages endpoint supporting system prompts, tool calling, and Anthropic SSE framing after generation completes.","deprecated":null,"version":null,"openapi":"/openapi.json post /messages","href":"/api-reference/messages-api/create-an-anthropic-message"},{"title":"Retrieve a message","deprecated":null,"version":null,"openapi":"/openapi.json get /messages/{messageID}","href":"/api-reference/messages-api/retrieve-a-message"},{"title":"Count tokens for an Anthropic message","deprecated":null,"version":null,"openapi":"/openapi.json post /messages/count_tokens","href":"/api-reference/messages-api/count-tokens-for-an-anthropic-message"}]},{"group":"Batches API","pages":[{"title":"List batches","deprecated":null,"version":null,"openapi":"/openapi.json get /batches","href":"/api-reference/batches-api/list-batches"},{"title":"Create a batch","deprecated":null,"version":null,"openapi":"/openapi.json post /batches","href":"/api-reference/batches-api/create-a-batch"},{"title":"Get batch status and results","deprecated":null,"version":null,"openapi":"/openapi.json get /batches/{batch_id}","href":"/api-reference/batches-api/get-batch-status-and-results"},{"title":"Get batch request result","deprecated":null,"version":null,"openapi":"/openapi.json get /batches/{batch_id}/{custom_id}","href":"/api-reference/batches-api/get-batch-request-result"}]},{"group":"Web Search API","pages":[]}]},{"group":"Usage API","pages":[{"title":"Overview","href":"/usage"},{"title":"Usage API endpoints","href":"/usage-endpoints"}]},{"group":"Sailbox","pages":[{"title":"Sailboxes","href":"/sailbox-sdk"},{"title":"Images \u0026 Functions","href":"/sailbox-sdk-images"},{"title":"Apps","href":"/sailbox-sdk-apps"},{"title":"Egress policy reference","sidebarTitle":"Egress policy","href":"/reference/egress-policy"},{"title":"Errors","href":"/sailbox-sdk-errors"},{"group":"HTTP API","pages":[{"group":"Identity","pages":[{"title":"whoami","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /whoami","href":"/api-reference/identity/whoami"}]},{"group":"Apps","pages":[{"title":"Find or create an app","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /apps/find","href":"/api-reference/apps/find-or-create-an-app"},{"title":"List apps","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /apps","href":"/api-reference/apps/list-apps"}]},{"group":"Secrets","pages":[{"title":"List secrets","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /secrets","href":"/api-reference/secrets/list-secrets"},{"title":"Get a secret","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /secrets/{name}","href":"/api-reference/secrets/get-a-secret"},{"title":"Set a secret","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /secrets/{name}","href":"/api-reference/secrets/set-a-secret"},{"title":"Delete a secret","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /secrets/{name}","href":"/api-reference/secrets/delete-a-secret"},{"title":"List policies using a secret","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /secrets/{name}/references","href":"/api-reference/secrets/list-policies-using-a-secret"}]},{"group":"Egress policies","pages":[{"title":"List egress policies","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /egress-policies","href":"/api-reference/egress-policies/list-egress-policies"},{"title":"Create an egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /egress-policies","href":"/api-reference/egress-policies/create-an-egress-policy"},{"title":"Get an egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /egress-policies/{policy_id}","href":"/api-reference/egress-policies/get-an-egress-policy"},{"title":"Delete an egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /egress-policies/{policy_id}","href":"/api-reference/egress-policies/delete-an-egress-policy"},{"title":"Rename an egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json patch /egress-policies/{policy_id}","href":"/api-reference/egress-policies/rename-an-egress-policy"},{"title":"Get a Sailbox's egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/egress-policy","href":"/api-reference/egress-policies/get-a-sailboxs-egress-policy"},{"title":"Set a Sailbox's egress policy","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailboxes/{sailbox_id}/egress-policy","href":"/api-reference/egress-policies/set-a-sailboxs-egress-policy"}]},{"group":"Lifecycle","pages":[{"title":"List Sailboxes","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes","href":"/api-reference/lifecycle/list-sailboxes"},{"title":"Create a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes","href":"/api-reference/lifecycle/create-a-sailbox"},{"title":"Retrieve a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}","href":"/api-reference/lifecycle/retrieve-a-sailbox"},{"title":"Pause a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/pause","href":"/api-reference/lifecycle/pause-a-sailbox"},{"title":"Sleep a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/sleep","href":"/api-reference/lifecycle/sleep-a-sailbox"},{"title":"Resume a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/resume","href":"/api-reference/lifecycle/resume-a-sailbox"},{"title":"Schedule a wake","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/wake_at","href":"/api-reference/lifecycle/schedule-a-wake"},{"title":"List cron jobs","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/cron","href":"/api-reference/lifecycle/list-cron-jobs"},{"title":"Add a cron job","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/cron","href":"/api-reference/lifecycle/add-a-cron-job"},{"title":"Remove a cron job","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailboxes/{sailbox_id}/cron/{cron_job_id}","href":"/api-reference/lifecycle/remove-a-cron-job"},{"title":"Set the automatic-sleep preference","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/auto_sleep","href":"/api-reference/lifecycle/set-the-automatic-sleep-preference"},{"title":"Change who can operate a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/visibility","href":"/api-reference/lifecycle/change-who-can-operate-a-sailbox"},{"title":"Upgrade a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/upgrade","href":"/api-reference/lifecycle/upgrade-a-sailbox"},{"title":"Reboot a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/reboot","href":"/api-reference/lifecycle/reboot-a-sailbox"},{"title":"Set a Sailbox's limits","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/set-limits","href":"/api-reference/lifecycle/set-a-sailboxs-limits"},{"title":"Terminate a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/terminate","href":"/api-reference/lifecycle/terminate-a-sailbox"}]},{"group":"Exec","pages":[{"title":"Snapshot recent executions","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/executions","href":"/api-reference/exec/snapshot-recent-executions"},{"title":"Snapshot execution output","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/logs","href":"/api-reference/exec/snapshot-execution-output"},{"title":"Run a command","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/exec","href":"/api-reference/exec/run-a-command"},{"title":"Wait for an exec","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/exec/{exec_id}/wait","href":"/api-reference/exec/wait-for-an-exec"},{"title":"Write exec stdin","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailboxes/{sailbox_id}/exec/{exec_id}/stdin","href":"/api-reference/exec/write-exec-stdin"},{"title":"Stream exec stdin","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/exec/{exec_id}/stdin/stream","href":"/api-reference/exec/stream-exec-stdin"},{"title":"Cancel an exec","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/exec/{exec_id}/cancel","href":"/api-reference/exec/cancel-an-exec"},{"title":"Resize an exec PTY","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/exec/{exec_id}/resize","href":"/api-reference/exec/resize-an-exec-pty"},{"title":"Resync an exec PTY","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/exec/{exec_id}/resync","href":"/api-reference/exec/resync-an-exec-pty"},{"title":"Set the clipboard","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailboxes/{sailbox_id}/clipboard","href":"/api-reference/exec/set-the-clipboard"}]},{"group":"Files","pages":[{"title":"Read a file","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/files","href":"/api-reference/files/read-a-file"},{"title":"Write a file","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailboxes/{sailbox_id}/files","href":"/api-reference/files/write-a-file"},{"title":"Mint a download URL for a file","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/files/download-url","href":"/api-reference/files/mint-a-download-url-for-a-file"},{"title":"Fetch a file through its download URL","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/files/download","href":"/api-reference/files/fetch-a-file-through-its-download-url"},{"title":"Get a download URL's headers","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json head /sailboxes/{sailbox_id}/files/download","href":"/api-reference/files/get-a-download-urls-headers"}]},{"group":"Networking","pages":[{"title":"Tunnel to a port","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/tunnel","href":"/api-reference/networking/tunnel-to-a-port"},{"title":"List published ports","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/listeners","href":"/api-reference/networking/list-published-ports"},{"title":"Publish a port","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/listeners","href":"/api-reference/networking/publish-a-port"},{"title":"Retrieve a published port","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/listeners/{guest_port}","href":"/api-reference/networking/retrieve-a-published-port"},{"title":"Unpublish a port","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailboxes/{sailbox_id}/listeners/{guest_port}","href":"/api-reference/networking/unpublish-a-port"},{"title":"Get custom-domain DNS targets","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /custom-domains","href":"/api-reference/networking/get-custom-domain-dns-targets"},{"title":"List custom domains","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/domains","href":"/api-reference/networking/list-custom-domains"},{"title":"Add a custom domain","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/domains","href":"/api-reference/networking/add-a-custom-domain"},{"title":"Remove a custom domain","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailboxes/{sailbox_id}/domains/{domain}","href":"/api-reference/networking/remove-a-custom-domain"}]},{"group":"Checkpoints","pages":[{"title":"Checkpoint a Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/{sailbox_id}/checkpoint","href":"/api-reference/checkpoints/checkpoint-a-sailbox"},{"title":"Start a Sailbox from a checkpoint","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailboxes/from_checkpoint","href":"/api-reference/checkpoints/start-a-sailbox-from-a-checkpoint"},{"title":"List checkpoints","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-checkpoints","href":"/api-reference/checkpoints/list-checkpoints"},{"title":"Get a checkpoint","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-checkpoints/{checkpoint_id}","href":"/api-reference/checkpoints/get-a-checkpoint"},{"title":"Delete a checkpoint","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailbox-checkpoints/{checkpoint_id}","href":"/api-reference/checkpoints/delete-a-checkpoint"}]},{"group":"Volumes","pages":[{"title":"Mount a volume on a running Sailbox","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailboxes/{sailbox_id}/volume-mounts","href":"/api-reference/volumes/mount-a-volume-on-a-running-sailbox"},{"title":"List volumes","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-volumes","href":"/api-reference/volumes/list-volumes"},{"title":"Create a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailbox-volumes","href":"/api-reference/volumes/create-a-volume"},{"title":"Delete a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailbox-volumes/{volume_id}","href":"/api-reference/volumes/delete-a-volume"},{"title":"Read a file on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-volumes/{volume_id}/files","href":"/api-reference/volumes/read-a-file-on-a-volume"},{"title":"Write a file on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailbox-volumes/{volume_id}/files","href":"/api-reference/volumes/write-a-file-on-a-volume"},{"title":"List a directory on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-volumes/{volume_id}/directories","href":"/api-reference/volumes/list-a-directory-on-a-volume"},{"title":"Create a directory on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailbox-volumes/{volume_id}/directories","href":"/api-reference/volumes/create-a-directory-on-a-volume"},{"title":"Look up a path on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-volumes/{volume_id}/paths","href":"/api-reference/volumes/look-up-a-path-on-a-volume"},{"title":"Move a path within a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /sailbox-volumes/{volume_id}/paths","href":"/api-reference/volumes/move-a-path-within-a-volume"},{"title":"Remove a path on a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json delete /sailbox-volumes/{volume_id}/paths","href":"/api-reference/volumes/remove-a-path-on-a-volume"},{"title":"Download a directory from a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailbox-volumes/{volume_id}/archives","href":"/api-reference/volumes/download-a-directory-from-a-volume"},{"title":"Upload a directory to a volume","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json put /sailbox-volumes/{volume_id}/archives","href":"/api-reference/volumes/upload-a-directory-to-a-volume"}]},{"group":"SSH access","pages":[{"title":"Get your SSH certificate authority","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /ssh/ca","href":"/api-reference/ssh-access/get-your-ssh-certificate-authority"},{"title":"Issue an SSH certificate","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json post /ssh/certificate","href":"/api-reference/ssh-access/issue-an-ssh-certificate"}]},{"group":"Usage","pages":[{"title":"Get resource usage over time","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/{sailbox_id}/metrics","href":"/api-reference/usage/get-resource-usage-over-time"},{"title":"Get Sailbox spend","deprecated":null,"version":null,"openapi":"/sailbox-openapi.json get /sailboxes/spend","href":"/api-reference/usage/get-sailbox-spend"}]}]}]},{"group":"Tinker","pages":[{"title":"Tinker","href":"/sdk-tinker"}]},{"group":"SDKs","pages":[{"title":"Python SDK","href":"/reference/python-sdk"},{"title":"TypeScript SDK","href":"/reference/typescript-sdk"},{"title":"Rust SDK","href":"/reference/rust-sdk"},{"title":"Configuration","href":"/reference/sdk-configuration"}]}]}]},"basePath":"","title":"Create a chat completion - Sail Research","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C-hEh3I2.js","utils-CnF4QiUD.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C7PVNbel.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-8ytevL2A.js","snippetPresets-BT1alx3v.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BLXC0i_W.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CyLIGI9_.js","shallow-DC0lGVIW.js","getApiPlaygroundDisplay-CgDQ85tN.js","CodeSnippet-6-I-Gpv9.js","CodeSnippets-BAk1kDdu.js","Page-C945cI-W.js","getPastedJson-B276RuWN.js","icon-BqP8etTm.js","MethodPill-DM6sbxG1.js","DuplicateIcon-PyJglOaE.js","createIcon-CMeOMAc_.js","DynamicMarkdown-BoyYAA8K.js","SectionHeading-DAYv3gvZ.js","axios-vUo_bRtp.js","Markdown-BhTTmazV.js","clsx-CR-RHrVC.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CBUH0-zX.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BmARFYNC.js"]}