Parameters not listed here are outside the documented surface, some OpenAI parameters may be accepted, but their behavior isn’t guaranteed. Per-model parameter support is listed in supported_sampling_parameters on GET /models.
Bearer followed by an inference API key (sk-prl-infapi-). Create keys on the API Keys page. Management keys (sk-prl-mgmt-) cannot call models.
Body
application/json
model
string
required
A catalog model ID, e.g. deepseek-ai/DeepSeek-V4-Pro-0813, the id field from GET /models.
messages
object[]
required
The conversation, oldest first. Roles: system, developer, user, assistant, tool. A user message's content is a string, or an array of text / image_url parts on vision models (images as base64 data URIs only, see Vision).
Show child attributes
max_tokens
integer
Cap on generated tokens, on reasoning models the thinking counts against it. Hitting the cap sets finish_reason: "length". Per-model ceilings are the max_output_length on GET /models.
temperature
number
Sampling temperature, 0 to 2. Lower is more deterministic.
Required range: 0 <= x <= 2
top_p
number
Nucleus sampling mass, 0 to 1.
Required range: 0 <= x <= 1
top_k
integer
Sample only from the k most likely tokens (0 to 1024). A Pearl extension, pass via extra_body in the OpenAI SDKs.
Required range: 0 <= x <= 1024
min_p
number
Drop tokens below this probability relative to the top token (0 to 1). Extension via extra_body; not all models, check supported_sampling_parameters.
Required range: 0 <= x <= 1
frequency_penalty
number
−2 to 2. Positive values discourage token repetition by frequency.
Required range: -2 <= x <= 2
presence_penalty
number
−2 to 2. Positive values discourage reusing tokens that already appeared.
Required range: -2 <= x <= 2
repetition_penalty
number
Alternative repetition control (0 to 2, 1 is off), used by some model families instead of the frequency/presence pair. Extension via extra_body; not all models, check supported_sampling_parameters.
Required range: 0 <= x <= 2
stop
string[]
Up to 4 non-empty sequences that end generation when produced.
Maximum array length: 4
Minimum string length: 1
seed
integer
Best-effort determinism for repeated sampling, not a reproducibility guarantee.
stream
boolean
Stream the response as server-sent events, see Streaming and the chunk shape below.
response_format
object
{"type": "text"} (default) or {"type": "json_object"} for JSON mode. The stricter json_schema type is not available.
Show child attributes
tools
object[]
Function tool definitions ({"type": "function", "function": {…}}) the model may call, see Function calling.
Show child attributes
reasoning
object
The one reasoning control on reasoning models: {"enabled": bool, "effort": string}, both optional. Effort is none | minimal | low | medium | high | xhigh | max, resolved per model against supported_efforts in its GET /models reasoning block: a served level applies as is, any other rounds up to the next served level (or to the highest one past the top), and none is the disable control, not a rung. {"effort": "none"} (or enabled: false) disables thinking only on models not marked mandatory in that block (GLM-5.3 and GLM-5.3-Flash are, and reject the disable with 400). A max_tokens member returns 400 on every model today (supports_max_tokens: false); bound thinking with the effort or the top-level max_tokens. Omission keeps the model's default_effort, max on GLM-5.3. Via extra_body in the OpenAI Python SDK. Provider-native switches (thinking, chat_template_kwargs.enable_thinking, and their siblings) return 400 on key presence.
Show child attributes
reasoning_effort
enum<string>
OpenAI's flat spelling of reasoning.effort, with the same values and rounding. Sending both returns 400.
Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
n
integer
default:1
Number of choices to generate, 1 to 8. Defaults to 1.
Required range: 1 <= x <= 8
stream_options
object
{"include_usage": bool}. Streams always end with a usage chunk unless you set include_usage: false.
Show child attributes
Response
The completion, or an event stream when streaming.
id
string
Completion ID, log it for request-level forensics.
object
enum<string>
chat.completion, or chat.completion.chunk when streaming.
Available options:
chat.completion,
chat.completion.chunk
created
integer
Unix timestamp (seconds).
model
string
The model that served the request.
choices
object[]
Show child attributes
usage
object
prompt_tokens, completion_tokens, total_tokens, what you're billed on. Worker-dependent details: prompt_tokens_details.cached_tokens and completion_tokens_details.reasoning_tokens.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Pearl Inference Platform","colors":{"primary":"#2A2623","light":"#EFEDEA","dark":"#2A2623"},"logo":{"light":"https://mintcdn.com/pearl-research/qjVPdghcpi_iWwgo/logo/light.svg?fit=max\u0026auto=format\u0026n=qjVPdghcpi_iWwgo\u0026q=85\u0026s=a969569c61ca3aa40012ac0f3dbbe445","dark":"https://mintcdn.com/pearl-research/qjVPdghcpi_iWwgo/logo/dark.svg?fit=max\u0026auto=format\u0026n=qjVPdghcpi_iWwgo\u0026q=85\u0026s=eacd546258e1218dea6ff14f55e89b4c"},"favicon":{"light":"https://mintcdn.com/pearl-research/jPtzRu8ZOdp5WYZT/favicon/pearl-light.svg?fit=max\u0026auto=format\u0026n=jPtzRu8ZOdp5WYZT\u0026q=85\u0026s=97c85bf573b7866d8612883b555a32c7","dark":"https://mintcdn.com/pearl-research/jPtzRu8ZOdp5WYZT/favicon/pearl-dark.svg?fit=max\u0026auto=format\u0026n=jPtzRu8ZOdp5WYZT\u0026q=85\u0026s=9dc503cf63b998d03fa165c37e0921e1"},"api":{"playground":{"display":"interactive"},"examples":{"prefill":true,"autogenerate":false},"url":"full"},"appearance":{"default":"light","strict":true},"background":{"color":{"light":"#EFEEEB"}},"navbar":{"links":[{"href":"mailto:support@pearlresearch.ai","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://platform.pearlresearch.ai"}},"seo":{"metatags":{"canonical":"https://platform.pearlresearch.ai/docs"}},"fonts":{"heading":{"family":"Urbanist"},"body":{"family":"Inter"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pearl-research","hasAudioNarration":false,"actualSubdomain":"pearl-research","customDomains":[],"gitSource":{"type":"github","owner":"duplex-foundation","repo":"cloud-platform-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6afac147dd50ae575c58a540"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aff1808a4a19f80cc241c5b","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Docs","count":37},{"language":"default","tag":"Integrations","count":16},{"language":"default","tag":"Inference API","count":14},{"language":"default","tag":"API Reference","count":12},{"language":"default","tag":"Account \u0026 Billing","count":6},{"language":"default","tag":"Get Started","count":6},{"language":"default","tag":"Management API","count":5},{"language":"default","tag":"Guides","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"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":"site-roles","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":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"reference/chat-completions","slug":"/reference/chat-completions","pageMetadata":{"title":"Chat completions","description":"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/openapi/inference.yaml post /chat/completions","href":"/reference/chat-completions","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: \"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\"\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`,p:`p`,..._provideComponents(),...props.components},{Note}=_components;if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(Note,{children:_jsxs(_components.p,{children:[`Parameters not listed here are outside the documented surface, some OpenAI parameters may be accepted, but their behavior isn’t guaranteed. Per-model parameter support is listed in `,_jsx(_components.code,{children:`supported_sampling_parameters`}),` on `,_jsx(_components.a,{href:`/reference/models`,children:`GET /models`}),`.`]})}),`\n`,_jsxs(_components.p,{children:[`Error bodies and retry guidance are in the `,_jsx(_components.a,{href:`/reference/inference#errors`,children:`Inference API overview`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Chat completions","description":"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/openapi/inference.yaml post /chat/completions","href":"/reference/chat-completions","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createChatCompletion","summary":"Chat completions","description":"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.","x-mint":{"href":"/reference/chat-completions","metadata":{"sidebarTitle":"Chat completions"},"content":"\u003cNote>\n Parameters not listed here are outside the documented surface, some OpenAI parameters may be accepted, but their behavior isn't guaranteed. Per-model parameter support is listed in `supported_sampling_parameters` on [GET /models](/reference/models).\n\u003c/Note>\n\nError bodies and retry guidance are in the [Inference API overview](/reference/inference#errors).\n"},"x-codeSamples":[{"lang":"bash","label":"cURL","source":"curl https://inference.pearlresearch.ai/v1/chat/completions \\\n -H \"Authorization: Bearer $PEARL_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"zai-org/GLM-5.3\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are terse.\"},\n {\"role\": \"user\", \"content\": \"Why is the sky blue?\"}\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 200\n }'\n"}],"requestBody":"5b439f43-53f2-41e8-b0dc-4aa7ebaa6238","responses":{"200":"bd4e0468-4260-4d40-94fb-119fb2fd71f1","400":"c7649a47-03dc-46f4-b31b-3b9758ea76f5","401":"164ed742-e185-47b4-a959-2867972a53d0","402":"d5f0ba05-3855-46a8-b08c-fd1a6da0f505","403":"4da3772e-d5cc-458b-9bdb-391ab3f5b1b1","404":"cc824085-50c4-43c2-ba02-0ed52ff0d690","413":"5455765a-b249-43c7-8904-1718a7f6b01e","429":"a9e79f59-35d8-41f7-922c-b0fedbb536f5","500":"2e0e82dc-e9e6-4be2-afc3-201115b81366","502":"75fe9f19-3434-4c94-9afa-b2cbc11a29ef","503":"6ba32869-66b6-4e9c-af3f-6c172fa0b9ee","529":"cb7237e3-30bf-4c0f-94c5-0d7a8bc9f737"},"method":"post","type":"path","servers":["f6c31a79-dad6-4767-a559-ec5cffb3ed6a"],"security":["6625f6de-e10e-440e-ad17-e151c962928e"],"path":"/chat/completions","baseUrlOptions":["https://inference.pearlresearch.ai/v1"],"title":"Chat completions","codeSamples":[{"label":"cURL","lang":"bash","source":"curl https://inference.pearlresearch.ai/v1/chat/completions \\\n -H \"Authorization: Bearer $PEARL_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"zai-org/GLM-5.3\",\n \"messages\": [\n {\"role\": \"system\", \"content\": \"You are terse.\"},\n {\"role\": \"user\", \"content\": \"Why is the sky blue?\"}\n ],\n \"temperature\": 0.7,\n \"max_tokens\": 200\n }'\n"}],"requiredOnlyExamples":false,"disableCodeSampleGeneration":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"zai-org/GLM-5.3","body.messages.items.0.role":"system","body.messages.items.0.content.oneOf.0":"You are terse.","body.messages.items.1.role":"user","body.messages.items.1.content.oneOf.0":"Why is the sky blue?","body.max_tokens":200,"body.temperature":0.7}],"urlDisplay":"full"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"A catalog model ID, e.g. `deepseek-ai/DeepSeek-V4-Pro-0813`, the `id` field from `GET /models`.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"messages":{"type":"array","description":"The conversation, oldest first. Roles: `system`, `developer`, `user`, `assistant`, `tool`. A user message's `content` is a string, or an array of `text` / `image_url` parts on vision models (images as base64 data URIs only, see [Vision](/vision)).","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"],"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","title":"string","uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text","image_url"],"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"title":"array","uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"array · object[]"}],"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | array · object[]"}},"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"max_tokens":{"type":"integer","description":"Cap on generated tokens, on reasoning models the thinking counts against it. Hitting the cap sets `finish_reason: \"length\"`. Per-model ceilings are the `max_output_length` on `GET /models`.","uniqueKey":"max_tokens","typeLabel":"integer"},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Sampling temperature, 0 to 2. Lower is more deterministic.","uniqueKey":"temperature","typeLabel":"number"},"top_p":{"type":"number","minimum":0,"maximum":1,"description":"Nucleus sampling mass, 0 to 1.","uniqueKey":"top_p","typeLabel":"number"},"top_k":{"type":"integer","minimum":0,"maximum":1024,"description":"Sample only from the k most likely tokens (0 to 1024). A Pearl extension, pass via `extra_body` in the OpenAI SDKs.","uniqueKey":"top_k","typeLabel":"integer"},"min_p":{"type":"number","minimum":0,"maximum":1,"description":"Drop tokens below this probability relative to the top token (0 to 1). Extension via `extra_body`; not all models, check `supported_sampling_parameters`.","uniqueKey":"min_p","typeLabel":"number"},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2,"description":"−2 to 2. Positive values discourage token repetition by frequency.","uniqueKey":"frequency_penalty","typeLabel":"number"},"presence_penalty":{"type":"number","minimum":-2,"maximum":2,"description":"−2 to 2. Positive values discourage reusing tokens that already appeared.","uniqueKey":"presence_penalty","typeLabel":"number"},"repetition_penalty":{"type":"number","minimum":0,"maximum":2,"description":"Alternative repetition control (0 to 2, 1 is off), used by some model families instead of the frequency/presence pair. Extension via `extra_body`; not all models, check `supported_sampling_parameters`.","uniqueKey":"repetition_penalty","typeLabel":"number"},"stop":{"type":"array","maxItems":4,"description":"Up to 4 non-empty sequences that end generation when produced.","items":{"type":"string","minLength":1,"uniqueKey":"stop.items.[INDEX]","typeLabel":"string"},"uniqueKey":"stop","typeLabel":"string[]"},"seed":{"type":"integer","description":"Best-effort determinism for repeated sampling, not a reproducibility guarantee.","uniqueKey":"seed","typeLabel":"integer"},"stream":{"type":"boolean","description":"Stream the response as server-sent events, see [Streaming](/streaming) and the chunk shape below.","uniqueKey":"stream","typeLabel":"boolean"},"response_format":{"type":"object","description":"`{\"type\": \"text\"}` (default) or `{\"type\": \"json_object\"}` for [JSON mode](/json-mode). The stricter `json_schema` type is not available.","properties":{"type":{"type":"string","enum":["text","json_object"],"default":"text","uniqueKey":"response_format.type","typeLabel":"enum\u003cstring>"}},"uniqueKey":"response_format","typeLabel":"object"},"tools":{"type":"array","description":"Function tool definitions (`{\"type\": \"function\", \"function\": {…}}`) the model may call, see [Function calling](/function-calling).","items":{"type":"object","properties":{"type":{"type":"string","enum":["function"],"uniqueKey":"tools.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"function":{"type":"object","uniqueKey":"tools.items.[INDEX].function","typeLabel":"object"}},"uniqueKey":"tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tools","typeLabel":"object[]"},"reasoning":{"type":"object","description":"The one reasoning control on reasoning models: `{\"enabled\": bool, \"effort\": string}`, both optional. Effort is `none` | `minimal` | `low` | `medium` | `high` | `xhigh` | `max`, resolved per model against `supported_efforts` in its [GET /models](/reference/models) reasoning block: a served level applies as is, any other rounds up to the next served level (or to the highest one past the top), and `none` is the disable control, not a rung. `{\"effort\": \"none\"}` (or `enabled: false`) disables thinking only on models not marked `mandatory` in that block (GLM-5.3 and GLM-5.3-Flash are, and reject the disable with `400`). A `max_tokens` member returns `400` on every model today (`supports_max_tokens: false`); bound thinking with the effort or the top-level `max_tokens`. Omission keeps the model's `default_effort`, `max` on GLM-5.3. Via `extra_body` in the OpenAI Python SDK. Provider-native switches (`thinking`, `chat_template_kwargs.enable_thinking`, and their siblings) return `400` on key presence.","properties":{"enabled":{"type":"boolean","uniqueKey":"reasoning.enabled","typeLabel":"boolean"},"effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"uniqueKey":"reasoning.effort","typeLabel":"enum\u003cstring>"}},"uniqueKey":"reasoning","typeLabel":"object"},"reasoning_effort":{"type":"string","enum":["none","minimal","low","medium","high","xhigh","max"],"description":"OpenAI's flat spelling of `reasoning.effort`, with the same values and rounding. Sending both returns `400`.","uniqueKey":"reasoning_effort","typeLabel":"enum\u003cstring>"},"n":{"type":"integer","minimum":1,"maximum":8,"default":1,"description":"Number of choices to generate, 1 to 8. Defaults to 1.","uniqueKey":"n","typeLabel":"integer"},"stream_options":{"type":"object","description":"`{\"include_usage\": bool}`. Streams always end with a usage chunk unless you set `include_usage: false`.","properties":{"include_usage":{"type":"boolean","default":true,"uniqueKey":"stream_options.include_usage","typeLabel":"boolean"}},"uniqueKey":"stream_options","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"model":"zai-org/GLM-5.3","messages":[{"role":"system","content":"You are terse."},{"role":"user","content":"Why is the sky blue?"}],"temperature":0.7,"max_tokens":200},"examples":{"Example":{"title":"Example","value":{"model":"zai-org/GLM-5.3","messages":[{"role":"system","content":"You are terse."},{"role":"user","content":"Why is the sky blue?"}],"temperature":0.7,"max_tokens":200}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"bd4e0468-4260-4d40-94fb-119fb2fd71f1":{"description":"The completion, or an event stream when streaming.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Completion ID, log it for request-level forensics.","uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","enum":["chat.completion","chat.completion.chunk"],"description":"`chat.completion`, or `chat.completion.chunk` when streaming.","uniqueKey":"object","typeLabel":"enum\u003cstring>"},"created":{"type":"integer","description":"Unix timestamp (seconds).","uniqueKey":"created","typeLabel":"integer"},"model":{"type":"string","description":"The model that served the request.","uniqueKey":"model","typeLabel":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"message":{"type":"object","description":"`role` + `content`; reasoning models add `reasoning`, tool use adds `tool_calls` (with `content: null`).","properties":{"role":{"type":"string","uniqueKey":"choices.items.[INDEX].message.role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","uniqueKey":"choices.items.[INDEX].message.content.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"choices.items.[INDEX].message.content.oneOf.1","typeLabel":"null"}],"uniqueKey":"choices.items.[INDEX].message.content","typeLabel":"string | null"},"reasoning":{"type":"string","uniqueKey":"choices.items.[INDEX].message.reasoning","typeLabel":"string"},"tool_calls":{"type":"array","items":{"type":"object","uniqueKey":"choices.items.[INDEX].message.tool_calls.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices.items.[INDEX].message.tool_calls","typeLabel":"object[]"}},"uniqueKey":"choices.items.[INDEX].message","typeLabel":"object"},"finish_reason":{"type":"string","enum":["stop","length","tool_calls"],"description":"`stop` (natural end or stop sequence), `length` (hit `max_tokens`), or `tool_calls`.","uniqueKey":"choices.items.[INDEX].finish_reason","typeLabel":"enum\u003cstring>"}},"uniqueKey":"choices.items.[INDEX]","typeLabel":"object"},"uniqueKey":"choices","typeLabel":"object[]"},"usage":{"type":"object","description":"`prompt_tokens`, `completion_tokens`, `total_tokens`, what you're billed on. Worker-dependent details: `prompt_tokens_details.cached_tokens` and `completion_tokens_details.reasoning_tokens`.","properties":{"prompt_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","uniqueKey":"usage.completion_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","uniqueKey":"usage.total_tokens","typeLabel":"integer"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer","uniqueKey":"usage.prompt_tokens_details.cached_tokens","typeLabel":"integer"}},"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"completion_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer","uniqueKey":"usage.completion_tokens_details.reasoning_tokens","typeLabel":"integer"}},"uniqueKey":"usage.completion_tokens_details","typeLabel":"object"}},"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"completion":{"title":"completion","summary":"Completion","value":{"id":"chatcmpl-2de22e60-5d2a-48e7-acfa-28c53fd9da40","object":"chat.completion","created":1785229039,"model":"zai-org/GLM-5.3","choices":[{"index":0,"finish_reason":"stop","logprobs":null,"message":{"role":"assistant","content":"Rayleigh scattering. …","reasoning":"The user wants a terse answer. The dominant effect is …"}}],"usage":{"prompt_tokens":21,"completion_tokens":92,"total_tokens":113,"prompt_tokens_details":{"cached_tokens":0}}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"type":"string","description":"With `stream: true` the response is a server-sent-event stream of `chat.completion.chunk` objects terminated by `data: [DONE]`. Each chunk's `choices[0].delta` carries the increment (`content`, `reasoning`, or `tool_calls` fragments); the last content chunk carries `finish_reason`. An error after the stream has started arrives as a final error chunk, not as an HTTP status.","uniqueKey":"","typeLabel":"string"},"examples":{"stream":{"title":"stream","summary":"Stream","value":"data: {\"id\":\"chatcmpl-…\",\"object\":\"chat.completion.chunk\",\"created\":1785229039,\"model\":\"zai-org/GLM-5.3\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" scattering\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-…\",\"object\":\"chat.completion.chunk\",\"created\":1785229039,\"model\":\"zai-org/GLM-5.3\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}]}\n\ndata: [DONE]"},"streamError":{"title":"streamError","summary":"Error after the stream started","value":"data: {\"error\":{\"message\":\"backend stream interrupted\",\"type\":\"api_error\"}}\n\ndata: [DONE]"}},"exampleType":"examples"}},"exampleType":"examples"},"c7649a47-03dc-46f4-b31b-3b9758ea76f5":{"description":"Invalid request: malformed JSON, a missing or wrongly typed field, an unsupported reasoning control, or image input to a model without vision.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"malformedJson":{"title":"malformedJson","summary":"Malformed JSON","value":{"error":{"message":"malformed JSON","type":"invalid_request_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"164ed742-e185-47b4-a959-2867972a53d0":{"description":"Missing, unknown, revoked, or expired API key, a key over its credit limit, or a management key.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"unknownKey":{"title":"unknownKey","summary":"Unknown API key","value":{"error":{"message":"unknown API key","type":"authentication_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"d5f0ba05-3855-46a8-b08c-fd1a6da0f505":{"description":"Your organization is out of credits. Top up on the [Billing](https://platform.pearlresearch.ai/billing) page, then retry.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"outOfCredits":{"title":"outOfCredits","summary":"Out of credits","value":{"error":{"message":"your organization is out of credits","type":"api_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"4da3772e-d5cc-458b-9bdb-391ab3f5b1b1":{"description":"Wrong endpoint for your organization's [inference region](/data-residency).","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"wrongRegion":{"title":"wrongRegion","summary":"Wrong endpoint for the region","value":{"error":{"message":"wrong endpoint for your organization's inference region","type":"permission_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"cc824085-50c4-43c2-ba02-0ed52ff0d690":{"description":"Unknown model (code `model_not_found`), or one this endpoint doesn't serve.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"unknownModel":{"title":"unknownModel","summary":"Unknown model","value":{"error":{"message":"unknown model","type":"invalid_request_error","code":"model_not_found","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"5455765a-b249-43c7-8904-1718a7f6b01e":{"description":"Request body over 20 MiB.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"bodyTooLarge":{"title":"bodyTooLarge","summary":"Body over 20 MiB","value":{"error":{"message":"request body over 20 MiB","type":"invalid_request_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"a9e79f59-35d8-41f7-922c-b0fedbb536f5":{"description":"A [rate limit](/plans) for your organization and the model was reached. Wait for the `Retry-After` header's seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rateLimited":{"title":"rateLimited","summary":"Rate limit reached","value":{"error":{"message":"rate limit reached","type":"rate_limit_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"2e0e82dc-e9e6-4be2-afc3-201115b81366":{"description":"Internal error. Safe to retry with backoff.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"internalError":{"title":"internalError","summary":"Internal error","value":{"error":{"message":"internal error","type":"api_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"75fe9f19-3434-4c94-9afa-b2cbc11a29ef":{"description":"The model server failed or returned a malformed response. Retry with backoff.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"modelServerFailed":{"title":"modelServerFailed","summary":"Model server failed","value":{"error":{"message":"the model server failed","type":"api_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"6ba32869-66b6-4e9c-af3f-6c172fa0b9ee":{"description":"Temporarily unavailable, for example during a deploy. Retry after the `Retry-After` header's seconds.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"unavailable":{"title":"unavailable","summary":"Temporarily unavailable","value":{"error":{"message":"temporarily unavailable","type":"api_error","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"},"cb7237e3-30bf-4c0f-94c5-0d7a8bc9f737":{"description":"No capacity for the model right now (code `no_capacity`). Retry with backoff.","headers":{"X-Request-ID":{"description":"The request ID. Send your own UUID in `X-Request-ID` to use it as the ID. Include the ID when you contact support.","schema":{"type":"string"},"example":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}},"content":{"application/json":{"schema":{"type":"object","description":"Errors are JSON in OpenAI's shape, with the request ID in the body.","properties":{"error":{"type":"object","properties":{"message":{"type":"string","uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"code":{"type":"string","description":"Present only when set, for example `model_not_found` or `no_capacity`.","uniqueKey":"error.code","typeLabel":"string"},"request_id":{"type":"string","description":"The request ID.","uniqueKey":"error.request_id","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"noCapacity":{"title":"noCapacity","summary":"No capacity","value":{"error":{"message":"no capacity for the model right now","type":"api_error","code":"no_capacity","request_id":"6f0b6e0a-6a8f-4c62-9b1e-3d2c1a0f9e87"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"6625f6de-e10e-440e-ad17-e151c962928e":{"inferenceKey":{"type":"http","scheme":"bearer","description":"`Bearer` followed by an inference API key (`sk-prl-infapi-`). Create keys on the [API Keys](https://platform.pearlresearch.ai/api-keys) page. Management keys (`sk-prl-mgmt-`) cannot call models.","scopes":[],"schemeName":"inferenceKey"}}},"servers":{"f6c31a79-dad6-4767-a559-ec5cffb3ed6a":{"url":"https://inference.pearlresearch.ai/v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"`Bearer` followed by an inference API key (`sk-prl-infapi-`). Create keys on the [API Keys](https://platform.pearlresearch.ai/api-keys) page. Management keys (`sk-prl-mgmt-`) cannot call models.","scopes":[],"schemeName":"inferenceKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"`Bearer` followed by an inference API key (`sk-prl-infapi-`). Create keys on the [API Keys](https://platform.pearlresearch.ai/api-keys) page. Management keys (`sk-prl-mgmt-`) cannot call models.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"inferenceKey","name":"Authorization"}],"title":"inferenceKey"}]},"originalFileLocation":"openapi/inference.yaml"},"subdomain":"pearl-research","siteName":"Pearl Inference Platform","title":"Chat completions - Pearl Inference Platform","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-16T15:31:08.146Z","originalFileLocation":"reference/chat-completions.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Pearl Inference Platform\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_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=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Chat completions - Pearl Inference Platform\">\u003cmeta data-mint-head property=\"og:description\" content=\"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Pearl Inference Platform\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://platform.pearlresearch.ai/docs/reference/chat-completions\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pearl-research.mintlify.site/docs/_mintlify/api/og/v2?division=Inference+API\u0026amp;title=Chat+completions\u0026amp;description=The+primary+inference+endpoint%2C+OpenAI-compatible+chat+with+streaming%2C+tools%2C+JSON+mode%2C+reasoning%2C+and+vision.\u0026amp;theme=8053f473600c09a776e77e44\u0026amp;signature=0555480dcd9106aba0fbb4fa52fd0b065e3ff3530603024a4cbf231a3394cdfe\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Chat completions - Pearl Inference Platform\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pearl-research.mintlify.site/docs/_mintlify/api/og/v2?division=Inference+API\u0026amp;title=Chat+completions\u0026amp;description=The+primary+inference+endpoint%2C+OpenAI-compatible+chat+with+streaming%2C+tools%2C+JSON+mode%2C+reasoning%2C+and+vision.\u0026amp;theme=8053f473600c09a776e77e44\u0026amp;signature=0555480dcd9106aba0fbb4fa52fd0b065e3ff3530603024a4cbf231a3394cdfe\">\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=\"/docs/mintlify-assets/_mintlify/favicons/pearl-research/k9be1f6J_artjsFA/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Pearl Inference Platform\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2A2623\">\u003clink data-mint-head rel=\"canonical\" href=\"https://platform.pearlresearch.ai/docs/reference/chat-completions\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/reference/chat-completions.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://platform.pearlresearch.ai/#organization\",\"name\":\"Pearl Inference Platform\",\"url\":\"https://platform.pearlresearch.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pearl-research/qjVPdghcpi_iWwgo/logo/light.svg?fit=max\u0026auto=format\u0026n=qjVPdghcpi_iWwgo\u0026q=85\u0026s=a969569c61ca3aa40012ac0f3dbbe445\"}},{\"@type\":\"WebSite\",\"@id\":\"https://platform.pearlresearch.ai/docs#website\",\"name\":\"Pearl Inference Platform\",\"url\":\"https://platform.pearlresearch.ai/docs\",\"publisher\":{\"@id\":\"https://platform.pearlresearch.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions#webpage\",\"url\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions\",\"name\":\"Chat completions\",\"description\":\"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\",\"dateModified\":\"2026-11-16T15:31:08.146Z\",\"isPartOf\":{\"@id\":\"https://platform.pearlresearch.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Inference API\",\"item\":\"https://platform.pearlresearch.ai/docs/reference/inference\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chat completions\",\"item\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions#apireference\",\"headline\":\"Chat completions\",\"name\":\"Chat completions\",\"description\":\"The primary inference endpoint, OpenAI-compatible chat with streaming, tools, JSON mode, reasoning, and vision.\",\"url\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions\",\"mainEntityOfPage\":{\"@id\":\"https://platform.pearlresearch.ai/docs/reference/chat-completions#webpage\"},\"dateModified\":\"2026-11-16T15:31:08.146Z\",\"publisher\":{\"@id\":\"https://platform.pearlresearch.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://platform.pearlresearch.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Pearl Inference Platform\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Pearl Inference Platform\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/reference/chat-completions.md","siteName":"Pearl Inference Platform","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":""}]},{"tab":"API Reference","groups":[{"group":"Inference API","pages":[{"title":"Overview","description":"The data-plane API your applications call to run models: OpenAI- and Anthropic-compatible endpoints behind one base URL.","href":"/reference/inference"},{"title":"Chat completions","deprecated":null,"version":null,"sidebarTitle":"Chat completions","openapi":"/openapi/inference.yaml post /chat/completions","href":"/reference/chat-completions"},{"title":"Responses","description":"Stateless response creation with native JSON and SSE responses.","deprecated":null,"version":null,"sidebarTitle":"Responses","openapi":"/openapi/inference.yaml post /responses","href":"/reference/responses"},{"title":"Messages","deprecated":null,"version":null,"sidebarTitle":"Messages","openapi":"/openapi/inference.yaml post /messages","href":"/reference/messages"},{"title":"Count tokens","deprecated":null,"version":null,"sidebarTitle":"Count tokens","openapi":"/openapi/inference.yaml post /messages/count_tokens","href":"/reference/messages/count-tokens"},{"title":"Completions (legacy)","deprecated":null,"version":null,"sidebarTitle":"Completions (legacy)","openapi":"/openapi/inference.yaml post /completions","href":"/reference/completions"},{"title":"List models","deprecated":null,"version":null,"sidebarTitle":"List models","openapi":"/openapi/inference.yaml get /models","href":"/reference/models"}]},{"group":"Management API","pages":[{"title":"Overview","href":"/reference/management"},{"title":"Rate limits","href":"/reference/management/rate-limits"},{"title":"Get credits","deprecated":null,"version":null,"sidebarTitle":"Credits","openapi":"/openapi/management.yaml get /credits","href":"/reference/management/credits"},{"title":"Get current API key","deprecated":null,"version":null,"sidebarTitle":"Current API key","openapi":"/openapi/management.yaml get /key","href":"/reference/management/key"},{"title":"Get activity","deprecated":null,"version":null,"sidebarTitle":"Activity","openapi":"/openapi/management.yaml get /activity","href":"/reference/management/activity"}]}]}]},"basePath":"","title":"Chat completions - Pearl Inference Platform","deploymentId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","buildId":"dpl_53YqbBPsHdrqSGqXiWPGU7csRVod","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Ku9dSkH0.js","snippetPresets-Cjez4eet.js","utils-BqNa-fnS.js","style-to-object-BY3JEAdk.js","utils-DiE92JCe.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-Bi0DpqVf.js","conditional-requirements-CFM0id0Q.js","cloneDeep-C6xnxscF.js","_Uint8Array-B7g0OYAt.js","isObject-FP1Yky1u.js","ApiExamples-Bf8Ecb5t.js","usePlaygroundInputsStore-BA942cq6.js","shallow-D0sePNkF.js","isEqual-CnnQO8sL.js","CodeSnippets-BTANoy1T.js","CodeSnippet-CTZvgJfu.js","getApiPlaygroundDisplay-BK2o1XYu.js","Page--B9YZ09u.js","DynamicMarkdown-CsgNpZb1.js","SectionHeading-C3K437Dy.js","icon-DlxjjqnB.js","MethodPill-Cr7Ib9nN.js","getPastedJson-DXo3wtHt.js","Check2Icon-ChEI-f_B.js","axios-CsQoIw0U.js","Markdown-CH4mv0N8.js","AssistantPageLink-BHjmqccN.js","dist-DYCPzQwJ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}