Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

meta-docs.json

17 lines284.9 KB

1{
2 "https://dev.meta.ai/docs/models": "<h1 id=\"models\"><a href=\"#models\">Models</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Meta ships five model families. <strong>Muse Spark</strong>, <strong>Muse Image</strong>, <strong>Muse Voice Transcribe</strong>, and <strong>Segment Anything Model (SAM)</strong> are hosted on Meta Model API and called over the endpoints in these docs; <strong>Muse Glimmer</strong> is open-weight and runs on your own hardware. This page summarizes each and points you to where to go next.</p>\n<h2 id=\"muse-spark\"><a href=\"#muse-spark\">Muse Spark</a></h2>\n<p>Muse Spark is Meta&#x27;s model for agentic and coding work \u2014 multi-step tool loops, software engineering assistants, and long-context reasoning. Use it for <a href=\"/docs/protocols/chat-completions\">chat completion</a>, <a href=\"/docs/image-understanding\">image understanding</a>, <a href=\"/docs/video-understanding\">video and audio understanding</a>, <a href=\"/docs/tool-calling\">tool calling</a>, <a href=\"/docs/structured-output\">structured output</a>, and <a href=\"/docs/search-grounding\">search grounding</a>.</p>\n<p>Muse Spark comes in three versions, each sharing the same modalities and context window, and differing only by capability:</p>\n<ul>\n<li><strong>Muse Spark 1.3</strong> (<code>muse-spark-1.3</code>): the latest version, tuned for agentic workflows (multi-step tool, browser, and long-horizon tasks) with improved coding over 1.2. Supports all <a href=\"/docs/reasoning\">reasoning effort</a> levels, including the <code>&quot;max&quot;</code> level for extended reasoning (available on Standard tier only). <strong>Recommended for new work.</strong></li>\n<li><strong>Muse Spark 1.2</strong> (<code>muse-spark-1.2</code>): the previous version.</li>\n<li><strong>Muse Spark 1.1</strong> (<code>muse-spark-1.1</code>): the original version.</li>\n</ul>\n<p><code>muse-spark-1.3</code> is the default model in the code examples throughout these docs.</p>\n<h3 id=\"available-muse-spark-models\"><a href=\"#available-muse-spark-models\">Available Muse Spark models</a></h3>\n<table><thead><tr><th>Model ID</th><th>Tier</th><th>Input modalities</th><th>Output modalities</th><th>Context window</th></tr></thead><tbody><tr><td><code>muse-spark-1.3</code></td><td><a href=\"/docs/pricing-rate-limits#standard-tier\">Standard</a></td><td>Text, image, video, audio*, PDF</td><td>Text</td><td>1,048,576 tokens</td></tr><tr><td><code>muse-spark-1.3-contributor</code></td><td><a href=\"/docs/pricing-rate-limits#contributor-tier\">Contributor</a></td><td>Text, image, video, audio*, PDF</td><td>Text</td><td>1,048,576 tokens</td></tr><tr><td><code>muse-spark-1.2</code></td><td><a href=\"/docs/pricing-rate-limits#standard-tier\">Standard</a></td><td>Text, image, video, audio, PDF</td><td>Text</td><td>1,048,576 tokens</td></tr><tr><td><code>muse-spark-1.2-contributor</code></td><td><a href=\"/docs/pricing-rate-limits#contributor-tier\">Contributor</a></td><td>Text, image, video, audio, PDF</td><td>Text</td><td>1,048,576 tokens</td></tr><tr><td><code>muse-spark-1.1</code></td><td><a href=\"/docs/pricing-rate-limits#standard-tier\">Standard</a></td><td>Text, image, video, audio, PDF</td><td>Text</td><td>1,048,576 tokens</td></tr></tbody></table>\n<blockquote>\n<p>* Audio understanding in Muse Spark 1.3 is currently not fully supported, and response quality for requests including audio content may be degraded. For audio, use Muse Spark 1.2, or <a href=\"#muse-voice-transcribe\">Muse Voice Transcribe</a> for dedicated speech-to-text.</p>\n</blockquote>\n<h3 id=\"tiers\"><a href=\"#tiers\">Tiers</a></h3>\n<p>Every version is offered on the <strong>Standard</strong> tier (standard pricing; your data is never used for training). Versions 1.3 and 1.2 also offer a discounted <strong><a href=\"/docs/pricing-rate-limits#contributor-tier\">Contributor</a></strong> variant (<code>muse-spark-1.3-contributor</code>, <code>muse-spark-1.2-contributor</code>) that trades a lower price for permission to train on your prompts and completions \u2014 room to prototype and scale experiments where that&#x27;s acceptable. See <a href=\"/docs/pricing-rate-limits\">Pricing and rate limits</a> for per-tier rates.</p>\n<h2 id=\"muse-image\"><a href=\"#muse-image\">Muse Image</a></h2>\n<p>Muse Image is a separate model family that <strong>outputs images</strong> rather than text. Send a text prompt (and optional reference images) and get an image back, or send an image with an instruction to edit it. One model handles both generation and editing. It&#x27;s agentic, so it can search the web for visual references and current facts and run code to build layouts before it renders.</p>\n<table><thead><tr><th>Model ID</th><th>Family</th><th>Input</th><th>Output</th></tr></thead><tbody><tr><td><code>muse-image-1.0</code></td><td>Muse Image</td><td>Text, image</td><td>Image</td></tr></tbody></table>\n<p>Reach Muse Image two ways: the <a href=\"/docs/protocols/responses\">Responses API</a> for conversational, multi-turn editing, or the single-shot <a href=\"/docs/api-reference/images/create-image\"><code>/v1/images/generations</code></a> and <a href=\"/docs/api-reference/images/edit-image\"><code>/v1/images/edits</code></a> endpoints for one-off calls. See the <a href=\"/docs/image-generation\">Image generation</a> guide to get started.</p>\n<h2 id=\"muse-voice-transcribe\"><a href=\"#muse-voice-transcribe\">Muse Voice Transcribe</a></h2>\n<p>Muse Voice Transcribe is Meta&#x27;s speech-to-text model on Meta Model API. Use it to transcribe live audio streams or supported audio files.</p>\n<table><thead><tr><th>Model ID</th><th>Family</th><th>Input</th><th>Output</th></tr></thead><tbody><tr><td><code>muse-voice-transcribe-1.0</code></td><td>Muse Voice Transcribe</td><td>Audio</td><td>Text transcript</td></tr></tbody></table>\n<p>Muse Voice Transcribe is built for real-time speech products: voice agents, meeting and call intelligence, live transcription, dictation, captioning, and high-volume transcription. It supports streaming speaker diarization, native endpointing and voice activity detection, contextual and keyword biasing, 25 evaluated languages with code-switching, and turn-level timestamps.</p>\n<p>It returns transcript text. It does not synthesize speech or provide a speech-to-speech conversation API. It does not provide word-level timestamps, sound event detection, or emotion detection.</p>\n<p>Reach Muse Voice Transcribe two ways: the realtime WebSocket endpoint (<code>wss://api.meta.ai/v1/asr/realtime</code>) for live audio, or the file endpoint (<a href=\"/docs/api-reference/voice/transcribe\"><code>POST /v1/asr/transcribe</code></a>) for a recording you already have.</p>\n<p>Start with the <a href=\"/docs/speech-to-text\">Muse Voice Transcribe guide</a>. See <a href=\"/docs/pricing-rate-limits#muse-voice-transcribe-pricing\">Pricing and rate limits</a> for audio pricing.</p>\n<h2 id=\"sam-3\"><a href=\"#sam-3\">Segment Anything Model</a></h2>\n<p>SAM 3.1 is Meta&#x27;s segmentation model on Meta Model API. Give it a short noun phrase such as &quot;yellow school bus&quot; with an image or video, and it returns every match as a box and a pixel-accurate mask. One model handles both stills and clips, and in video it follows each object across frames.</p>\n<table><thead><tr><th>Model ID</th><th>Family</th><th>Input</th><th>Output</th></tr></thead><tbody><tr><td><code>sam-3.1</code></td><td>Segment Anything Model</td><td>Text prompt, image, video</td><td>Boxes and masks</td></tr></tbody></table>\n<p>Reach SAM 3.1 over the <a href=\"/docs/protocols/responses\">Responses API</a> (<a href=\"/docs/api-reference/responses/create-response\"><code>POST /v1/responses</code></a>), and upload clips through the <a href=\"/docs/file-handling\">Files API</a> when you segment them more than once. See the <a href=\"/docs/media-segmentation\">Media segmentation</a> guide to get started.</p>\n<h2 id=\"muse-glimmer\"><a href=\"#muse-glimmer\">Muse Glimmer</a></h2>\n<p>Muse Glimmer is Meta&#x27;s open-weight multimodal model, distilled from Muse Spark and built to run on your own hardware. Unlike Muse Spark, Muse Image, Muse Voice Transcribe, and SAM, you don&#x27;t call it over Model API \u2014 you download the weights and serve it through a runtime such as vLLM, SGLang, llama.cpp, or ExecuTorch.</p>\n<p>Muse Glimmer lives in the <a href=\"/docs/open-weight-models\">Open-weight models</a> section, covering how to get, prompt, deploy, and customize the model:</p>\n<ul>\n<li><strong><a href=\"/docs/muse-glimmer\">Muse Glimmer overview</a></strong>: variants, architecture, license, and launch partners.</li>\n<li><strong><a href=\"/docs/muse-glimmer/get-the-model\">Get the model</a></strong>: download the weights and verify your setup.</li>\n<li><strong><a href=\"/docs/muse-glimmer/deploy\">Run inference</a></strong>: pick a runtime and serve it locally.</li>\n</ul>\n<h2 id=\"model-availability\"><a href=\"#model-availability\">Model availability</a></h2>\n<p>Each model is served on a specific set of Meta Model API endpoints. Find where to call the one you want:</p>\n<table><thead><tr><th>Model</th><th>Available on</th></tr></thead><tbody><tr><td><a href=\"#muse-spark\">Muse Spark</a></td><td><a href=\"/docs/protocols/responses\">Responses</a>, <a href=\"/docs/protocols/chat-completions\">Chat Completions</a>, <a href=\"/docs/protocols/messages\">Messages</a></td></tr><tr><td><a href=\"#muse-image\">Muse Image</a></td><td><a href=\"/docs/protocols/responses\">Responses</a>, <a href=\"/docs/image-generation\">Image generation</a></td></tr><tr><td><a href=\"#muse-voice-transcribe\">Muse Voice Transcribe</a></td><td><a href=\"/docs/speech-to-text\">Transcribe</a></td></tr><tr><td><a href=\"#sam-3\">Segment Anything Model</a></td><td><a href=\"/docs/protocols/responses\">Responses</a>, <a href=\"/docs/media-segmentation\">Media segmentation</a></td></tr></tbody></table>\n<p><a href=\"#muse-glimmer\">Muse Glimmer</a> is self-hosted and isn&#x27;t served on any Meta Model API endpoint.</p>\n<h2 id=\"list-models\"><a href=\"#list-models\">List models via the API</a></h2>\n<p>Query the catalog programmatically when you need to check what&#x27;s enabled for your team. This returns the API-hosted models; self-hosted Muse Glimmer isn&#x27;t included.</p>\n<nav><button type=\"button\" id=\"_R_2dav5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_2dav5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_2dav5tl5iv6rlb_-tab-2\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure>\n<p>The response returns models sorted newest-first by creation time, with the model ID as a stable tiebreaker. Each object includes a <code>created</code> field \u2014 the Unix timestamp in seconds for when the model was added to the registry. <code>GET /v1/models/{model}</code> returns the same <code>created</code> value for a single model.</p>\n<h2 id=\"next-steps\"><a href=\"#next-steps\">Next steps</a></h2>\n<ul>\n<li><a href=\"/docs/quickstart#first-call\">Get started</a>: make your first call with Muse Spark</li>\n<li><a href=\"/docs/pricing-rate-limits\">Pricing and rate limits</a>: see rates and retry guidance</li>\n<li><a href=\"/docs/protocols/chat-completions\">Chat completion</a>: start generating with the core conversational endpoint</li>\n</ul><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
3 "https://dev.meta.ai/docs/pricing-rate-limits": "<h1 id=\"pricing-and-rate-limits\"><a href=\"#pricing-and-rate-limits\">Pricing and rate limits</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<h2 id=\"pricing\"><a href=\"#pricing\">Pricing</a></h2>\n<p>You pay only for what you use. Meta Model API bills text models per token, image generation per image, Muse Voice Transcribe per minute of audio processed, and Segment Anything Model (SAM) per image or video frame segmented, with no minimums or upfront commitment.</p>\n<h3 id=\"standard-tier\"><a href=\"#standard-tier\">Standard tier</a></h3>\n<p>Models: <code>muse-spark-1.3</code>, <code>muse-spark-1.2</code>, <code>muse-spark-1.1</code>.</p>\n<p>Standard pricing; your prompts and completions are not used to train Meta models. These versions share the same standard pricing:</p>\n<table><thead><tr><th>Usage</th><th>Price per 1M tokens</th></tr></thead><tbody><tr><td>Cached input</td><td>$0.15</td></tr><tr><td>Input</td><td>$1.25</td></tr><tr><td>Output</td><td>$4.25</td></tr></tbody></table>\n<h3 id=\"contributor-tier\"><a href=\"#contributor-tier\">Contributor tier</a></h3>\n<p>Models: <code>muse-spark-1.3-contributor</code>, <code>muse-spark-1.2-contributor</code>.</p>\n<p>Heavily discounted token pricing in exchange for permission to use your prompts and completions to train future Meta models. It lowers the barrier to entry for prototyping, testing integrations, and scaling experiments where training on your data is acceptable.</p>\n<table><thead><tr><th>Usage</th><th>Price per 1M tokens</th></tr></thead><tbody><tr><td>Cached input</td><td>$0.002</td></tr><tr><td>Input</td><td>$0.10</td></tr><tr><td>Output</td><td>$0.20</td></tr></tbody></table>\n<h3 id=\"muse-voice-transcribe-pricing\"><a href=\"#muse-voice-transcribe-pricing\">Muse Voice Transcribe</a></h3>\n<p><a href=\"/docs/speech-to-text\">Muse Voice Transcribe</a> is billed by minutes of audio processed.</p>\n<table><thead><tr><th>Usage</th><th>Price</th></tr></thead><tbody><tr><td>Audio processed</td><td>$0.18 per hour</td></tr></tbody></table>\n<p>Streaming and non-streaming transcription are priced the same. ZDR is priced at parity with Standard, and platform free-tier credits apply. The training-eligible discounted tier is not available for Muse Voice Transcribe at launch. Audio time is billed as a separate line item from token usage (rounded down to whole seconds); other endpoints are not billed for audio seconds.</p>\n<h3 id=\"shared-pricing-notes\"><a href=\"#shared-pricing-notes\">Shared pricing notes</a></h3>\n<p>Cached input costs less. When part of your prompt matches a <a href=\"/docs/prompt-caching\">cached prefix</a>, you pay the cached-input rate for those tokens. Check <code>cached_tokens</code> in the response to see how many were served from cache.</p>\n<p><strong>Web search grounding</strong> costs <strong>$2.50 per 1,000 search queries</strong>, in addition to the request&#x27;s token cost. This applies to the <a href=\"/docs/search-grounding\"><code>web_search</code> tool</a> on text models such as <a href=\"/docs/models#muse-spark\">Muse Spark</a>.</p>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z\"></path></svg>Muse Image search is included<p><a href=\"/docs/models#muse-image\">Muse Image</a>&#x27;s built-in web and image search is part of its per-image price and isn&#x27;t charged separately. See <a href=\"#image-generation\">Image generation</a>.</p>\n<p>There is <strong>no long-context premium</strong>: you pay the same rate whether your context window is mostly empty or almost full.</p>\n<h3 id=\"image-generation\"><a href=\"#image-generation\">Image generation (Muse Image)</a></h3>\n<p><a href=\"/docs/models#muse-image\">Muse Image</a> is billed at a flat <strong>$0.01 per generated image</strong>. The price is the same regardless of prompt length, <code>reasoning_strength</code>, or the tools the model uses during generation, including its built-in web and image search, which isn&#x27;t charged separately. A request that returns <code>n</code> images is billed for <code>n</code> images. You&#x27;re billed only for images the model successfully generates and returns: images that fail to generate, or that are removed by safety filtering before they&#x27;re returned, aren&#x27;t counted. Image responses still include a <code>usage</code> object with token counts for reference, but image generation tokens are not included in token-based pricing for other models. See the <a href=\"/docs/image-generation#images-response\">Image generation</a> guide for the response shape.</p>\n<h3 id=\"sam-pricing\"><a href=\"#sam-pricing\">Segment Anything Model 3.1</a></h3>\n<p><a href=\"/docs/models#sam-3\">SAM 3.1</a> segmentation is billed per image and per video frame, not per token. The same prices apply to streaming and non-streaming requests.</p>\n<table><thead><tr><th>Usage</th><th>Price</th></tr></thead><tbody><tr><td>Image segmentation</td><td>$2.50 per 1,000 images</td></tr><tr><td>Video segmentation</td><td>$0.20 per 1,000 frames</td></tr></tbody></table>\n<h2 id=\"rate-limits\"><a href=\"#rate-limits\">Rate limits</a></h2>\n<p>Rate limits control usage for your team and are set by pricing tier or model family.</p>\n<p>For token-based models, the Standard tier covers <code>muse-spark-1.3</code>, <code>muse-spark-1.2</code>, and <code>muse-spark-1.1</code>; the Contributor tier covers <code>muse-spark-1.3-contributor</code> and <code>muse-spark-1.2-contributor</code>.</p>\n<table><thead><tr><th>Tier</th><th>Requests per minute (RPM)</th><th>Tokens per minute (TPM)</th></tr></thead><tbody><tr><td>Standard</td><td>3,000</td><td>4,000,000</td></tr><tr><td>Contributor</td><td>100</td><td>3,000,000</td></tr></tbody></table>\n<p><a href=\"/docs/models#muse-image\">Muse Image</a> (<code>muse-image-1.0</code>) has a separate limit of <strong>150 requests per minute</strong>. Because it&#x27;s <a href=\"#image-generation\">priced per image</a> rather than per token, it has no tokens-per-minute limit.</p>\n<p><a href=\"/docs/models#sam-3\">SAM 3.1</a> segmentation has no separate per-model rate limit; its requests count toward your team&#x27;s tier limit \u2014 <strong>3,000 RPM on the Standard tier</strong> (see the table above).</p>\n<p>Limits apply <strong>per team, not per API key</strong>. If you use multiple keys in one team, all requests, tokens, images, and audio minutes count toward the relevant shared quota.</p>\n<p>Token usage counts only <strong>your</strong> input and output tokens. Meta injects a small amount of steering context into every prompt (a system prompt and related scaffolding); those injected tokens are not billed and are excluded from the token counts reported in your <code>usage</code> and by the <a href=\"/docs/token-counting#injected-tokens\">token-counting endpoints</a>.</p>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z\"></path></svg>Muse Voice Transcribe is metered differently<p>RPM and TPM do not apply to <a href=\"/docs/speech-to-text\">Muse Voice Transcribe</a>, which is metered by audio minutes and limited by active streams and streams started over time. See <a href=\"#muse-voice-transcribe-rate-limits\">Rate limits for Muse Voice Transcribe</a>.</p>\n<h2 id=\"rate-limit-behavior\"><a href=\"#rate-limit-behavior\">Retry on 429 responses</a></h2>\n<p>If you exceed a request, token, image, audio, or stream-start limit, the API returns a rate-limit response. Requests succeed again once usage drops below the limit.</p>\n<p><strong>Retry strategy:</strong> Use exponential backoff with jitter. Start with a short delay such as 500 ms, double it after each consecutive rate-limit response, and add random jitter to avoid thundering-herd effects across concurrent clients.</p>\n<h2 id=\"rate-limit-headers\"><a href=\"#rate-limit-headers\">Read rate-limit headers</a></h2>\n<p>Every successful token-based response includes headers that report your current limit and remaining quota:</p>\n<table><thead><tr><th>Header</th><th>Description</th></tr></thead><tbody><tr><td><code>x-ratelimit-limit-tokens</code></td><td>Total token budget for the current window.</td></tr><tr><td><code>x-ratelimit-remaining-tokens</code></td><td>Tokens remaining before you hit the limit.</td></tr><tr><td><code>x-ratelimit-limit-requests</code></td><td>Total request budget for the current window.</td></tr><tr><td><code>x-ratelimit-remaining-requests</code></td><td>Requests remaining before you hit the limit.</td></tr></tbody></table>\n<p>Read these headers and slow down before you hit a rate limit instead of reacting after one.</p>\n<h2 id=\"background-rate-limit\"><a href=\"#background-rate-limit\">Submit background responses within limits</a></h2>\n<p>Creating <a href=\"/docs/protocols/responses#using-with-other-features\">background responses</a> (<code>background: true</code>) counts against a separate per-team submission limit in addition to the RPM and TPM limits above. The default is <strong>600 background submissions per minute, per team</strong>.</p>\n<p>If you exceed that cap, new background submissions return <code>HTTP 429 Too Many Requests</code> with a <code>Retry-After</code> header. Responses already running continue unaffected. Apply the same exponential-backoff-with-jitter strategy described above.</p>\n<p>The cap applies only to starting new background responses. Standard RPM and TPM limits still apply to every request.</p>\n<h2 id=\"muse-voice-transcribe-rate-limits\"><a href=\"#muse-voice-transcribe-rate-limits\">Rate limits for Muse Voice Transcribe</a></h2>\n<p><a href=\"/docs/speech-to-text\">Muse Voice Transcribe</a> is limited by stream usage rather than tokens. Two dimensions are enforced at once:</p>\n<table><thead><tr><th></th><th>Limit</th></tr></thead><tbody><tr><td>Concurrent streams</td><td>128</td></tr><tr><td>Streams per hour</td><td>16,000</td></tr></tbody></table>\n<p><strong>Concurrent streams</strong> caps how many streaming sessions you hold open at the same moment. <strong>Streams per hour</strong> limits how many transcription sessions you start.</p>\n<p>Both realtime and file transcription use the same budget. A rejected realtime stream closes with <code>1013</code>. A rejected file-transcription request returns <code>HTTP 429 Too Many Requests</code>.</p>\n<h2 id=\"next-steps\"><a href=\"#next-steps\">Next steps</a></h2>\n<ul>\n<li><a href=\"/docs/speech-to-text\">Muse Voice Transcribe</a>: stream audio or transcribe a file</li>\n<li><a href=\"/docs/authentication\">Authentication</a>: create and manage API keys</li>\n<li><a href=\"/docs/quickstart#first-call\">Get started</a>: make your first API call</li>\n<li><a href=\"/docs/protocols/chat-completions\">Chat completion</a>: start generating text with the core conversational endpoint</li>\n</ul><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
4 "https://dev.meta.ai/docs/reasoning": "<h1 id=\"reasoning\"><a href=\"#reasoning\">Reasoning</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Solve harder problems by giving the model more time to think. <a href=\"/docs/models#muse-spark\">Muse Spark</a> is a reasoning model: it generates internal reasoning tokens before visible output, and you control how much with <code>reasoning_effort</code>.</p>\n<h2 id=\"how-it-works\"><a href=\"#how-it-works\">How it works</a></h2>\n<p>When you send a request, the model works through the problem internally first. That reasoning stays private and does not appear in the response body. Reasoning tokens count toward your output-token budget (<code>max_tokens</code> on Chat Completions, <code>max_output_tokens</code> on the Responses API) and toward billed completion tokens.</p>\n<p>Set <code>reasoning_effort</code> to choose depth:</p>\n<table><thead><tr><th>Value</th><th>Behavior</th></tr></thead><tbody><tr><td><code>&quot;none&quot;</code></td><td>Disables reasoning. <strong>Not supported by Muse Spark</strong>: returns <code>HTTP 400</code>.</td></tr><tr><td><code>&quot;minimal&quot;</code></td><td>Shortest reasoning pass.</td></tr><tr><td><code>&quot;low&quot;</code></td><td>Light reasoning.</td></tr><tr><td><code>&quot;medium&quot;</code></td><td>Moderate depth.</td></tr><tr><td><code>&quot;high&quot;</code></td><td>Deep reasoning.</td></tr><tr><td><code>&quot;xhigh&quot;</code></td><td>Deeper reasoning.</td></tr><tr><td><code>&quot;max&quot;</code></td><td>Extended reasoning beyond <code>&quot;xhigh&quot;</code>. Standard-tier <code>muse-spark-1.3</code> only; not available on Contributor-tier models.</td></tr></tbody></table>\n<p>Higher effort means more reasoning \u2014 and more reasoning tokens, latency, and cost. <code>&quot;none&quot;</code> disables reasoning entirely, which Muse Spark does not support.</p>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z\"></path></svg>Max reasoning<p>The <code>&quot;max&quot;</code> level on Standard-tier Muse Spark 1.3 goes beyond <code>&quot;xhigh&quot;</code>: the model spends more time reasoning before responding, using more reasoning tokens at the same per-token price as other effort levels. This level is not available on Contributor-tier models.</p>\n<p>When you omit the parameter, the model still reasons at a model-determined level.</p>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z\"></path></svg>Where to set reasoning effort<p>On <a href=\"/docs/protocols/chat-completions\">Chat Completions</a>, use the top-level <code>reasoning_effort</code> parameter. On the <a href=\"/docs/protocols/responses\">Responses API</a>, nest it as <code>reasoning.effort</code>.</p>\n<h2 id=\"usage\"><a href=\"#usage\">Usage</a></h2>\n<h3 id=\"chat-completions\"><a href=\"#chat-completions\">Chat Completions</a></h3>\n<p>Send <code>reasoning_effort</code> at the top level of a chat completion request:</p>\n<nav><button type=\"button\" id=\"_R_tav5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_tav5tl5iv6rlb_-tab-1\">TypeScript (OpenAI SDK)TypeScript (OpenAI SDK)</button><button type=\"button\" id=\"_R_tav5tl5iv6rlb_-tab-2\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_tav5tl5iv6rlb_-tab-3\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure><figure></figure>\n<h3 id=\"responses-api\"><a href=\"#responses-api\">Responses API</a></h3>\n<p>On the Responses API, nest the same control as <code>reasoning.effort</code>:</p>\n<nav><button type=\"button\" id=\"_R_13av5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_13av5tl5iv6rlb_-tab-1\">TypeScript (OpenAI SDK)TypeScript (OpenAI SDK)</button><button type=\"button\" id=\"_R_13av5tl5iv6rlb_-tab-2\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_13av5tl5iv6rlb_-tab-3\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure><figure></figure>\n<h3 id=\"logprobs\"><a href=\"#logprobs\">Log probabilities</a></h3>\n<p>Muse Spark is a reasoning model, so <code>logprobs</code> is not supported. <code>logprobs: true</code> (Chat Completions) and <code>include: [&quot;message.output_text.logprobs&quot;]</code> (Responses API) both return <code>HTTP 400</code>.</p>\n<h2 id=\"multi-turn\"><a href=\"#multi-turn\">Multi-turn reasoning</a></h2>\n<p>You can carry reasoning context across turns so follow-ups build on earlier thinking. How you preserve it depends on the endpoint.</p>\n<h3 id=\"responses-api-1\"><a href=\"#responses-api-1\">Responses API</a></h3>\n<p>Chain turns with <code>previous_response_id</code>. The server keeps reasoning context for you:</p>\n<figure></figure>\n<p>For stateless replay, where you manage history yourself instead of chaining response IDs, request the model&#x27;s encrypted reasoning with <code>include: [&quot;reasoning.encrypted_content&quot;]</code> and replay it as a <code>reasoning</code> input item on the next turn. See <a href=\"/docs/protocols/responses#reasoning-items\">reasoning items in multi-turn input</a> for the full pattern.</p>\n<h3 id=\"chat-completions-1\"><a href=\"#chat-completions-1\">Chat Completions</a></h3>\n<p>Chat Completions cannot carry reasoning across turns for external API keys. Assistant messages expose a <code>reasoning_content</code> field, but it holds the model&#x27;s <strong>private</strong> chain of thought and is <strong>redacted to empty</strong> before the response reaches an external caller, so there is nothing to replay and each turn reasons from scratch. It is populated only for internal callers holding the <code>internal:private_cot</code> attribute. Do not rely on <code>reasoning_content</code> for multi-turn continuity on this endpoint. For multi-step and agentic workloads where preserving chain of thought matters, use the Responses API above, which replays reasoning through encrypted content or <code>previous_response_id</code>.</p>\n<h2 id=\"summaries\"><a href=\"#summaries\">Reasoning summaries</a></h2>\n<p>The raw chain of thought stays private, but on the <a href=\"/docs/protocols/responses\">Responses API</a> you can request a natural-language <strong>summary</strong> of it. Set <code>reasoning.summary</code> to <code>&quot;auto&quot;</code>, <code>&quot;concise&quot;</code>, or <code>&quot;detailed&quot;</code>:</p>\n<figure></figure>\n<p>Each profile controls how much reasoning the summary captures:</p>\n<table><thead><tr><th>Profile</th><th>Behavior</th></tr></thead><tbody><tr><td><code>&quot;auto&quot;</code></td><td>Compact summary, typically about one sentence. Best for most use cases.</td></tr><tr><td><code>&quot;concise&quot;</code></td><td>Brief multi-sentence summary focused on the key reasoning steps.</td></tr><tr><td><code>&quot;detailed&quot;</code></td><td>Longer summary that preserves more of the reasoning chain&#x27;s structure.</td></tr></tbody></table>\n<p>Summary length varies with reasoning complexity; these are targets, not guarantees.</p>\n<p>When a summary is generated, it is returned in the <code>summary</code> array of the response&#x27;s <code>reasoning</code> output item, and in <a href=\"/docs/protocols/responses#streaming\">streaming</a> mode it is delivered as <code>response.reasoning_summary_text.delta</code> / <code>response.reasoning_summary_text.done</code> events.</p>\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"1em\" height=\"1em\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12 3a9 9 0 100 18 9 9 0 000-18zm0 4a1 1 0 100 2 1 1 0 000-2zm-.75 3.75a.75.75 0 011.5 0v5.5a.75.75 0 01-1.5 0v-5.5z\"></path></svg>Summaries aren&#x27;t guaranteed<p>A summary is not guaranteed on every response. If the model does little or no private reasoning for a turn, or no summary is produced, the <code>summary</code> array is empty (<code>[]</code>). Treat the summary as optional output.</p>\n<p>Request summaries with the <code>reasoning.summary</code> field; the older <code>generate_summary</code> alias is deprecated and does not request one. A summary is human-readable explanatory text, distinct from the opaque <code>encrypted_content</code> used for <a href=\"#multi-turn\">multi-turn replay</a>. Reasoning summaries are a Responses API feature. Chat Completions does not expose <code>reasoning.summary</code>.</p>\n<h2 id=\"token-usage\"><a href=\"#token-usage\">Token usage</a></h2>\n<p>Reasoning tokens count toward both your output-token limit and billed completion tokens:</p>\n<ul>\n<li><strong>Output-token limit</strong>: <code>max_tokens</code> (Chat Completions) and <code>max_output_tokens</code> (Responses API) cap reasoning tokens plus visible output tokens combined. If the model spends most of the budget on reasoning, the visible response may be truncated. Set the limit high enough to accommodate both.</li>\n<li><strong>Billing</strong>: Reasoning tokens are billed at the same rate as visible output tokens. The <code>usage</code> breakdown reports them separately as <code>completion_tokens_details.reasoning_tokens</code> (Chat Completions) or <code>output_tokens_details.reasoning_tokens</code> (Responses API).</li>\n</ul>\n<p>Higher <code>reasoning_effort</code> produces more reasoning tokens, which means longer latency and higher cost. Use the lowest level that gives you acceptable results. At <code>&quot;max&quot;</code>, reasoning tokens make up a larger share of <code>output_tokens</code> than at lower efforts, so set the output-token limit generously.</p>\n<h2 id=\"when-to-use\"><a href=\"#when-to-use\">When to reach for reasoning</a></h2>\n<p>Higher reasoning effort helps with multi-step problem solving: proofs and calculations, complex code generation, architecture trade-off analysis, and task planning and sequencing.</p>\n<p>For direct-answer tasks, such as lookups, formatting, and translation, set <code>reasoning_effort</code> to <code>&quot;low&quot;</code> for faster responses at lower cost. (Muse Spark does not support <code>&quot;none&quot;</code>; see <a href=\"#how-it-works\">How it works</a>.)</p>\n<h2 id=\"constraints\"><a href=\"#constraints\">Constraints</a></h2>\n<ul>\n<li><strong>Log probabilities</strong>: Not supported. Muse Spark is a reasoning model, so <code>logprobs: true</code> returns <code>HTTP 400</code>. See <a href=\"#logprobs\">Log probabilities</a>.</li>\n<li><strong>Raw reasoning is not exposed as text</strong>: The model&#x27;s chain of thought is private. The raw reasoning is not returned as readable text in the response body and is not emitted as stream events; only the visible output and, if you request one, a <a href=\"#summaries\">reasoning summary</a>, is streamed. On the Responses API, the raw reasoning is available solely as encrypted content for <a href=\"/docs/protocols/responses#reasoning-items\">replay</a> via <code>include: [&quot;reasoning.encrypted_content&quot;]</code>. During built-in tool loops (for example, when the model runs <code>web_search</code>), reasoning output items appear with empty <code>content</code> so output indices stay stable, and no visible reasoning text is exposed. When you set <code>include: [&quot;reasoning.encrypted_content&quot;]</code>, those items still carry <code>encrypted_content</code>, so stateless replay works across tool-loop turns.</li>\n<li><strong>Streaming</strong>: Because the model reasons before producing visible output, expect an initial latency before the first visible content chunk in streaming mode.</li>\n<li><strong>Output-token limit</strong>: Covers reasoning plus visible output. Set it high enough to accommodate both.</li>\n</ul>\n<h2 id=\"next-steps\"><a href=\"#next-steps\">Next steps</a></h2>\n<ul>\n<li>Ship a reasoning conversation with <a href=\"/docs/protocols/responses\">Responses API</a>, or keep it stateless with <a href=\"/docs/protocols/chat-completions\">chat completion</a>.</li>\n<li>Constrain a reasoned answer to a schema with <a href=\"/docs/structured-output\">structured output</a>.</li>\n<li>Build multi-step agents that replay reasoning across turns with <a href=\"/docs/tool-calling\">tool calling</a>.</li>\n</ul><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
5 "https://dev.meta.ai/docs/protocols": "<h1 id=\"choosing-an-api\"><a href=\"#choosing-an-api\">Choosing an API</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Model API speaks three request formats \u2014 the <a href=\"/docs/protocols/responses\">Responses API</a>, <a href=\"/docs/protocols/chat-completions\">Chat Completions</a>, and the <a href=\"/docs/protocols/messages\">Messages API</a>. All three run the same models, use the same bearer-token auth, and cost the same per token. Pick the format your code already speaks; the model and features underneath are identical.</p>\n<h2 id=\"at-a-glance\"><a href=\"#at-a-glance\">At a glance</a></h2>\n<table><thead><tr><th>Format</th><th>Endpoint</th><th>Best for</th><th>Reasoning across turns</th></tr></thead><tbody><tr><td><strong>Responses</strong></td><td><code>POST /v1/responses</code></td><td>Agents and multi-step tool loops; the full feature set</td><td>Yes \u2014 encrypted replay or <code>previous_response_id</code></td></tr><tr><td><strong>Chat Completions</strong></td><td><code>POST /v1/chat/completions</code></td><td>Dropping into existing OpenAI messages-array code</td><td>No (reasoning is not carried between turns)</td></tr><tr><td><strong>Messages</strong></td><td><code>POST /v1/messages</code></td><td>Anthropic-format tools such as Claude Code</td><td>Yes \u2014 via Anthropic <code>thinking</code> replay</td></tr></tbody></table>\n<h2 id=\"responses\"><a href=\"#responses\">Responses API</a></h2>\n<p>The recommended default for new work. It is OpenAI-compatible and exposes the full feature set: cross-turn reasoning replay (stateless encrypted items or server-managed <code>previous_response_id</code>), <a href=\"/docs/search-grounding\">search grounding</a>, <a href=\"/docs/tool-search\">tool search</a>, background execution, and <a href=\"/docs/file-handling\">file inputs</a>. Reach for it for agentic and coding workloads where reasoning continuity across tool turns matters. Use the OpenAI SDK pointed at <code>https://api.meta.ai/v1</code>. See the <a href=\"/docs/protocols/responses\">Responses API guide</a>.</p>\n<h2 id=\"chat-completions\"><a href=\"#chat-completions\">Chat Completions</a></h2>\n<p>The classic OpenAI messages-array endpoint. It is the simplest drop-in if your code already calls <code>/v1/chat/completions</code>: point the client at the base URL, swap the key, and keep the rest. It does not carry reasoning across turns for external keys, and <a href=\"/docs/search-grounding\">search grounding</a> runs on the Responses API only. <a href=\"/docs/tool-calling\">Tool calling</a> with <code>function</code> tools is fully supported. See the <a href=\"/docs/protocols/chat-completions\">Chat Completions guide</a>.</p>\n<h2 id=\"messages\"><a href=\"#messages\">Messages API</a></h2>\n<p>An Anthropic Messages-compatible wire format over the same inference pipeline as Responses. Use it for Claude-oriented tools and the Anthropic SDK \u2014 point the SDK at the base host <code>https://api.meta.ai</code> (it appends <code>/v1/messages</code>) with your <code>MODEL_API_KEY</code>. It is stateless, so replay history client-side. See the <a href=\"/docs/protocols/messages\">Messages API guide</a>.</p>\n<h2 id=\"how-to-choose\"><a href=\"#how-to-choose\">How to choose</a></h2>\n<ul>\n<li><strong>Building an agent or coding workflow</strong>: use the <strong>Responses API</strong> for reasoning continuity, search grounding, and background execution.</li>\n<li><strong>Already have OpenAI <code>chat.completions</code> code</strong>: start with <strong>Chat Completions</strong> for the fastest drop-in, and move to Responses when you need reasoning replay or search grounding.</li>\n<li><strong>Using Claude Code or the Anthropic SDK</strong>: use the <strong>Messages API</strong> and keep your existing Anthropic-format requests.</li>\n</ul>\n<h2 id=\"next-steps\"><a href=\"#next-steps\">Next steps</a></h2>\n<ul>\n<li>Make your first call in the <a href=\"/docs/quickstart\">Quickstart</a>.</li>\n<li>Wire the model into your editor with the <a href=\"/docs/coding-agents\">coding agents guide</a>.</li>\n<li>Verify request and response schemas in the <a href=\"/docs/api-reference\">API reference</a>.</li>\n</ul><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
6 "https://dev.meta.ai/docs/api-reference/chat-completions/schemas": "<h1 id=\"chat-completions-schemas\"><a href=\"#chat-completions-schemas\">Chat completions schemas</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>The full schema and model definitions referenced by the <a href=\"/docs/api-reference/chat-completions/create-chat-completion\">Create a chat completion</a> endpoint, including the request and response object shapes.</p>\n<h2 id=\"schemas\"><a href=\"#schemas\">Schemas</a></h2>\n<h3 id=\"chat-completion-message-tool-call\"><a href=\"#chat-completion-message-tool-call\">Chat Completion Message Tool Call</a></h3>\n<p>A function tool call emitted by the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this tool call.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function&#x27;)</code></td><td>Yes</td><td>Tool type; always <code>function</code>.</td></tr><tr><td><code>function</code></td><td><code>object</code></td><td>Yes</td><td>The function the model chose to call.</td></tr><tr><td><code>function.name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the function to call.</td></tr><tr><td><code>function.arguments</code></td><td><code>string</code></td><td>Yes</td><td>Call arguments the model generated, as a JSON string. The model can emit invalid JSON or arguments outside your schema, so validate before invoking the function.</td></tr></tbody></table>\n<h3 id=\"chat-completion-message-tool-call-chunk\"><a href=\"#chat-completion-message-tool-call-chunk\">Chat Completion Message Tool Call Chunk</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>index</code></td><td><code>integer</code></td><td>Yes</td><td></td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>Identifier for this tool call.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function&#x27;)</code></td><td>No</td><td>Tool type; always <code>function</code>.</td></tr><tr><td><code>function</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>function.name</code></td><td><code>string</code></td><td>No</td><td>Name of the function to call.</td></tr><tr><td><code>function.arguments</code></td><td><code>string</code></td><td>No</td><td>Function arguments generated by the model, as a JSON string. The model can produce invalid JSON or arguments outside your schema, so validate before executing.</td></tr></tbody></table>\n<h3 id=\"chat-completion-message-tool-calls\"><a href=\"#chat-completion-message-tool-calls\">Chat Completion Message Tool Calls</a></h3>\n<p>The tool calls the model generated, such as function calls.</p>\n<p>Type: <code>array of ChatCompletionMessageToolCall</code></p>\n<h3 id=\"chat-completion-request-assistant-message\"><a href=\"#chat-completion-request-assistant-message\">Chat Completion Request Assistant Message</a></h3>\n<p>An assistant message holding a previous model response in the conversation.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#chat-completion-request-assistant-message-content-part\"><code>ChatCompletionRequestAssistantMessageContentPart</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>refusal</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>reasoning_content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>reasoning</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;assistant&#x27;)</code></td><td>Yes</td><td>Role of the message author; always <code>assistant</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td>Optional name for this participant, used to distinguish participants that share a role.</td></tr><tr><td><code>tool_calls</code></td><td><a href=\"#chat-completion-message-tool-calls\"><code>ChatCompletionMessageToolCalls</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"chat-completion-request-assistant-message-content-part\"><a href=\"#chat-completion-request-assistant-message-content-part\">Chat Completion Request Assistant Message Content Part</a></h3>\n<p>Type: <a href=\"#chat-completion-request-message-content-part-text\"><code>ChatCompletionRequestMessageContentPartText</code></a> | <a href=\"#chat-completion-request-message-content-part-refusal\"><code>ChatCompletionRequestMessageContentPartRefusal</code></a></p>\n<h3 id=\"chat-completion-request-developer-message\"><a href=\"#chat-completion-request-developer-message\">Chat Completion Request Developer Message</a></h3>\n<p>Developer-provided instructions that the model should follow, regardless of messages sent by the user. <code>developer</code> messages take precedence over <code>system</code> messages.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#chat-completion-request-message-content-part-text\"><code>ChatCompletionRequestMessageContentPartText</code></a></td><td>Yes</td><td>Developer message content.</td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;developer&#x27;)</code></td><td>Yes</td><td>Role of the message author; always <code>developer</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td>Optional name for this participant, used to distinguish participants that share a role.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message\"><a href=\"#chat-completion-request-message\">Chat Completion Request Message</a></h3>\n<p>Type: <a href=\"#chat-completion-request-developer-message\"><code>ChatCompletionRequestDeveloperMessage</code></a> | <a href=\"#chat-completion-request-system-message\"><code>ChatCompletionRequestSystemMessage</code></a> | <a href=\"#chat-completion-request-user-message\"><code>ChatCompletionRequestUserMessage</code></a> | <a href=\"#chat-completion-request-assistant-message\"><code>ChatCompletionRequestAssistantMessage</code></a> | <a href=\"#chat-completion-request-tool-message\"><code>ChatCompletionRequestToolMessage</code></a></p>\n<h3 id=\"chat-completion-request-message-content-part-audio\"><a href=\"#chat-completion-request-message-content-part-audio\">Chat Completion Request Message Content Part Audio</a></h3>\n<p>Audio input content for a message.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_audio&#x27;)</code></td><td>Yes</td><td>The type of the content part. Always <code>input_audio</code>.</td></tr><tr><td><code>input_audio</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>input_audio.data</code></td><td><code>string</code></td><td>Yes</td><td>Base64 encoded audio data.</td></tr><tr><td><code>input_audio.format</code></td><td><code>enum (&#x27;wav&#x27;, &#x27;mp3&#x27;)</code></td><td>Yes</td><td>The format of the encoded audio data. Currently supports &quot;wav&quot; and &quot;mp3&quot;.</td></tr><tr><td><code>audio_url</code></td><td><code>string</code></td><td>No</td><td>URL of the audio to send to the model. Fully qualified URL or base64-encoded data URL.</td></tr><tr><td><code>file_id</code></td><td><code>string</code></td><td>No</td><td>Identifier for the uploaded audio file to send to the model.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message-content-part-file\"><a href=\"#chat-completion-request-message-content-part-file\">Chat Completion Request Message Content Part File</a></h3>\n<p>File input content for a message.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;file&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>file</code>.</td></tr><tr><td><code>file</code></td><td><code>object</code></td><td>Yes</td><td></td></tr><tr><td><code>file.filename</code></td><td><code>string</code></td><td>No</td><td>Filename to associate with file data passed inline.</td></tr><tr><td><code>file.file_data</code></td><td><code>string</code></td><td>No</td><td>Base64-encoded file contents passed inline.</td></tr><tr><td><code>file.file_id</code></td><td><code>string</code></td><td>No</td><td>Identifier of an uploaded file to use as input.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message-content-part-image\"><a href=\"#chat-completion-request-message-content-part-image\">Chat Completion Request Message Content Part Image</a></h3>\n<p>Image input content for a message.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;image_url&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>image_url</code>.</td></tr><tr><td><code>image_url</code></td><td><code>object</code></td><td>Yes</td><td></td></tr><tr><td><code>image_url.url</code></td><td><code>string (uri)</code></td><td>Yes</td><td>Public URL or base64 data URL of the image.</td></tr><tr><td><code>image_url.detail</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;low&#x27;, &#x27;high&#x27;)</code></td><td>No</td><td>Specifies the detail level of the image. (default: auto)</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message-content-part-refusal\"><a href=\"#chat-completion-request-message-content-part-refusal\">Chat Completion Request Message Content Part Refusal</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;refusal&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>refusal</code>.</td></tr><tr><td><code>refusal</code></td><td><code>string</code></td><td>Yes</td><td>Refusal message generated by the model.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message-content-part-text\"><a href=\"#chat-completion-request-message-content-part-text\">Chat Completion Request Message Content Part Text</a></h3>\n<p>Text input content for a message.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;text&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>text</code>.</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>Text of this content part.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-message-content-part-video\"><a href=\"#chat-completion-request-message-content-part-video\">Chat Completion Request Message Content Part Video</a></h3>\n<p>A video input to the model. Provided as a URL or a base64 data URI.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;video_url&#x27;)</code></td><td>Yes</td><td>The type of the content part.</td></tr><tr><td><code>video_url</code></td><td><code>object</code></td><td>Yes</td><td></td></tr><tr><td><code>video_url.url</code></td><td><code>string (uri)</code></td><td>Yes</td><td>Either a URL of the video or the base64 encoded video data.</td></tr><tr><td><code>video_url.fps</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"chat-completion-request-system-message\"><a href=\"#chat-completion-request-system-message\">Chat Completion Request System Message</a></h3>\n<p>Instructions that the model should follow, regardless of messages sent by the user. <code>developer</code> messages take precedence over <code>system</code> messages.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#chat-completion-request-system-message-content-part\"><code>ChatCompletionRequestSystemMessageContentPart</code></a></td><td>Yes</td><td>System message content.</td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;system&#x27;)</code></td><td>Yes</td><td>Role of the message author; always <code>system</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td>Optional name for this participant, used to distinguish participants that share a role.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-system-message-content-part\"><a href=\"#chat-completion-request-system-message-content-part\">Chat Completion Request System Message Content Part</a></h3>\n<p>Type: <a href=\"#chat-completion-request-message-content-part-text\"><code>ChatCompletionRequestMessageContentPartText</code></a></p>\n<h3 id=\"chat-completion-request-tool-message\"><a href=\"#chat-completion-request-tool-message\">Chat Completion Request Tool Message</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>role</code></td><td><code>enum (&#x27;tool&#x27;)</code></td><td>Yes</td><td>Role of the message author; always <code>tool</code>.</td></tr><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#chat-completion-request-tool-message-content-part\"><code>ChatCompletionRequestToolMessageContentPart</code></a></td><td>Yes</td><td>Tool message content carrying the result of a tool call.</td></tr><tr><td><code>tool_call_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the tool call this message responds to.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-tool-message-content-part\"><a href=\"#chat-completion-request-tool-message-content-part\">Chat Completion Request Tool Message Content Part</a></h3>\n<p>Type: <a href=\"#chat-completion-request-message-content-part-text\"><code>ChatCompletionRequestMessageContentPartText</code></a></p>\n<h3 id=\"chat-completion-request-user-message\"><a href=\"#chat-completion-request-user-message\">Chat Completion Request User Message</a></h3>\n<p>A user message carrying end-user input such as a prompt or additional context.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#chat-completion-request-user-message-content-part\"><code>ChatCompletionRequestUserMessageContentPart</code></a></td><td>Yes</td><td>User message content.</td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;user&#x27;)</code></td><td>Yes</td><td>Role of the message author; always <code>user</code>.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td>Optional name for this participant, used to distinguish participants that share a role.</td></tr></tbody></table>\n<h3 id=\"chat-completion-request-user-message-content-part\"><a href=\"#chat-completion-request-user-message-content-part\">Chat Completion Request User Message Content Part</a></h3>\n<p>Type: <a href=\"#chat-completion-request-message-content-part-text\"><code>ChatCompletionRequestMessageContentPartText</code></a> | <a href=\"#chat-completion-request-message-content-part-image\"><code>ChatCompletionRequestMessageContentPartImage</code></a> | <a href=\"#chat-completion-request-message-content-part-audio\"><code>ChatCompletionRequestMessageContentPartAudio</code></a> | <a href=\"#chat-completion-request-message-content-part-file\"><code>ChatCompletionRequestMessageContentPartFile</code></a> | <a href=\"#chat-completion-request-message-content-part-video\"><code>ChatCompletionRequestMessageContentPartVideo</code></a></p>\n<h3 id=\"chat-completion-response-message\"><a href=\"#chat-completion-response-message\">Chat Completion Response Message</a></h3>\n<p>The message the model generated for a choice.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>refusal</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>tool_calls</code></td><td><a href=\"#chat-completion-message-tool-calls\"><code>ChatCompletionMessageToolCalls</code></a></td><td>No</td><td></td></tr><tr><td><code>annotations</code></td><td><code>array of object</code></td><td>No</td><td>Annotations for the message, when applicable, as when using the web search tool.</td></tr><tr><td><code>annotations[].type</code></td><td><code>enum (&#x27;url_citation&#x27;)</code></td><td>Yes</td><td>Annotation type; always <code>url_citation</code>.</td></tr><tr><td><code>annotations[].url_citation</code></td><td><code>object</code></td><td>Yes</td><td>Details of a web source cited by the model.</td></tr><tr><td><code>annotations[].url_citation.end_index</code></td><td><code>integer</code></td><td>Yes</td><td>Character offset in the message content where the cited span ends.</td></tr><tr><td><code>annotations[].url_citation.start_index</code></td><td><code>integer</code></td><td>Yes</td><td>Character offset in the message content where the cited span begins.</td></tr><tr><td><code>annotations[].url_citation.url</code></td><td><code>string (uri)</code></td><td>Yes</td><td>URL of the cited source.</td></tr><tr><td><code>annotations[].url_citation.title</code></td><td><code>string</code></td><td>Yes</td><td>Title of the cited source.</td></tr><tr><td><code>reasoning_content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;assistant&#x27;)</code></td><td>Yes</td><td>Role of the message author.</td></tr></tbody></table>\n<h3 id=\"chat-completion-stream-options\"><a href=\"#chat-completion-stream-options\">Chat Completion Stream Options</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"chat-completion-stream-response-delta\"><a href=\"#chat-completion-stream-response-delta\">Chat Completion Stream Response Delta</a></h3>\n<p>An incremental message delta from a streamed completion.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>reasoning_content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>tool_calls</code></td><td>array of <a href=\"#chat-completion-message-tool-call-chunk\"><code>ChatCompletionMessageToolCallChunk</code></a></td><td>No</td><td></td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;developer&#x27;, &#x27;system&#x27;, &#x27;user&#x27;, &#x27;assistant&#x27;, &#x27;tool&#x27;)</code></td><td>No</td><td>Role of the message author.</td></tr><tr><td><code>refusal</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"chat-completion-token-logprob\"><a href=\"#chat-completion-token-logprob\">Chat Completion Token Logprob</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td><td>Yes</td><td>A single text token.</td></tr><tr><td><code>logprob</code></td><td><code>number</code></td><td>Yes</td><td>Log probability of this token. Tokens outside the top 20 report <code>-9999.0</code>.</td></tr><tr><td><code>bytes</code></td><td><code>array of integer</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>array of object</code></td><td>Yes</td><td>List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested <code>top_logprobs</code> returned.</td></tr><tr><td><code>top_logprobs[].token</code></td><td><code>string</code></td><td>Yes</td><td>A candidate text token.</td></tr><tr><td><code>top_logprobs[].logprob</code></td><td><code>number</code></td><td>Yes</td><td>Log probability of this token. Tokens outside the top 20 report <code>-9999.0</code>.</td></tr><tr><td><code>top_logprobs[].bytes</code></td><td><code>array of integer</code> | <code>null</code></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"chat-completion-tool\"><a href=\"#chat-completion-tool\">Chat Completion Tool</a></h3>\n<p>A function the model can call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;function&#x27;)</code></td><td>Yes</td><td>Tool type; always <code>function</code>.</td></tr><tr><td><code>function</code></td><td><a href=\"#function-object\"><code>FunctionObject</code></a></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"chat-completion-tool-choice-option\"><a href=\"#chat-completion-tool-choice-option\">Chat Completion Tool Choice Option</a></h3>\n<p><code>auto</code> lets the model choose between replying with a message and making one or more tool calls. Defaults to <code>auto</code> when tools are supplied.</p>\n<p>Type: <code>enum (&#x27;auto&#x27;)</code></p>\n<h3 id=\"completion-usage\"><a href=\"#completion-usage\">Completion Usage</a></h3>\n<p>Token usage for the request.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>completion_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Tokens in the generated completion. (default: 0)</td></tr><tr><td><code>prompt_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Tokens in the prompt. (default: 0)</td></tr><tr><td><code>total_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Total tokens used, prompt plus completion. (default: 0)</td></tr><tr><td><code>completion_tokens_details</code></td><td><code>object</code></td><td>No</td><td>Breakdown of the completion tokens.</td></tr><tr><td><code>completion_tokens_details.reasoning_tokens</code></td><td><code>integer</code></td><td>No</td><td>Tokens the model spent on reasoning. (default: 0)</td></tr><tr><td><code>prompt_tokens_details</code></td><td><code>object</code></td><td>No</td><td>Breakdown of the prompt tokens.</td></tr><tr><td><code>prompt_tokens_details.cached_tokens</code></td><td><code>integer</code></td><td>No</td><td>Prompt tokens served from cache. (default: 0)</td></tr></tbody></table>\n<h3 id=\"create-chat-completion-request\"><a href=\"#create-chat-completion-request\">Create Chat Completion Request</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code></td><td>No</td><td>An integer between 0 and 20 giving the number of top alternative tokens to return at each position, each with its log probability. Requires <code>logprobs: true</code>. (minimum: 0, maximum: 20)</td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>messages</code></td><td>array of <a href=\"#chat-completion-request-message\"><code>ChatCompletionRequestMessage</code></a></td><td>Yes</td><td>An ordered list of the messages in the conversation. Each message has a <code>role</code> and <code>content</code>, and the model reads them in sequence to produce its reply. (minItems: 1)</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>ID of the model used to generate the response.</td></tr><tr><td><code>modalities</code></td><td><a href=\"#response-modalities\"><code>ResponseModalities</code></a></td><td>No</td><td></td></tr><tr><td><code>reasoning_effort</code></td><td><a href=\"#reasoning-effort\"><code>ReasoningEffort</code></a></td><td>No</td><td></td></tr><tr><td><code>max_completion_tokens</code></td><td><code>integer</code></td><td>No</td><td>Upper bound on the tokens the model may generate for a completion, counting both visible output and reasoning tokens.</td></tr><tr><td><code>frequency_penalty</code></td><td><code>number</code></td><td>No</td><td>Penalizes tokens in proportion to how often they have already appeared, reducing verbatim repetition. Ranges from -2.0 to 2.0; positive values discourage repetition. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>presence_penalty</code></td><td><code>number</code></td><td>No</td><td>Penalizes tokens that have already appeared at all, nudging the model toward new topics. Ranges from -2.0 to 2.0; positive values increase that push. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>response_format</code></td><td><a href=\"#response-format-text\"><code>ResponseFormatText</code></a> | <a href=\"#response-format-json-schema\"><code>ResponseFormatJsonSchema</code></a> | <a href=\"#response-format-json-object\"><code>ResponseFormatJsonObject</code></a></td><td>No</td><td>Constrains the format of the model&#x27;s output. Use <code>{ &quot;type&quot;: &quot;json_schema&quot;, ... }</code> for Structured Outputs, which forces the response to match your JSON schema, or <code>{ &quot;type&quot;: &quot;json_object&quot; }</code> for the older JSON mode, which only guarantees valid JSON. Prefer <code>json_schema</code>.</td></tr><tr><td><code>store</code></td><td><code>boolean</code></td><td>No</td><td>Whether or not to store the output of this chat completion request for use in our model distillation or evals products. Supports text and image inputs. Note: image inputs over 8MB will be dropped. (default: false)</td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>When <code>true</code>, the response is streamed incrementally as <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format\">server-sent events<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"1em\" height=\"1em\"><path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\"></path><path d=\"M15 3h6v6\"></path><path d=\"M10 14L21 3\"></path></svg>(opens in new tab)</a> rather than returned in a single payload. (default: false)</td></tr><tr><td><code>stop</code></td><td><a href=\"#stop-configuration\"><code>StopConfiguration</code></a></td><td>No</td><td></td></tr><tr><td><code>logprobs</code></td><td><code>boolean</code></td><td>No</td><td>When <code>true</code>, returns the log probability of each token in the message <code>content</code>. (default: false)</td></tr><tr><td><code>max_tokens</code></td><td><code>integer</code></td><td>No</td><td>The maximum number of tokens that can be generated in the chat completion. Deprecated in favor of <code>max_completion_tokens</code>.</td></tr><tr><td><code>n</code></td><td><code>integer</code></td><td>No</td><td>Number of completions to generate for the input. Only <code>n=1</code> is supported. (minimum: 1, maximum: 128, default: 1)</td></tr><tr><td><code>seed</code></td><td><code>integer</code></td><td>No</td><td>If set, the system makes a best-effort attempt to sample deterministically, so repeated requests with the same <code>seed</code> and parameters return similar results. Determinism is not guaranteed. (minimum: -9223372036854776000, maximum: 9223372036854776000)</td></tr><tr><td><code>stream_options</code></td><td><a href=\"#chat-completion-stream-options\"><code>ChatCompletionStreamOptions</code></a></td><td>No</td><td></td></tr><tr><td><code>tools</code></td><td><code>array of ChatCompletionTool</code></td><td>No</td><td>A list of tools the model may call. You can provide either custom tools or function tools.</td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#chat-completion-tool-choice-option\"><code>ChatCompletionToolChoiceOption</code></a></td><td>No</td><td></td></tr><tr><td><code>parallel_tool_calls</code></td><td><a href=\"#parallel-tool-calls\"><code>ParallelToolCalls</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"create-chat-completion-response\"><a href=\"#create-chat-completion-response\">Create Chat Completion Response</a></h3>\n<p>A chat completion produced by the model for a given request.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this chat completion.</td></tr><tr><td><code>choices</code></td><td><code>array of object</code></td><td>Yes</td><td>List of completion choices. Only one choice is returned; <code>n</code> greater than 1 returns <code>HTTP 400</code>.</td></tr><tr><td><code>choices[].finish_reason</code></td><td><code>enum (&#x27;stop&#x27;, &#x27;length&#x27;, &#x27;tool_calls&#x27;, &#x27;content_filter&#x27;, &#x27;function_call&#x27;)</code></td><td>Yes</td><td>Why the model stopped generating tokens: <code>stop</code> for a natural end, <code>length</code> when the output-token limit was reached, and <code>tool_calls</code> when the model requested a tool. <code>content_filter</code> and the deprecated <code>function_call</code> may also appear.</td></tr><tr><td><code>choices[].index</code></td><td><code>integer</code></td><td>Yes</td><td>Index of this choice in the <code>choices</code> array.</td></tr><tr><td><code>choices[].message</code></td><td><a href=\"#chat-completion-response-message\"><code>ChatCompletionResponseMessage</code></a></td><td>Yes</td><td></td></tr><tr><td><code>choices[].logprobs</code></td><td><code>object</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>created</code></td><td><code>integer (unixtime)</code></td><td>Yes</td><td>Unix timestamp, in seconds, when the chat completion was created.</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>ID of the model that generated the completion.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>system_fingerprint</code></td><td><code>string</code></td><td>No</td><td>Identifies the backend configuration the model ran with, for use with <code>seed</code> to detect determinism-affecting changes. Not currently populated.</td></tr><tr><td><code>object</code></td><td><code>enum (&#x27;chat.completion&#x27;)</code></td><td>Yes</td><td>Object type; always <code>chat.completion</code>.</td></tr><tr><td><code>usage</code></td><td><a href=\"#completion-usage\"><code>CompletionUsage</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"create-chat-completion-stream-response\"><a href=\"#create-chat-completion-stream-response\">Create Chat Completion Stream Response</a></h3>\n<p>A single streamed chunk of a chat completion, delivered as a server-sent event.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this chat completion. Identical across every chunk in the stream.</td></tr><tr><td><code>choices</code></td><td><code>array of object</code></td><td>Yes</td><td>List of completion choices. Contains a single choice, and is empty on the final chunk when <code>stream_options.include_usage</code> is set.</td></tr><tr><td><code>choices[].delta</code></td><td><a href=\"#chat-completion-stream-response-delta\"><code>ChatCompletionStreamResponseDelta</code></a></td><td>Yes</td><td></td></tr><tr><td><code>choices[].logprobs</code></td><td><code>object</code></td><td>No</td><td>Log-probability data for this choice.</td></tr><tr><td><code>choices[].logprobs.content</code></td><td>array of <a href=\"#chat-completion-token-logprob\"><code>ChatCompletionTokenLogprob</code></a></td><td>Yes</td><td>Content tokens with their log probabilities.</td></tr><tr><td><code>choices[].logprobs.refusal</code></td><td>array of <a href=\"#chat-completion-token-logprob\"><code>ChatCompletionTokenLogprob</code></a></td><td>Yes</td><td>Refusal tokens with their log probabilities.</td></tr><tr><td><code>choices[].finish_reason</code></td><td><code>enum (&#x27;stop&#x27;, &#x27;length&#x27;, &#x27;tool_calls&#x27;, &#x27;content_filter&#x27;, &#x27;function_call&#x27;)</code></td><td>Yes</td><td>Why the model stopped generating tokens: <code>stop</code> for a natural end, <code>length</code> when the output-token limit was reached, and <code>tool_calls</code> when the model requested a tool. <code>content_filter</code> and the deprecated <code>function_call</code> may also appear.</td></tr><tr><td><code>choices[].index</code></td><td><code>integer</code></td><td>Yes</td><td>Index of this choice in the <code>choices</code> array.</td></tr><tr><td><code>created</code></td><td><code>integer (unixtime)</code></td><td>Yes</td><td>Unix timestamp, in seconds, when the chat completion was created. Identical across every chunk in the stream.</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>ID of the model that generated the completion.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>system_fingerprint</code></td><td><code>string</code></td><td>No</td><td>Identifies the backend configuration the model ran with, for use with <code>seed</code> to detect determinism-affecting changes. Not currently populated.</td></tr><tr><td><code>object</code></td><td><code>enum (&#x27;chat.completion.chunk&#x27;)</code></td><td>Yes</td><td>Object type; always <code>chat.completion.chunk</code>.</td></tr><tr><td><code>usage</code></td><td><a href=\"#completion-usage\"><code>CompletionUsage</code></a></td><td>No</td><td>Token usage for the entire request. Present only when <code>stream_options.include_usage</code> is set, and populated only on the final chunk; null on all earlier chunks. An interrupted or cancelled stream may omit this chunk.</td></tr></tbody></table>\n<h3 id=\"create-model-response-properties\"><a href=\"#create-model-response-properties\">Create Model Response Properties</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code></td><td>No</td><td>An integer between 0 and 20 giving the number of top alternative tokens to return at each position, each with its log probability. (minimum: 0, maximum: 20)</td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"function-object\"><a href=\"#function-object\">Function Object</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>description</code></td><td><code>string</code></td><td>No</td><td>Tells the model what the function does, so it can decide when and how to call it.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the function to call. May contain letters, digits, underscores, dashes, and at most one dot.</td></tr><tr><td><code>parameters</code></td><td><a href=\"#function-parameters\"><code>FunctionParameters</code></a></td><td>No</td><td></td></tr><tr><td><code>strict</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"function-parameters\"><a href=\"#function-parameters\">Function Parameters</a></h3>\n<p>The parameters the functions accepts, described as a JSON Schema object. See the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://json-schema.org/understanding-json-schema/\">JSON Schema reference<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"1em\" height=\"1em\"><path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\"></path><path d=\"M15 3h6v6\"></path><path d=\"M10 14L21 3\"></path></svg>(opens in new tab)</a> for documentation about the format. Omitting <code>parameters</code> defines a function with an empty parameter list.</p>\n<p>Type: <code>object</code></p>\n<h3 id=\"metadata\"><a href=\"#metadata\">Metadata</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"model-response-properties\"><a href=\"#model-response-properties\">Model Response Properties</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"parallel-tool-calls\"><a href=\"#parallel-tool-calls\">Parallel Tool Calls</a></h3>\n<p>Whether to enable parallel function calling during tool use.</p>\n<p>Type: <code>boolean</code></p>\n<h3 id=\"reasoning-effort\"><a href=\"#reasoning-effort\">Reasoning Effort</a></h3>\n<p>Type: <code>enum (&#x27;none&#x27;, &#x27;minimal&#x27;, &#x27;low&#x27;, &#x27;medium&#x27;, &#x27;high&#x27;, &#x27;xhigh&#x27;, &#x27;max&#x27;)</code> | <code>null</code></p>\n<h3 id=\"response-format-json-object\"><a href=\"#response-format-json-object\">Response Format Json Object</a></h3>\n<p>JSON mode: forces the output to be valid JSON. Prefer <code>json_schema</code> where supported. The model only emits JSON if a system or user message instructs it to.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;json_object&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>json_object</code>.</td></tr></tbody></table>\n<h3 id=\"response-format-json-schema\"><a href=\"#response-format-json-schema\">Response Format Json Schema</a></h3>\n<p>JSON Schema response format. Used to generate structured JSON responses.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;json_schema&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>json_schema</code>.</td></tr><tr><td><code>json_schema</code></td><td><code>object</code></td><td>Yes</td><td>Structured Outputs settings, including the JSON Schema to enforce.</td></tr><tr><td><code>json_schema.description</code></td><td><code>string</code></td><td>No</td><td>Describes what the format is for; the model uses it to decide how to respond.</td></tr><tr><td><code>json_schema.name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the response format. Allowed characters: a-z, A-Z, 0-9, underscores, and dashes, up to 64 characters.</td></tr><tr><td><code>json_schema.schema</code></td><td><a href=\"#response-format-json-schema-schema\"><code>ResponseFormatJsonSchemaSchema</code></a></td><td>No</td><td></td></tr><tr><td><code>json_schema.strict</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"response-format-json-schema-schema\"><a href=\"#response-format-json-schema-schema\">Response Format Json Schema Schema</a></h3>\n<p>The response-format schema, expressed as a JSON Schema object. See the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://json-schema.org/\">JSON Schema reference<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"1em\" height=\"1em\"><path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\"></path><path d=\"M15 3h6v6\"></path><path d=\"M10 14L21 3\"></path></svg>(opens in new tab)</a> for the format.</p>\n<p>Type: <code>object</code></p>\n<h3 id=\"response-format-text\"><a href=\"#response-format-text\">Response Format Text</a></h3>\n<p>Plain-text response format (the default).</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;text&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>text</code>.</td></tr></tbody></table>\n<h3 id=\"response-modalities\"><a href=\"#response-modalities\">Response Modalities</a></h3>\n<p>Type: <code>array of enum (&#x27;text&#x27;, &#x27;audio&#x27;)</code> | <code>null</code></p>\n<h3 id=\"service-tier\"><a href=\"#service-tier\">Service Tier</a></h3>\n<p>Type: <code>enum (&#x27;auto&#x27;, &#x27;default&#x27;, &#x27;flex&#x27;, &#x27;scale&#x27;, &#x27;priority&#x27;)</code> | <code>null</code></p>\n<h3 id=\"stop-configuration\"><a href=\"#stop-configuration\">Stop Configuration</a></h3>\n<p>Not supported with reasoning models. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.</p>\n<p>Type: <code>string</code> | <code>array of string</code></p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
7 "https://dev.meta.ai/docs/api-reference/chat-completions/create-chat-completion": "<h1 id=\"create-a-chat-completion\"><a href=\"#create-a-chat-completion\">Create a chat completion</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Generate a model response from a conversation supplied as a list of messages.</p>\n<h2 id=\"post-chatcompletions\"><a href=\"#post-chatcompletions\">POST /chat/completions</a></h2>\n<p>Generate a chat completion.</p>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/chat-completions/schemas#create-chat-completion-request\"><code>CreateChatCompletionRequest</code></a></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 OK</p>\n<h4 id=\"content-type-applicationjson-1\"><a href=\"#content-type-applicationjson-1\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/chat-completions/schemas#create-chat-completion-response\"><code>CreateChatCompletionResponse</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/chat-completions/schemas#create-chat-completion-stream-response\"><code>CreateChatCompletionStreamResponse</code></a></p>\n<nav><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-2\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure>\n<p>For usage examples, streaming, multi-turn conversations, and parameter guidance, see the <a href=\"/docs/protocols/chat-completions\">Chat completion</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
8 "https://dev.meta.ai/docs/api-reference/responses/schemas": "<h1 id=\"responses-schemas\"><a href=\"#responses-schemas\">Responses schemas</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>The full schema and model definitions referenced by the <a href=\"/docs/api-reference/responses/create-response\">Responses</a> endpoints. Each endpoint page links here for the detailed shape of its request and response objects.</p>\n<h2 id=\"schemas\"><a href=\"#schemas\">Schemas</a></h2>\n<h3 id=\"annotation\"><a href=\"#annotation\">Annotation</a></h3>\n<p>Annotation attached to a span of generated output text, such as a citation or file reference.</p>\n<p>Type: <a href=\"#file-citation-body\"><code>FileCitationBody</code></a> | <a href=\"#url-citation-body\"><code>UrlCitationBody</code></a> | <a href=\"#file-path\"><code>FilePath</code></a></p>\n<h3 id=\"cancel-response-response\"><a href=\"#cancel-response-response\">Cancel Response Response</a></h3>\n<p>The response object returned by the cancel endpoint. Only the lifecycle fields the server populates on cancel are present, and the <code>output</code> array is always empty.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this response.</td></tr><tr><td><code>object</code></td><td><code>enum (&#x27;response&#x27;)</code></td><td>Yes</td><td>Object type; always <code>response</code>.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;completed&#x27;, &#x27;failed&#x27;, &#x27;in_progress&#x27;, &#x27;cancelled&#x27;, &#x27;queued&#x27;, &#x27;incomplete&#x27;)</code></td><td>Yes</td><td>The status of the response generation. After a successful cancel of an in-progress response this is <code>cancelled</code>; for an already-terminal response the current terminal status is returned.</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Model ID used to generate the response.</td></tr><tr><td><code>background</code></td><td><code>boolean</code></td><td>Yes</td><td>Whether the response was run in the background.</td></tr><tr><td><code>output</code></td><td>array of <a href=\"#output-item\"><code>OutputItem</code></a></td><td>Yes</td><td>An array of content items generated by the model. Always empty on a cancelled response.</td></tr></tbody></table>\n<h3 id=\"click-button-type\"><a href=\"#click-button-type\">Click Button Type</a></h3>\n<p>Type: <code>enum (&#x27;left&#x27;, &#x27;right&#x27;, &#x27;wheel&#x27;, &#x27;back&#x27;, &#x27;forward&#x27;)</code></p>\n<h3 id=\"click-param\"><a href=\"#click-param\">Click Param</a></h3>\n<p>A click action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;click&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a click action, this property is always <code>click</code>. (default: click)</td></tr><tr><td><code>button</code></td><td><a href=\"#click-button-type\"><code>ClickButtonType</code></a></td><td>Yes</td><td>Indicates which mouse button was pressed during the click. One of <code>left</code>, <code>right</code>, <code>wheel</code>, <code>back</code>, or <code>forward</code>.</td></tr><tr><td><code>x</code></td><td><code>integer</code></td><td>Yes</td><td>The x-coordinate where the click occurred.</td></tr><tr><td><code>y</code></td><td><code>integer</code></td><td>Yes</td><td>The y-coordinate where the click occurred.</td></tr></tbody></table>\n<h3 id=\"compaction-body\"><a href=\"#compaction-body\">Compaction Body</a></h3>\n<p>A compaction item produced when earlier conversation context is compacted into an encrypted summary.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;compaction&#x27;)</code></td><td>Yes</td><td>Object type; always <code>compaction</code>. (default: compaction)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for the compaction item.</td></tr><tr><td><code>encrypted_content</code></td><td><code>string</code></td><td>Yes</td><td>Encrypted content for stateless multi-turn replay.</td></tr><tr><td><code>created_by</code></td><td><code>string</code></td><td>No</td><td>Identifier for the actor that created the item.</td></tr></tbody></table>\n<h3 id=\"compaction-summary-item-param\"><a href=\"#compaction-summary-item-param\">Compaction Summary Item Param</a></h3>\n<p>A compaction item produced when earlier conversation context is compacted into an encrypted summary.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;compaction&#x27;)</code></td><td>Yes</td><td>Object type; always <code>compaction</code>. (default: compaction)</td></tr><tr><td><code>encrypted_content</code></td><td><code>string</code></td><td>Yes</td><td>Encrypted content for stateless multi-turn replay. (maxLength: 10485760)</td></tr></tbody></table>\n<h3 id=\"computer-action\"><a href=\"#computer-action\">Computer Action</a></h3>\n<p>Type: <a href=\"#click-param\"><code>ClickParam</code></a> | <a href=\"#double-click-action\"><code>DoubleClickAction</code></a> | <a href=\"#drag-param\"><code>DragParam</code></a> | <a href=\"#key-press-action\"><code>KeyPressAction</code></a> | <a href=\"#move-param\"><code>MoveParam</code></a> | <a href=\"#screenshot-param\"><code>ScreenshotParam</code></a> | <a href=\"#scroll-param\"><code>ScrollParam</code></a> | <a href=\"#type-param\"><code>TypeParam</code></a> | <a href=\"#wait-param\"><code>WaitParam</code></a></p>\n<h3 id=\"computer-action-list\"><a href=\"#computer-action-list\">Computer Action List</a></h3>\n<p>Flattened batched actions for <code>computer_use</code>. Each action includes an\n<code>type</code> discriminator and action-specific fields.</p>\n<p>Type: array of <a href=\"#computer-action\"><code>ComputerAction</code></a></p>\n<h3 id=\"computer-call-output-item-param\"><a href=\"#computer-call-output-item-param\">Computer Call Output Item Param</a></h3>\n<p>The output of a computer tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>The ID of the computer tool call that produced the output. (minLength: 1, maxLength: 64)</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;computer_call_output&#x27;)</code></td><td>Yes</td><td>The type of the computer tool call output. Always <code>computer_call_output</code>. (default: computer_call_output)</td></tr><tr><td><code>output</code></td><td><a href=\"#computer-screenshot-image\"><code>ComputerScreenshotImage</code></a></td><td>Yes</td><td></td></tr><tr><td><code>acknowledged_safety_checks</code></td><td>array of <a href=\"#computer-call-safety-check-param\"><code>ComputerCallSafetyCheckParam</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-item-status\"><code>FunctionCallItemStatus</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"computer-call-output-status\"><a href=\"#computer-call-output-status\">Computer Call Output Status</a></h3>\n<p>Type: <code>enum (&#x27;completed&#x27;, &#x27;incomplete&#x27;, &#x27;failed&#x27;)</code></p>\n<h3 id=\"computer-call-safety-check-param\"><a href=\"#computer-call-safety-check-param\">Computer Call Safety Check Param</a></h3>\n<p>A pending safety check for the computer call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>The ID of the pending safety check.</td></tr><tr><td><code>code</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>message</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"computer-screenshot-image\"><a href=\"#computer-screenshot-image\">Computer Screenshot Image</a></h3>\n<p>A computer screenshot image used with the computer use tool.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;computer_screenshot&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a computer screenshot, this property is always set to <code>computer_screenshot</code>. (default: computer_screenshot)</td></tr><tr><td><code>image_url</code></td><td><code>string (uri)</code></td><td>No</td><td>The URL of the screenshot image.</td></tr><tr><td><code>file_id</code></td><td><code>string</code></td><td>No</td><td>The identifier of an uploaded file that contains the screenshot.</td></tr><tr><td><code>detail</code></td><td><code>enum (&#x27;original&#x27;)</code></td><td>No</td><td>The detail level of the screenshot. Always <code>original</code> when provided.</td></tr></tbody></table>\n<h3 id=\"computer-tool\"><a href=\"#computer-tool\">Computer Tool</a></h3>\n<p>A tool that controls a virtual computer.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;computer&#x27;)</code></td><td>Yes</td><td>The type of the computer tool. Always <code>computer</code>. (default: computer)</td></tr></tbody></table>\n<h3 id=\"computer-tool-call\"><a href=\"#computer-tool-call\">Computer Tool Call</a></h3>\n<p>A tool call to a computer use tool. See the\n<a href=\"/docs/guides/tools-computer-use\">computer use guide</a> for more information.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;computer_call&#x27;)</code></td><td>Yes</td><td>The type of the computer call. Always <code>computer_call</code>. (default: computer_call)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>The unique ID of the computer call.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>An identifier used when responding to the tool call with output.</td></tr><tr><td><code>action</code></td><td><a href=\"#computer-action\"><code>ComputerAction</code></a></td><td>No</td><td></td></tr><tr><td><code>actions</code></td><td><a href=\"#computer-action-list\"><code>ComputerActionList</code></a></td><td>No</td><td></td></tr><tr><td><code>pending_safety_checks</code></td><td>array of <a href=\"#computer-call-safety-check-param\"><code>ComputerCallSafetyCheckParam</code></a></td><td>Yes</td><td>The pending safety checks for the computer call.</td></tr><tr><td><code>meta_safety_replay_receipt</code></td><td><code>string</code></td><td>No</td><td>An opaque Meta wire extension containing a time-bounded receipt for the accepted native-computer safety replay prefix through this call. Stateless clients must copy it unchanged from <code>response.output</code> into the corresponding item under <code>input</code> on the next request; the matching call output still requires a fresh acknowledgement. (minLength: 1, maxLength: 8192)</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>Yes</td><td>Item status. One of <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Populated when items are returned via API.</td></tr></tbody></table>\n<h3 id=\"computer-tool-call-output\"><a href=\"#computer-tool-call-output\">Computer Tool Call Output</a></h3>\n<p>The output of a computer tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;computer_call_output&#x27;)</code></td><td>Yes</td><td>The type of the computer tool call output. Always <code>computer_call_output</code>. (default: computer_call_output)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>The ID of the computer tool call output.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>The ID of the computer tool call that produced the output.</td></tr><tr><td><code>acknowledged_safety_checks</code></td><td>array of <a href=\"#computer-call-safety-check-param\"><code>ComputerCallSafetyCheckParam</code></a></td><td>No</td><td>The safety checks reported by the API that have been acknowledged by the developer.</td></tr><tr><td><code>output</code></td><td><a href=\"#computer-screenshot-image\"><code>ComputerScreenshotImage</code></a></td><td>Yes</td><td></td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>The status of the message input. One of <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Populated when input items are returned via API.</td></tr></tbody></table>\n<h3 id=\"computer-tool-call-output-resource\"><a href=\"#computer-tool-call-output-resource\">Computer Tool Call Output Resource</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;computer_call_output&#x27;)</code></td><td>Yes</td><td>The type of the computer tool call output. Always <code>computer_call_output</code>. (default: computer_call_output)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>The unique ID of the computer call tool output.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>The ID of the computer tool call that produced the output.</td></tr><tr><td><code>acknowledged_safety_checks</code></td><td>array of <a href=\"#computer-call-safety-check-param\"><code>ComputerCallSafetyCheckParam</code></a></td><td>No</td><td>The safety checks reported by the API that have been acknowledged by the developer.</td></tr><tr><td><code>output</code></td><td><a href=\"#computer-screenshot-image\"><code>ComputerScreenshotImage</code></a></td><td>Yes</td><td></td></tr><tr><td><code>status</code></td><td><a href=\"#computer-call-output-status\"><code>ComputerCallOutputStatus</code></a></td><td>Yes</td><td>The status of the message input. One of <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Populated when input items are returned via API.</td></tr><tr><td><code>created_by</code></td><td><code>string</code></td><td>No</td><td>Identifier for the actor that created the item.</td></tr></tbody></table>\n<h3 id=\"context-management-param\"><a href=\"#context-management-param\">Context Management Param</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string</code></td><td>Yes</td><td>Context-management entry type; only <code>compaction</code> is currently supported.</td></tr><tr><td><code>compact_threshold</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"conversation-2\"><a href=\"#conversation-2\">Conversation-2</a></h3>\n<p>The conversation this response belonged to. Its input and output items were added to that conversation automatically.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the conversation this response belongs to.</td></tr></tbody></table>\n<h3 id=\"coord-param\"><a href=\"#coord-param\">Coord Param</a></h3>\n<p>An x/y coordinate pair, e.g. <code>{ x: 100, y: 200 }</code>.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>x</code></td><td><code>integer</code></td><td>Yes</td><td>The x-coordinate.</td></tr><tr><td><code>y</code></td><td><code>integer</code></td><td>Yes</td><td>The y-coordinate.</td></tr></tbody></table>\n<h3 id=\"create-model-response-properties\"><a href=\"#create-model-response-properties\">Create Model Response Properties</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code></td><td>No</td><td>An integer between 0 and 20 giving the number of top alternative tokens to return at each position, each with its log probability. (minimum: 0, maximum: 20)</td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"create-response\"><a href=\"#create-response\">Create Response</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code></td><td>No</td><td>An integer between 0 and 20 giving the number of top alternative tokens to return at each position, each with its log probability. (minimum: 0, maximum: 20)</td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>previous_response_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>No</td><td>ID of the model used to generate the response.</td></tr><tr><td><code>reasoning</code></td><td><a href=\"#reasoning\"><code>Reasoning</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>background</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>max_tool_calls</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>text</code></td><td><a href=\"#response-text-param\"><code>ResponseTextParam</code></a></td><td>No</td><td></td></tr><tr><td><code>tools</code></td><td><a href=\"#tools-array\"><code>ToolsArray</code></a></td><td>No</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#tool-choice-param\"><code>ToolChoiceParam</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt</code></td><td><a href=\"#prompt\"><code>Prompt</code></a></td><td>No</td><td></td></tr><tr><td><code>truncation</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;disabled&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>frequency_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from repeating tokens it has already used often, reducing verbatim repetition. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>presence_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from reusing tokens that have already appeared, encouraging it to introduce new topics. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>client_metadata</code></td><td><code>object</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>input</code></td><td><a href=\"#input-param\"><code>InputParam</code></a></td><td>No</td><td></td></tr><tr><td><code>include</code></td><td>array of <a href=\"#include-enum\"><code>IncludeEnum</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>parallel_tool_calls</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>store</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>instructions</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>stream</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>stream_options</code></td><td><a href=\"#response-stream-options\"><code>ResponseStreamOptions</code></a></td><td>No</td><td></td></tr><tr><td><code>context_management</code></td><td>array of <a href=\"#context-management-param\"><code>ContextManagementParam</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>max_output_tokens</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"delete-response-response\"><a href=\"#delete-response-response\">Delete Response Response</a></h3>\n<p>Returned by the delete-response endpoint to confirm a response was deleted.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the deleted response.</td></tr><tr><td><code>object</code></td><td><code>enum (&#x27;response.deleted&#x27;)</code></td><td>Yes</td><td>Object type; always <code>response.deleted</code>.</td></tr><tr><td><code>deleted</code></td><td><code>boolean</code></td><td>Yes</td><td>Always <code>true</code> when the response was deleted.</td></tr></tbody></table>\n<h3 id=\"detail-enum\"><a href=\"#detail-enum\">Detail Enum</a></h3>\n<p>Type: <code>enum (&#x27;low&#x27;, &#x27;high&#x27;, &#x27;auto&#x27;, &#x27;original&#x27;)</code></p>\n<h3 id=\"double-click-action\"><a href=\"#double-click-action\">Double Click Action</a></h3>\n<p>A double click action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;double_click&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a double click action, this property is always set to <code>double_click</code>. (default: double_click)</td></tr><tr><td><code>x</code></td><td><code>integer</code></td><td>Yes</td><td>The x-coordinate where the double click occurred.</td></tr><tr><td><code>y</code></td><td><code>integer</code></td><td>Yes</td><td>The y-coordinate where the double click occurred.</td></tr></tbody></table>\n<h3 id=\"drag-param\"><a href=\"#drag-param\">Drag Param</a></h3>\n<p>A drag action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;drag&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a drag action, this property is always set to <code>drag</code>. (default: drag)</td></tr><tr><td><code>path</code></td><td>array of <a href=\"#coord-param\"><code>CoordParam</code></a></td><td>Yes</td><td>An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, eg <code>[ { x: 100, y: 200 }, { x: 200, y: 300 } ]</code></td></tr></tbody></table>\n<h3 id=\"easy-input-message\"><a href=\"#easy-input-message\">Easy Input Message</a></h3>\n<p>A message in a Responses input or replayed history. The <code>developer</code> and <code>system</code> roles carry instructions (developer takes precedence); <code>user</code> carries the caller&#x27;s prompt; <code>assistant</code> replays prior model output.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>role</code></td><td><code>enum (&#x27;user&#x27;, &#x27;assistant&#x27;, &#x27;system&#x27;, &#x27;developer&#x27;)</code></td><td>Yes</td><td>Role of the message author. One of <code>user</code>, <code>assistant</code>, <code>system</code>, or <code>developer</code>.</td></tr><tr><td><code>content</code></td><td><code>string</code> | <a href=\"#input-message-content-list\"><code>InputMessageContentList</code></a></td><td>Yes</td><td>Message content. Either plain text or an array of content parts (text, image, file, or video). Can replay previous assistant output.</td></tr><tr><td><code>phase</code></td><td><a href=\"#message-phase\"><code>MessagePhase</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;message&#x27;)</code></td><td>No</td><td>Object type; always <code>message</code>.</td></tr></tbody></table>\n<h3 id=\"empty-model-param\"><a href=\"#empty-model-param\">Empty Model Param</a></h3>\n<p>Type: <code>object</code></p>\n<h3 id=\"file-citation-body\"><a href=\"#file-citation-body\">File Citation Body</a></h3>\n<p>Citation that points to an uploaded file used to ground the response.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;file_citation&#x27;)</code></td><td>Yes</td><td>Annotation type; always <code>file_citation</code>. (default: file_citation)</td></tr><tr><td><code>file_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the cited file.</td></tr><tr><td><code>index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the cited file in the list of files.</td></tr><tr><td><code>filename</code></td><td><code>string</code></td><td>Yes</td><td>Name of the cited file.</td></tr></tbody></table>\n<h3 id=\"file-detail-enum\"><a href=\"#file-detail-enum\">File Detail Enum</a></h3>\n<p>Type: <code>enum (&#x27;low&#x27;, &#x27;high&#x27;)</code></p>\n<h3 id=\"file-input-detail\"><a href=\"#file-input-detail\">File Input Detail</a></h3>\n<p>Type: <code>enum (&#x27;low&#x27;, &#x27;high&#x27;)</code></p>\n<h3 id=\"file-path\"><a href=\"#file-path\">File Path</a></h3>\n<p>File path annotation attached to a span of output text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;file_path&#x27;)</code></td><td>Yes</td><td>Annotation type; always <code>file_path</code>.</td></tr><tr><td><code>file_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the referenced file.</td></tr><tr><td><code>index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the referenced file in the list of files.</td></tr></tbody></table>\n<h3 id=\"function-and-custom-tool-call-output\"><a href=\"#function-and-custom-tool-call-output\">Function And Custom Tool Call Output</a></h3>\n<p>Type: <a href=\"#input-text-content\"><code>InputTextContent</code></a> | <a href=\"#input-image-content\"><code>InputImageContent</code></a> | <a href=\"#input-file-content\"><code>InputFileContent</code></a></p>\n<h3 id=\"function-call-item-status\"><a href=\"#function-call-item-status\">Function Call Item Status</a></h3>\n<p>Type: <code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></p>\n<h3 id=\"function-call-output-content-list-param\"><a href=\"#function-call-output-content-list-param\">Function Call Output Content List Param</a></h3>\n<p>The function tool call output as content parts (text, image, or file).</p>\n<p>Type: <code>array of InputTextContentParam | InputImageContentParamAutoParam | InputFileContentParam</code></p>\n<h3 id=\"function-call-output-item-param\"><a href=\"#function-call-output-item-param\">Function Call Output Item Param</a></h3>\n<p>The output your code returns for a function tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the function tool call this output answers. (minLength: 1, maxLength: 64)</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function_call_output&#x27;)</code></td><td>Yes</td><td>Item type; always <code>function_call_output</code>. (default: function_call_output)</td></tr><tr><td><code>output</code></td><td><a href=\"#function-call-output-text-param\"><code>FunctionCallOutputTextParam</code></a> | <a href=\"#function-call-output-content-list-param\"><code>FunctionCallOutputContentListParam</code></a></td><td>Yes</td><td>The function tool call output, as text or content parts.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-item-status\"><code>FunctionCallItemStatus</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"function-call-output-status-enum\"><a href=\"#function-call-output-status-enum\">Function Call Output Status Enum</a></h3>\n<p>Type: <code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></p>\n<h3 id=\"function-call-output-text-param\"><a href=\"#function-call-output-text-param\">Function Call Output Text Param</a></h3>\n<p>The function tool call output as a JSON string.</p>\n<p>Type: <code>string</code></p>\n<h3 id=\"function-call-status\"><a href=\"#function-call-status\">Function Call Status</a></h3>\n<p>Type: <code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></p>\n<h3 id=\"function-tool\"><a href=\"#function-tool\">Function Tool</a></h3>\n<p>Defines a function in your own code the model can choose to call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;function&#x27;)</code></td><td>Yes</td><td>The tool type; always <code>function</code>. (default: function)</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the function the model can call.</td></tr><tr><td><code>description</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>parameters</code></td><td><code>object</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>strict</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>defer_loading</code></td><td><code>boolean</code></td><td>No</td><td>When <code>true</code>, defers this function so it is discovered on demand through tool search.</td></tr></tbody></table>\n<h3 id=\"function-tool-call\"><a href=\"#function-tool-call\">Function Tool Call</a></h3>\n<p>A tool call to run a function.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>Identifier for this function tool call.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function_call&#x27;)</code></td><td>Yes</td><td>Item type; always <code>function_call</code>.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier the model assigned to this function tool call. (minLength: 1, maxLength: 64)</td></tr><tr><td><code>namespace</code></td><td><code>string</code></td><td>No</td><td>Namespace of the function to run.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the function to run.</td></tr><tr><td><code>arguments</code></td><td><code>string</code></td><td>Yes</td><td>Arguments to pass to the function, as a JSON string.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr></tbody></table>\n<h3 id=\"function-tool-call-output\"><a href=\"#function-tool-call-output\">Function Tool Call Output</a></h3>\n<p>The output your code returns for a function tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>Identifier for this function tool call output; set when the item is returned by the API.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function_call_output&#x27;)</code></td><td>Yes</td><td>Output item type; always <code>function_call_output</code>.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the function tool call this output answers.</td></tr><tr><td><code>output</code></td><td><code>string</code> | array of <a href=\"#function-and-custom-tool-call-output\"><code>FunctionAndCustomToolCallOutput</code></a></td><td>Yes</td><td>The result your code produces for the function call, as a string or a list of output content.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr></tbody></table>\n<h3 id=\"function-tool-call-output-resource\"><a href=\"#function-tool-call-output-resource\">Function Tool Call Output Resource</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this function call output.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;function_call_output&#x27;)</code></td><td>Yes</td><td>Output item type; always <code>function_call_output</code>.</td></tr><tr><td><code>call_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the function tool call this output answers.</td></tr><tr><td><code>output</code></td><td><code>string</code> | array of <a href=\"#function-and-custom-tool-call-output\"><code>FunctionAndCustomToolCallOutput</code></a></td><td>Yes</td><td>The result your code produces for the function call, as a string or a list of output content.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-output-status-enum\"><code>FunctionCallOutputStatusEnum</code></a></td><td>Yes</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr><tr><td><code>created_by</code></td><td><code>string</code></td><td>No</td><td>Identifier of the actor that created the item.</td></tr></tbody></table>\n<h3 id=\"image-detail\"><a href=\"#image-detail\">Image Detail</a></h3>\n<p>Type: <code>enum (&#x27;low&#x27;, &#x27;high&#x27;, &#x27;auto&#x27;, &#x27;original&#x27;)</code></p>\n<h3 id=\"include-enum\"><a href=\"#include-enum\">Include Enum</a></h3>\n<p>Specify additional output data to include in the model response. Currently supported values are:</p>\n<ul>\n<li><code>web_search_call.action.sources</code>: Include the sources of the web search tool call.</li>\n<li><code>code_interpreter_call.outputs</code>: Includes the outputs of python code execution in code interpreter tool call items.</li>\n<li><code>computer_call_output.output.image_url</code>: Include image urls from the computer call output.</li>\n<li><code>file_search_call.results</code>: Include the search results of the file search tool call.</li>\n<li><code>message.input_image.image_url</code>: Include image urls from the input message.</li>\n<li><code>message.output_text.logprobs</code>: Include logprobs with assistant messages.</li>\n<li><code>reasoning.encrypted_content</code>: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using encrypted reasoning replay.</li>\n</ul>\n<p>Type: <code>enum (&#x27;file_search_call.results&#x27;, &#x27;web_search_call.results&#x27;, &#x27;web_search_call.action.sources&#x27;, &#x27;message.input_image.image_url&#x27;, &#x27;computer_call_output.output.image_url&#x27;, &#x27;code_interpreter_call.outputs&#x27;, &#x27;reasoning.encrypted_content&#x27;, &#x27;message.output_text.logprobs&#x27;)</code></p>\n<h3 id=\"input-audio-content\"><a href=\"#input-audio-content\">Input Audio Content</a></h3>\n<p>Audio input to the model. Provide inline base64 data, a URL or base64 data URI, or an uploaded file ID.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_audio&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_audio</code>. (default: input_audio)</td></tr><tr><td><code>input_audio</code></td><td><code>object</code></td><td>No</td><td>Inline base64-encoded audio and its format.</td></tr><tr><td><code>input_audio.data</code></td><td><code>string</code></td><td>Yes</td><td>Base64-encoded audio data.</td></tr><tr><td><code>input_audio.format</code></td><td><code>enum (&#x27;wav&#x27;, &#x27;mp3&#x27;)</code></td><td>Yes</td><td>The format of the encoded audio data. Supports <code>wav</code> and <code>mp3</code>.</td></tr><tr><td><code>audio_url</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"input-content\"><a href=\"#input-content\">Input Content</a></h3>\n<p>Type: <a href=\"#input-text-content\"><code>InputTextContent</code></a> | <a href=\"#input-image-content\"><code>InputImageContent</code></a> | <a href=\"#input-file-content\"><code>InputFileContent</code></a> | <a href=\"#input-video-content\"><code>InputVideoContent</code></a> | <a href=\"#input-audio-content\"><code>InputAudioContent</code></a> | <a href=\"#output-text-content\"><code>OutputTextContent</code></a> | <a href=\"#refusal-content\"><code>RefusalContent</code></a></p>\n<h3 id=\"input-file-content\"><a href=\"#input-file-content\">Input File Content</a></h3>\n<p>A file provided as input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_file&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_file</code>. (default: input_file)</td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>filename</code></td><td><code>string</code></td><td>No</td><td>Name of the file passed to the model.</td></tr><tr><td><code>file_data</code></td><td><code>string</code></td><td>No</td><td>Contents of the file passed to the model.</td></tr><tr><td><code>file_url</code></td><td><code>string</code></td><td>No</td><td>URL of the file passed to the model.</td></tr><tr><td><code>detail</code></td><td><a href=\"#file-input-detail\"><code>FileInputDetail</code></a></td><td>No</td><td>Render detail for the file: <code>low</code> for default rendering, <code>high</code> for higher quality. Defaults to <code>low</code>.</td></tr></tbody></table>\n<h3 id=\"input-file-content-param\"><a href=\"#input-file-content-param\">Input File Content Param</a></h3>\n<p>A file provided as input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_file&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_file</code>. (default: input_file)</td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>filename</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_data</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_url</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>detail</code></td><td><a href=\"#file-detail-enum\"><code>FileDetailEnum</code></a></td><td>No</td><td>Render detail for the file: <code>low</code> for default rendering, <code>high</code> for higher quality. Defaults to <code>low</code>.</td></tr></tbody></table>\n<h3 id=\"input-image-content\"><a href=\"#input-image-content\">Input Image Content</a></h3>\n<p>An image input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_image&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_image</code>. (default: input_image)</td></tr><tr><td><code>image_url</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>detail</code></td><td><a href=\"#image-detail\"><code>ImageDetail</code></a></td><td>No</td><td>Render detail for the image: one of <code>high</code>, <code>low</code>, <code>auto</code>, or <code>original</code>. Defaults to <code>auto</code>.</td></tr></tbody></table>\n<h3 id=\"input-image-content-param-auto-param\"><a href=\"#input-image-content-param-auto-param\">Input Image Content Param Auto Param</a></h3>\n<p>An image input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_image&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_image</code>. (default: input_image)</td></tr><tr><td><code>image_url</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>detail</code></td><td><a href=\"#detail-enum\"><code>DetailEnum</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"input-item\"><a href=\"#input-item\">Input Item</a></h3>\n<p>Type: <a href=\"#easy-input-message\"><code>EasyInputMessage</code></a> | <a href=\"#item\"><code>Item</code></a> | <a href=\"#item-reference-param\"><code>ItemReferenceParam</code></a></p>\n<h3 id=\"input-message\"><a href=\"#input-message\">Input Message</a></h3>\n<p>A message provided as input, tagged with a role. <code>developer</code> and <code>system</code> instructions take precedence over <code>user</code> instructions.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;message&#x27;)</code></td><td>No</td><td>Item type; always <code>message</code>.</td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;user&#x27;, &#x27;system&#x27;, &#x27;developer&#x27;)</code></td><td>Yes</td><td>Author role: one of <code>user</code>, <code>system</code>, or <code>developer</code>.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr><tr><td><code>content</code></td><td><a href=\"#input-message-content-list\"><code>InputMessageContentList</code></a></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"input-message-content-list\"><a href=\"#input-message-content-list\">Input Message Content List</a></h3>\n<p>An ordered list of input content parts of varying types.</p>\n<p>Type: array of <a href=\"#input-content\"><code>InputContent</code></a></p>\n<h3 id=\"input-param\"><a href=\"#input-param\">Input Param</a></h3>\n<p>Text, image, or file inputs to the model, used to generate a response.</p>\n<p>Type: <code>string</code> | array of <a href=\"#input-item\"><code>InputItem</code></a></p>\n<h3 id=\"input-text-content\"><a href=\"#input-text-content\">Input Text Content</a></h3>\n<p>Text provided as input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_text&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_text</code>. (default: input_text)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The input text.</td></tr></tbody></table>\n<h3 id=\"input-text-content-param\"><a href=\"#input-text-content-param\">Input Text Content Param</a></h3>\n<p>Text provided as input to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_text&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>input_text</code>. (default: input_text)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The input text. (maxLength: 10485760)</td></tr></tbody></table>\n<h3 id=\"input-video-content\"><a href=\"#input-video-content\">Input Video Content</a></h3>\n<p>Video input to the model. Provide as URL, base64 data URI, or uploaded file ID.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;input_video&#x27;)</code></td><td>Yes</td><td>Object type; always <code>input_video</code>. (default: input_video)</td></tr><tr><td><code>video_url</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>file_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>fps</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"item\"><a href=\"#item\">Item</a></h3>\n<p>Shared schema for items in conversation and response history (input side).</p>\n<p>Type: <a href=\"#input-message\"><code>InputMessage</code></a> | <a href=\"#output-message\"><code>OutputMessage</code></a> | <a href=\"#computer-tool-call\"><code>ComputerToolCall</code></a> | <a href=\"#computer-call-output-item-param\"><code>ComputerCallOutputItemParam</code></a> | <a href=\"#web-search-tool-call\"><code>WebSearchToolCall</code></a> | <a href=\"#function-tool-call\"><code>FunctionToolCall</code></a> | <a href=\"#function-call-output-item-param\"><code>FunctionCallOutputItemParam</code></a> | <a href=\"#tool-search-call-item-param\"><code>ToolSearchCallItemParam</code></a> | <a href=\"#tool-search-output-item-param\"><code>ToolSearchOutputItemParam</code></a> | <a href=\"#reasoning-item-param\"><code>ReasoningItemParam</code></a> | <a href=\"#compaction-summary-item-param\"><code>CompactionSummaryItemParam</code></a></p>\n<h3 id=\"item-reference-param\"><a href=\"#item-reference-param\">Item Reference Param</a></h3>\n<p>A reference to an existing item by ID.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;item_reference&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the item to reference.</td></tr></tbody></table>\n<h3 id=\"key-press-action\"><a href=\"#key-press-action\">Key Press Action</a></h3>\n<p>A collection of keypresses the model would like to perform.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;keypress&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a keypress action, this property is always set to <code>keypress</code>. (default: keypress)</td></tr><tr><td><code>keys</code></td><td><code>array of string</code></td><td>Yes</td><td>The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key.</td></tr></tbody></table>\n<h3 id=\"log-prob\"><a href=\"#log-prob\">Log Prob</a></h3>\n<p>The log probability of a token.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>logprob</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>bytes</code></td><td><code>array of integer</code></td><td>Yes</td><td></td></tr><tr><td><code>top_logprobs</code></td><td>array of <a href=\"#top-log-prob\"><code>TopLogProb</code></a></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"message-phase\"><a href=\"#message-phase\">Message Phase</a></h3>\n<p>Labels an <code>assistant</code> message as intermediate commentary (<code>commentary</code>) or the final answer (<code>final_answer</code>). When sending follow-up requests, preserve and resend phase on all assistant messages \u2014 dropping it can degrade performance. Not used for user messages.</p>\n<p>Type: <code>enum (&#x27;commentary&#x27;, &#x27;final_answer&#x27;)</code></p>\n<h3 id=\"metadata\"><a href=\"#metadata\">Metadata</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"model-response-properties\"><a href=\"#model-response-properties\">Model Response Properties</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>No</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"move-param\"><a href=\"#move-param\">Move Param</a></h3>\n<p>A mouse move action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;move&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a move action, this property is always set to <code>move</code>. (default: move)</td></tr><tr><td><code>x</code></td><td><code>integer</code></td><td>Yes</td><td>The x-coordinate to move to.</td></tr><tr><td><code>y</code></td><td><code>integer</code></td><td>Yes</td><td>The y-coordinate to move to.</td></tr></tbody></table>\n<h3 id=\"output-content\"><a href=\"#output-content\">Output Content</a></h3>\n<p>Type: <a href=\"#output-text-content\"><code>OutputTextContent</code></a> | <a href=\"#refusal-content\"><code>RefusalContent</code></a> | <a href=\"#reasoning-text-content\"><code>ReasoningTextContent</code></a></p>\n<h3 id=\"output-item\"><a href=\"#output-item\">Output Item</a></h3>\n<p>Type: <a href=\"#output-message\"><code>OutputMessage</code></a> | <a href=\"#function-tool-call\"><code>FunctionToolCall</code></a> | <a href=\"#function-tool-call-output-resource\"><code>FunctionToolCallOutputResource</code></a> | <a href=\"#web-search-tool-call\"><code>WebSearchToolCall</code></a> | <a href=\"#computer-tool-call\"><code>ComputerToolCall</code></a> | <a href=\"#computer-tool-call-output-resource\"><code>ComputerToolCallOutputResource</code></a> | <a href=\"#reasoning-item\"><code>ReasoningItem</code></a> | <a href=\"#tool-search-call\"><code>ToolSearchCall</code></a> | <a href=\"#tool-search-output\"><code>ToolSearchOutput</code></a> | <a href=\"#compaction-body\"><code>CompactionBody</code></a></p>\n<h3 id=\"output-message\"><a href=\"#output-message\">Output Message</a></h3>\n<p>A message generated by the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>Identifier for this output message.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;message&#x27;)</code></td><td>Yes</td><td>Item type; always <code>message</code>.</td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;assistant&#x27;)</code></td><td>Yes</td><td>Author role; always <code>assistant</code>.</td></tr><tr><td><code>content</code></td><td>array of <a href=\"#output-message-content\"><code>OutputMessageContent</code></a></td><td>Yes</td><td>The output message content.</td></tr><tr><td><code>phase</code></td><td><a href=\"#message-phase\"><code>MessagePhase</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr></tbody></table>\n<h3 id=\"output-message-content\"><a href=\"#output-message-content\">Output Message Content</a></h3>\n<p>Type: <a href=\"#output-text-content\"><code>OutputTextContent</code></a> | <a href=\"#refusal-content\"><code>RefusalContent</code></a></p>\n<h3 id=\"output-text-content\"><a href=\"#output-text-content\">Output Text Content</a></h3>\n<p>Text generated by the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;output_text&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>output_text</code>. (default: output_text)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The generated text.</td></tr><tr><td><code>annotations</code></td><td>array of <a href=\"#annotation\"><code>Annotation</code></a></td><td>No</td><td>Annotations attached to the text output.</td></tr><tr><td><code>logprobs</code></td><td>array of <a href=\"#log-prob\"><code>LogProb</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"prompt\"><a href=\"#prompt\">Prompt</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"reasoning\"><a href=\"#reasoning\">Reasoning</a></h3>\n<p>Configuration options for reasoning.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>effort</code></td><td><a href=\"#reasoning-effort\"><code>ReasoningEffort</code></a></td><td>No</td><td></td></tr><tr><td><code>summary</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;concise&#x27;, &#x27;detailed&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>generate_summary</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;concise&#x27;, &#x27;detailed&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"reasoning-effort\"><a href=\"#reasoning-effort\">Reasoning Effort</a></h3>\n<p>Type: <code>enum (&#x27;none&#x27;, &#x27;minimal&#x27;, &#x27;low&#x27;, &#x27;medium&#x27;, &#x27;high&#x27;, &#x27;xhigh&#x27;, &#x27;max&#x27;)</code> | <code>null</code></p>\n<h3 id=\"reasoning-item\"><a href=\"#reasoning-item\">Reasoning Item</a></h3>\n<p>A record of the model&#x27;s chain of thought for a turn. When you manage context manually, include these items in <code>input</code> on later turns so the model retains its reasoning.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;reasoning&#x27;)</code></td><td>Yes</td><td>Item type; always <code>reasoning</code>.</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this reasoning item.</td></tr><tr><td><code>encrypted_content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>summary</code></td><td>array of <a href=\"#summary-text-content\"><code>SummaryTextContent</code></a></td><td>Yes</td><td>Summarized reasoning content.</td></tr><tr><td><code>content</code></td><td>array of <a href=\"#reasoning-text-content\"><code>ReasoningTextContent</code></a></td><td>No</td><td>Reasoning text content.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Item status: <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Set when the item is returned by the API.</td></tr></tbody></table>\n<h3 id=\"reasoning-item-param\"><a href=\"#reasoning-item-param\">Reasoning Item Param</a></h3>\n<p>Input form for a reasoning item. The <code>id</code> is optional on input and required on output. The <code>encrypted_content</code> field carries opaque reasoning state for stateless multi-turn replay.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;reasoning&#x27;)</code></td><td>Yes</td><td>Object type; always <code>reasoning</code>.</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>No</td><td>Identifier for this reasoning item. Optional on input; required on output.</td></tr><tr><td><code>encrypted_content</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>summary</code></td><td>array of <a href=\"#summary-text-content\"><code>SummaryTextContent</code></a></td><td>Yes</td><td>Summarized reasoning content.</td></tr><tr><td><code>content</code></td><td>array of <a href=\"#reasoning-text-content\"><code>ReasoningTextContent</code></a></td><td>No</td><td>Reasoning text content.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;completed&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>The status of the item. One of <code>in_progress</code>, <code>completed</code>, or <code>incomplete</code>. Populated when items are returned via API.</td></tr></tbody></table>\n<h3 id=\"reasoning-text-content\"><a href=\"#reasoning-text-content\">Reasoning Text Content</a></h3>\n<p>Reasoning text emitted by the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;reasoning_text&#x27;)</code></td><td>Yes</td><td>Content-part type; always <code>reasoning_text</code>. (default: reasoning_text)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The reasoning text.</td></tr></tbody></table>\n<h3 id=\"refusal-content\"><a href=\"#refusal-content\">Refusal Content</a></h3>\n<p>A refusal from the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;refusal&#x27;)</code></td><td>Yes</td><td>Object type; always <code>refusal</code>. (default: refusal)</td></tr><tr><td><code>refusal</code></td><td><code>string</code></td><td>Yes</td><td>The refusal explanation from the model.</td></tr></tbody></table>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>metadata</code></td><td><a href=\"#metadata\"><code>Metadata</code></a></td><td>Yes</td><td></td></tr><tr><td><code>top_logprobs</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>top_p</code></td><td><code>number</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>Being replaced by <code>safety_identifier</code> and <code>prompt_cache_key</code>; use <code>prompt_cache_key</code> to retain caching benefits. A stable end-user identifier used to improve cache hit rates and help detect abuse.</td></tr><tr><td><code>safety_identifier</code></td><td><code>string</code></td><td>No</td><td>A stable identifier that helps detect users who may be violating usage policies. Use a string that uniquely identifies each user, up to 64 characters; hash a username or email so you do not send identifying information. (maxLength: 64)</td></tr><tr><td><code>prompt_cache_key</code></td><td><code>string</code></td><td>No</td><td>Groups similar requests to improve cache hit rates. Replaces the <code>user</code> field.</td></tr><tr><td><code>service_tier</code></td><td><a href=\"#service-tier\"><code>ServiceTier</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt_cache_retention</code></td><td><code>enum (&#x27;in_memory&#x27;, &#x27;24h&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>previous_response_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>ID of the model used to generate the response.</td></tr><tr><td><code>reasoning</code></td><td><a href=\"#reasoning\"><code>Reasoning</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>background</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>max_tool_calls</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>text</code></td><td><a href=\"#response-text-param\"><code>ResponseTextParam</code></a></td><td>No</td><td></td></tr><tr><td><code>tools</code></td><td><a href=\"#tools-array\"><code>ToolsArray</code></a></td><td>Yes</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#tool-choice-param\"><code>ToolChoiceParam</code></a></td><td>Yes</td><td></td></tr><tr><td><code>prompt</code></td><td><a href=\"#prompt\"><code>Prompt</code></a></td><td>No</td><td></td></tr><tr><td><code>truncation</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;disabled&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>frequency_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from repeating tokens it has already used often, reducing verbatim repetition. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>presence_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from reusing tokens that have already appeared, encouraging it to introduce new topics. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this response.</td></tr><tr><td><code>object</code></td><td><code>enum (&#x27;response&#x27;)</code></td><td>Yes</td><td>Object type; always <code>response</code>.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;completed&#x27;, &#x27;failed&#x27;, &#x27;in_progress&#x27;, &#x27;cancelled&#x27;, &#x27;queued&#x27;, &#x27;incomplete&#x27;)</code></td><td>No</td><td>Generation status: one of <code>completed</code>, <code>failed</code>, <code>in_progress</code>, <code>cancelled</code>, <code>queued</code>, or <code>incomplete</code>.</td></tr><tr><td><code>created_at</code></td><td><code>number (unixtime)</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the response was created.</td></tr><tr><td><code>completed_at</code></td><td><code>number (unixtime)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>error</code></td><td><a href=\"#response-error\"><code>ResponseError</code></a></td><td>Yes</td><td></td></tr><tr><td><code>incomplete_details</code></td><td><code>object</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>output</code></td><td>array of <a href=\"#output-item\"><code>OutputItem</code></a></td><td>Yes</td><td>The items the model generated. Their number and order depend on the response; where SDKs expose it, prefer the <code>output_text</code> helper over indexing into this array.</td></tr><tr><td><code>instructions</code></td><td><code>string</code> | array of <a href=\"#input-item\"><code>InputItem</code></a> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>output_text</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>usage</code></td><td><a href=\"#response-usage\"><code>ResponseUsage</code></a></td><td>No</td><td></td></tr><tr><td><code>parallel_tool_calls</code></td><td><code>boolean</code></td><td>Yes</td><td>Whether the model may run tool calls in parallel. (default: true)</td></tr><tr><td><code>store</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>conversation</code></td><td><a href=\"#conversation-2\"><code>Conversation-2</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>max_output_tokens</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"response-completed-event\"><a href=\"#response-completed-event\">Response Completed Event</a></h3>\n<p>Signals that the response has finished and all output is final.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.completed&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.completed</code>.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The finished response object.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-content-part-added-event\"><a href=\"#response-content-part-added-event\">Response Content Part Added Event</a></h3>\n<p>Signals that a new content part has started within an output item.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.content_part.added&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.content_part.added</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>part</code></td><td><a href=\"#output-content\"><code>OutputContent</code></a></td><td>Yes</td><td>The newly opened content part.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-content-part-done-event\"><a href=\"#response-content-part-done-event\">Response Content Part Done Event</a></h3>\n<p>Signals that a content part has finished streaming.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.content_part.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.content_part.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>part</code></td><td><a href=\"#output-content\"><code>OutputContent</code></a></td><td>Yes</td><td>The finished content part.</td></tr></tbody></table>\n<h3 id=\"response-created-event\"><a href=\"#response-created-event\">Response Created Event</a></h3>\n<p>Signals that the response has been created and streaming has begun.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.created&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.created</code>.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The newly created response object.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-error\"><a href=\"#response-error\">Response Error</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"response-error-code\"><a href=\"#response-error-code\">Response Error Code</a></h3>\n<p>Error code for the response.</p>\n<p>Type: <code>enum (&#x27;server_error&#x27;, &#x27;rate_limit_exceeded&#x27;, &#x27;invalid_prompt&#x27;, &#x27;vector_store_timeout&#x27;, &#x27;invalid_image&#x27;, &#x27;invalid_image_format&#x27;, &#x27;invalid_base64_image&#x27;, &#x27;invalid_image_url&#x27;, &#x27;image_too_large&#x27;, &#x27;image_too_small&#x27;, &#x27;image_parse_error&#x27;, &#x27;image_content_policy_violation&#x27;, &#x27;invalid_image_mode&#x27;, &#x27;image_file_too_large&#x27;, &#x27;unsupported_image_media_type&#x27;, &#x27;empty_image_file&#x27;, &#x27;failed_to_download_image&#x27;, &#x27;image_file_not_found&#x27;)</code></p>\n<h3 id=\"response-error-event\"><a href=\"#response-error-event\">Response Error Event</a></h3>\n<p>Reports an error that interrupted the stream.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;error&#x27;)</code></td><td>Yes</td><td>Event type; always <code>error</code>.</td></tr><tr><td><code>code</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>message</code></td><td><code>string</code></td><td>Yes</td><td>Human-readable error message.</td></tr><tr><td><code>param</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-failed-event\"><a href=\"#response-failed-event\">Response Failed Event</a></h3>\n<p>Signals that the response terminated with a failure.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.failed&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.failed</code>.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The response object in its failed state.</td></tr></tbody></table>\n<h3 id=\"response-format-json-object\"><a href=\"#response-format-json-object\">Response Format Json Object</a></h3>\n<p>JSON mode: forces the output to be valid JSON. Prefer <code>json_schema</code> where supported. The model only emits JSON if a system or user message instructs it to.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;json_object&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>json_object</code>.</td></tr></tbody></table>\n<h3 id=\"response-format-json-schema-schema\"><a href=\"#response-format-json-schema-schema\">Response Format Json Schema Schema</a></h3>\n<p>The response-format schema, expressed as a JSON Schema object. See the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://json-schema.org/\">JSON Schema reference<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" width=\"1em\" height=\"1em\"><path d=\"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6\"></path><path d=\"M15 3h6v6\"></path><path d=\"M10 14L21 3\"></path></svg>(opens in new tab)</a> for the format.</p>\n<p>Type: <code>object</code></p>\n<h3 id=\"response-format-text\"><a href=\"#response-format-text\">Response Format Text</a></h3>\n<p>Plain-text response format (the default).</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;text&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>text</code>.</td></tr></tbody></table>\n<h3 id=\"response-function-call-arguments-delta-event\"><a href=\"#response-function-call-arguments-delta-event\">Response Function Call Arguments Delta Event</a></h3>\n<p>Carries an incremental chunk of a function call&#x27;s argument string.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.function_call_arguments.delta&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.function_call_arguments.delta</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>delta</code></td><td><code>string</code></td><td>Yes</td><td>The argument-string fragment in this chunk.</td></tr></tbody></table>\n<h3 id=\"response-function-call-arguments-done-event\"><a href=\"#response-function-call-arguments-done-event\">Response Function Call Arguments Done Event</a></h3>\n<p>Signals that a function call&#x27;s arguments are complete.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.function_call_arguments.done&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the called function.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>arguments</code></td><td><code>string</code></td><td>Yes</td><td>The complete argument string, as JSON.</td></tr></tbody></table>\n<h3 id=\"response-in-progress-event\"><a href=\"#response-in-progress-event\">Response In Progress Event</a></h3>\n<p>Reports that the response is still being generated.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.in_progress&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.in_progress</code>.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The response object as generated so far.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-incomplete-event\"><a href=\"#response-incomplete-event\">Response Incomplete Event</a></h3>\n<p>Signals that the response ended in an incomplete state.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.incomplete&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.incomplete</code>.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The response object in its incomplete state.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-log-prob\"><a href=\"#response-log-prob\">Response Log Prob</a></h3>\n<p>The log probability the model assigned to a token at a position. Higher (less negative) values indicate greater confidence in that choice.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td><td>Yes</td><td>A candidate text token.</td></tr><tr><td><code>logprob</code></td><td><code>number</code></td><td>Yes</td><td>Log probability of this token.</td></tr><tr><td><code>top_logprobs</code></td><td><code>array of object</code></td><td>No</td><td>The most likely alternative tokens at this position with their log probabilities, up to the number set by <code>top_logprobs</code> (maximum 20).</td></tr><tr><td><code>top_logprobs[].token</code></td><td><code>string</code></td><td>No</td><td>A candidate text token.</td></tr><tr><td><code>top_logprobs[].logprob</code></td><td><code>number</code></td><td>No</td><td>Log probability of this token.</td></tr></tbody></table>\n<h3 id=\"response-output-item-added-event\"><a href=\"#response-output-item-added-event\">Response Output Item Added Event</a></h3>\n<p>Signals that a new output item has started.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.output_item.added&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.output_item.added</code>.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>item</code></td><td><a href=\"#output-item\"><code>OutputItem</code></a></td><td>Yes</td><td>The newly opened output item.</td></tr></tbody></table>\n<h3 id=\"response-output-item-done-event\"><a href=\"#response-output-item-done-event\">Response Output Item Done Event</a></h3>\n<p>Signals that an output item has finished streaming.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.output_item.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.output_item.done</code>.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>item</code></td><td><a href=\"#output-item\"><code>OutputItem</code></a></td><td>Yes</td><td>The finished output item.</td></tr></tbody></table>\n<h3 id=\"response-output-text-annotation-added-event\"><a href=\"#response-output-text-annotation-added-event\">Response Output Text Annotation Added Event</a></h3>\n<p>Carries an annotation, such as a citation, attached to streamed output text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.output_text.annotation.added&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.output_text.annotation.added</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>annotation_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of this annotation within the content part.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>annotation</code></td><td><code>object</code></td><td>Yes</td><td>The annotation being attached to the output text.</td></tr></tbody></table>\n<h3 id=\"response-prompt-variables\"><a href=\"#response-prompt-variables\">Response Prompt Variables</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"response-properties\"><a href=\"#response-properties\">Response Properties</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>previous_response_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>No</td><td>ID of the model used to generate the response.</td></tr><tr><td><code>reasoning</code></td><td><a href=\"#reasoning\"><code>Reasoning</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>background</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>max_tool_calls</code></td><td><code>integer</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>text</code></td><td><a href=\"#response-text-param\"><code>ResponseTextParam</code></a></td><td>No</td><td></td></tr><tr><td><code>tools</code></td><td><a href=\"#tools-array\"><code>ToolsArray</code></a></td><td>No</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#tool-choice-param\"><code>ToolChoiceParam</code></a></td><td>No</td><td></td></tr><tr><td><code>prompt</code></td><td><a href=\"#prompt\"><code>Prompt</code></a></td><td>No</td><td></td></tr><tr><td><code>truncation</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;disabled&#x27;)</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>frequency_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from repeating tokens it has already used often, reducing verbatim repetition. (minimum: -2, maximum: 2, default: 0)</td></tr><tr><td><code>presence_penalty</code></td><td><code>number</code></td><td>No</td><td>A number between -2.0 and 2.0. Positive values discourage the model from reusing tokens that have already appeared, encouraging it to introduce new topics. (minimum: -2, maximum: 2, default: 0)</td></tr></tbody></table>\n<h3 id=\"response-queued-event\"><a href=\"#response-queued-event\">Response Queued Event</a></h3>\n<p>Signals that the response is queued and awaiting processing.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.queued&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.queued</code>.</td></tr><tr><td><code>response</code></td><td><a href=\"#response\"><code>Response</code></a></td><td>Yes</td><td>The queued response object.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-summary-part-added-event\"><a href=\"#response-reasoning-summary-part-added-event\">Response Reasoning Summary Part Added Event</a></h3>\n<p>Signals that a new reasoning-summary part has started.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_summary_part.added&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_summary_part.added</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>summary_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of this summary part within the reasoning summary.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>part</code></td><td><code>object</code></td><td>Yes</td><td>The newly opened summary part.</td></tr><tr><td><code>part.type</code></td><td><code>enum (&#x27;summary_text&#x27;)</code></td><td>Yes</td><td>Summary-part type; always <code>summary_text</code>.</td></tr><tr><td><code>part.text</code></td><td><code>string</code></td><td>Yes</td><td>The summary-part text.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-summary-part-done-event\"><a href=\"#response-reasoning-summary-part-done-event\">Response Reasoning Summary Part Done Event</a></h3>\n<p>Signals that a reasoning-summary part has finished.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_summary_part.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_summary_part.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>summary_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of this summary part within the reasoning summary.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>part</code></td><td><code>object</code></td><td>Yes</td><td>The finished summary part.</td></tr><tr><td><code>part.type</code></td><td><code>enum (&#x27;summary_text&#x27;)</code></td><td>Yes</td><td>Summary-part type; always <code>summary_text</code>.</td></tr><tr><td><code>part.text</code></td><td><code>string</code></td><td>Yes</td><td>The summary-part text.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-summary-text-delta-event\"><a href=\"#response-reasoning-summary-text-delta-event\">Response Reasoning Summary Text Delta Event</a></h3>\n<p>Carries an incremental chunk of reasoning-summary text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_summary_text.delta&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_summary_text.delta</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>summary_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of this summary part within the reasoning summary.</td></tr><tr><td><code>delta</code></td><td><code>string</code></td><td>Yes</td><td>The summary-text fragment in this chunk.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-summary-text-done-event\"><a href=\"#response-reasoning-summary-text-done-event\">Response Reasoning Summary Text Done Event</a></h3>\n<p>Signals that a reasoning-summary text block is complete.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_summary_text.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_summary_text.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>summary_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of this summary part within the reasoning summary.</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The complete reasoning-summary text.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-text-delta-event\"><a href=\"#response-reasoning-text-delta-event\">Response Reasoning Text Delta Event</a></h3>\n<p>Carries an incremental chunk of reasoning text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_text.delta&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_text.delta</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the reasoning content part within the output item.</td></tr><tr><td><code>delta</code></td><td><code>string</code></td><td>Yes</td><td>The reasoning-text fragment in this chunk.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-reasoning-text-done-event\"><a href=\"#response-reasoning-text-done-event\">Response Reasoning Text Done Event</a></h3>\n<p>Signals that a reasoning text block is complete.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.reasoning_text.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.reasoning_text.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the reasoning content part within the output item.</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The complete reasoning text.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-refusal-delta-event\"><a href=\"#response-refusal-delta-event\">Response Refusal Delta Event</a></h3>\n<p>Carries an incremental chunk of refusal text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.refusal.delta&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.refusal.delta</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>delta</code></td><td><code>string</code></td><td>Yes</td><td>The refusal-text fragment in this chunk.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-refusal-done-event\"><a href=\"#response-refusal-done-event\">Response Refusal Done Event</a></h3>\n<p>Signals that the refusal text is complete.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.refusal.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.refusal.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>refusal</code></td><td><code>string</code></td><td>Yes</td><td>The complete refusal text.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-stream-event\"><a href=\"#response-stream-event\">Response Stream Event</a></h3>\n<p>Type: <a href=\"#response-completed-event\"><code>ResponseCompletedEvent</code></a> | <a href=\"#response-content-part-added-event\"><code>ResponseContentPartAddedEvent</code></a> | <a href=\"#response-content-part-done-event\"><code>ResponseContentPartDoneEvent</code></a> | <a href=\"#response-created-event\"><code>ResponseCreatedEvent</code></a> | <a href=\"#response-error-event\"><code>ResponseErrorEvent</code></a> | <a href=\"#response-function-call-arguments-delta-event\"><code>ResponseFunctionCallArgumentsDeltaEvent</code></a> | <a href=\"#response-function-call-arguments-done-event\"><code>ResponseFunctionCallArgumentsDoneEvent</code></a> | <a href=\"#response-in-progress-event\"><code>ResponseInProgressEvent</code></a> | <a href=\"#response-failed-event\"><code>ResponseFailedEvent</code></a> | <a href=\"#response-incomplete-event\"><code>ResponseIncompleteEvent</code></a> | <a href=\"#response-output-item-added-event\"><code>ResponseOutputItemAddedEvent</code></a> | <a href=\"#response-output-item-done-event\"><code>ResponseOutputItemDoneEvent</code></a> | <a href=\"#response-reasoning-summary-part-added-event\"><code>ResponseReasoningSummaryPartAddedEvent</code></a> | <a href=\"#response-reasoning-summary-part-done-event\"><code>ResponseReasoningSummaryPartDoneEvent</code></a> | <a href=\"#response-reasoning-summary-text-delta-event\"><code>ResponseReasoningSummaryTextDeltaEvent</code></a> | <a href=\"#response-reasoning-summary-text-done-event\"><code>ResponseReasoningSummaryTextDoneEvent</code></a> | <a href=\"#response-reasoning-text-delta-event\"><code>ResponseReasoningTextDeltaEvent</code></a> | <a href=\"#response-reasoning-text-done-event\"><code>ResponseReasoningTextDoneEvent</code></a> | <a href=\"#response-refusal-delta-event\"><code>ResponseRefusalDeltaEvent</code></a> | <a href=\"#response-refusal-done-event\"><code>ResponseRefusalDoneEvent</code></a> | <a href=\"#response-text-delta-event\"><code>ResponseTextDeltaEvent</code></a> | <a href=\"#response-text-done-event\"><code>ResponseTextDoneEvent</code></a> | <a href=\"#response-web-search-call-completed-event\"><code>ResponseWebSearchCallCompletedEvent</code></a> | <a href=\"#response-web-search-call-in-progress-event\"><code>ResponseWebSearchCallInProgressEvent</code></a> | <a href=\"#response-web-search-call-searching-event\"><code>ResponseWebSearchCallSearchingEvent</code></a> | <a href=\"#response-output-text-annotation-added-event\"><code>ResponseOutputTextAnnotationAddedEvent</code></a> | <a href=\"#response-queued-event\"><code>ResponseQueuedEvent</code></a></p>\n<h3 id=\"response-stream-options\"><a href=\"#response-stream-options\">Response Stream Options</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"response-text-delta-event\"><a href=\"#response-text-delta-event\">Response Text Delta Event</a></h3>\n<p>Carries an incremental chunk of output text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.output_text.delta&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.output_text.delta</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>delta</code></td><td><code>string</code></td><td>Yes</td><td>The output-text fragment in this chunk.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>logprobs</code></td><td>array of <a href=\"#response-log-prob\"><code>ResponseLogProb</code></a></td><td>Yes</td><td>Log probabilities for the tokens in this chunk.</td></tr></tbody></table>\n<h3 id=\"response-text-done-event\"><a href=\"#response-text-done-event\">Response Text Done Event</a></h3>\n<p>Signals that a block of output text is complete.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.output_text.done&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.output_text.done</code>.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>content_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the content part within the output item.</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The complete output text.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr><tr><td><code>logprobs</code></td><td>array of <a href=\"#response-log-prob\"><code>ResponseLogProb</code></a></td><td>Yes</td><td>Log probabilities for the tokens in this chunk.</td></tr></tbody></table>\n<h3 id=\"response-text-param\"><a href=\"#response-text-param\">Response Text Param</a></h3>\n<p>Configuration options for a text response from the model. Can be plain text or structured JSON data.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>format</code></td><td><a href=\"#text-response-format-configuration\"><code>TextResponseFormatConfiguration</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"response-usage\"><a href=\"#response-usage\">Response Usage</a></h3>\n<p>Token usage for the response: input tokens, output tokens (with a breakdown), and the total.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>input_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Number of input tokens. For responses that run hosted tools, this is the sum of the reported input-token count for each model iteration, with accounting adjustments applied per iteration.</td></tr><tr><td><code>input_tokens_details</code></td><td><code>object</code></td><td>Yes</td><td>Breakdown of the input tokens.</td></tr><tr><td><code>input_tokens_details.cached_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Input tokens served from cache.</td></tr><tr><td><code>output_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Number of output tokens.</td></tr><tr><td><code>output_tokens_details</code></td><td><code>object</code></td><td>Yes</td><td>Breakdown of the output tokens.</td></tr><tr><td><code>output_tokens_details.reasoning_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Number of reasoning tokens, counted within the output token total.</td></tr><tr><td><code>total_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Total tokens used.</td></tr><tr><td><code>video_frames_processed</code></td><td><code>integer</code></td><td>No</td><td>Number of video frames processed for this segmentation request. Present only for video segmentation responses; used for per-frame billing.</td></tr><tr><td><code>images_processed</code></td><td><code>integer</code></td><td>No</td><td>Number of images processed for this segmentation request. Present only for image segmentation responses; used for per-image billing.</td></tr></tbody></table>\n<h3 id=\"response-web-search-call-completed-event\"><a href=\"#response-web-search-call-completed-event\">Response Web Search Call Completed Event</a></h3>\n<p>Signals that a web search call has finished.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.web_search_call.completed&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.web_search_call.completed</code>.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-web-search-call-in-progress-event\"><a href=\"#response-web-search-call-in-progress-event\">Response Web Search Call In Progress Event</a></h3>\n<p>Signals that a web search call has started.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.web_search_call.in_progress&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.web_search_call.in_progress</code>.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"response-web-search-call-searching-event\"><a href=\"#response-web-search-call-searching-event\">Response Web Search Call Searching Event</a></h3>\n<p>Signals that a web search call is actively searching.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;response.web_search_call.searching&#x27;)</code></td><td>Yes</td><td>Event type; always <code>response.web_search_call.searching</code>.</td></tr><tr><td><code>output_index</code></td><td><code>integer</code></td><td>Yes</td><td>Position of the related output item in the response output array.</td></tr><tr><td><code>item_id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier of the related output item.</td></tr><tr><td><code>sequence_number</code></td><td><code>integer</code></td><td>Yes</td><td>This event&#x27;s position in the stream.</td></tr></tbody></table>\n<h3 id=\"screenshot-param\"><a href=\"#screenshot-param\">Screenshot Param</a></h3>\n<p>A screenshot action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;screenshot&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a screenshot action, this property is always set to <code>screenshot</code>. (default: screenshot)</td></tr></tbody></table>\n<h3 id=\"scroll-param\"><a href=\"#scroll-param\">Scroll Param</a></h3>\n<p>A scroll action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;scroll&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a scroll action, this property is always set to <code>scroll</code>. (default: scroll)</td></tr><tr><td><code>x</code></td><td><code>integer</code></td><td>Yes</td><td>The x-coordinate where the scroll occurred.</td></tr><tr><td><code>y</code></td><td><code>integer</code></td><td>Yes</td><td>The y-coordinate where the scroll occurred.</td></tr><tr><td><code>scroll_x</code></td><td><code>integer</code></td><td>Yes</td><td>The horizontal scroll distance.</td></tr><tr><td><code>scroll_y</code></td><td><code>integer</code></td><td>Yes</td><td>The vertical scroll distance.</td></tr></tbody></table>\n<h3 id=\"service-tier\"><a href=\"#service-tier\">Service Tier</a></h3>\n<p>Type: <code>enum (&#x27;auto&#x27;, &#x27;default&#x27;, &#x27;flex&#x27;, &#x27;scale&#x27;, &#x27;priority&#x27;)</code> | <code>null</code></p>\n<h3 id=\"summary-text-content\"><a href=\"#summary-text-content\">Summary Text Content</a></h3>\n<p>A summary text from the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;summary_text&#x27;)</code></td><td>Yes</td><td>Object type; always <code>summary_text</code>. (default: summary_text)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>A summary of the reasoning output from the model so far.</td></tr></tbody></table>\n<h3 id=\"text-response-format-configuration\"><a href=\"#text-response-format-configuration\">Text Response Format Configuration</a></h3>\n<p>Constrains the model&#x27;s text output format. Use <code>{ &quot;type&quot;: &quot;json_schema&quot; }</code> for Structured Outputs (matches your JSON schema); the default is <code>{ &quot;type&quot;: &quot;text&quot; }</code>. <code>{ &quot;type&quot;: &quot;json_object&quot; }</code> selects the older JSON mode. Prefer <code>json_schema</code>.</p>\n<p>Type: <a href=\"#response-format-text\"><code>ResponseFormatText</code></a> | <a href=\"#text-response-format-json-schema\"><code>TextResponseFormatJsonSchema</code></a> | <a href=\"#response-format-json-object\"><code>ResponseFormatJsonObject</code></a></p>\n<h3 id=\"text-response-format-json-schema\"><a href=\"#text-response-format-json-schema\">Text Response Format Json Schema</a></h3>\n<p>JSON Schema response format. Used to generate structured JSON responses.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;json_schema&#x27;)</code></td><td>Yes</td><td>Response-format type; always <code>json_schema</code>.</td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>No</td><td>Describes what the format is for; the model uses it to decide how to respond.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>Yes</td><td>Name of the response format. Allowed characters: a-z, A-Z, 0-9, underscores, and dashes, up to 64 characters.</td></tr><tr><td><code>schema</code></td><td><a href=\"#response-format-json-schema-schema\"><code>ResponseFormatJsonSchemaSchema</code></a></td><td>Yes</td><td></td></tr><tr><td><code>strict</code></td><td><code>boolean</code> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"token-counts-resource\"><a href=\"#token-counts-resource\">Token Counts Resource</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>object</code></td><td><code>enum (&#x27;response.input_tokens&#x27;)</code></td><td>Yes</td><td>(default: response.input_tokens)</td></tr><tr><td><code>input_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Tokens in the fully rendered model input, including resolved history and server prompt scaffolding. This is a context-size measurement, not cumulative response usage.</td></tr></tbody></table>\n<h3 id=\"tool\"><a href=\"#tool\">Tool</a></h3>\n<p>A tool the model can use while generating a response.</p>\n<p>Type: <a href=\"#function-tool\"><code>FunctionTool</code></a> | <a href=\"#computer-tool\"><code>ComputerTool</code></a> | <a href=\"#web-search-tool\"><code>WebSearchTool</code></a> | <a href=\"#tool-search-tool-param\"><code>ToolSearchToolParam</code></a></p>\n<h3 id=\"tool-choice-options\"><a href=\"#tool-choice-options\">Tool Choice Options</a></h3>\n<p><code>auto</code> lets the model choose between replying with a message and making one or more tool calls.</p>\n<p>Type: <code>enum (&#x27;auto&#x27;)</code></p>\n<h3 id=\"tool-choice-param\"><a href=\"#tool-choice-param\">Tool Choice Param</a></h3>\n<p>How the model selects tools while generating a response. See <code>tools</code> for how to declare the tools it may call.</p>\n<p>Type: <a href=\"#tool-choice-options\"><code>ToolChoiceOptions</code></a></p>\n<h3 id=\"tool-search-call\"><a href=\"#tool-search-call\">Tool Search Call</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;tool_search_call&#x27;)</code></td><td>Yes</td><td>The type of the item. Always <code>tool_search_call</code>. (default: tool_search_call)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>The unique ID of the tool search call item.</td></tr><tr><td><code>call_id</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>execution</code></td><td><a href=\"#tool-search-execution-type\"><code>ToolSearchExecutionType</code></a></td><td>Yes</td><td>Whether tool search was executed by the server or by the client.</td></tr><tr><td><code>arguments</code></td><td></td><td>Yes</td><td>Arguments used for the tool search call.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-status\"><code>FunctionCallStatus</code></a></td><td>Yes</td><td>The status of the tool search call item that was recorded.</td></tr><tr><td><code>created_by</code></td><td><code>string</code></td><td>No</td><td>The identifier of the actor that created the item.</td></tr></tbody></table>\n<h3 id=\"tool-search-call-item-param\"><a href=\"#tool-search-call-item-param\">Tool Search Call Item Param</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>call_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;tool_search_call&#x27;)</code></td><td>Yes</td><td>The item type. Always <code>tool_search_call</code>. (default: tool_search_call)</td></tr><tr><td><code>execution</code></td><td><a href=\"#tool-search-execution-type\"><code>ToolSearchExecutionType</code></a></td><td>No</td><td>Whether tool search was executed by the server or by the client.</td></tr><tr><td><code>arguments</code></td><td><a href=\"#empty-model-param\"><code>EmptyModelParam</code></a></td><td>Yes</td><td>The arguments supplied to the tool search call.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-item-status\"><code>FunctionCallItemStatus</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"tool-search-execution-type\"><a href=\"#tool-search-execution-type\">Tool Search Execution Type</a></h3>\n<p>Type: <code>enum (&#x27;server&#x27;, &#x27;client&#x27;)</code></p>\n<h3 id=\"tool-search-output\"><a href=\"#tool-search-output\">Tool Search Output</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;tool_search_output&#x27;)</code></td><td>Yes</td><td>The type of the item. Always <code>tool_search_output</code>. (default: tool_search_output)</td></tr><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>The unique ID of the tool search output item.</td></tr><tr><td><code>call_id</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>execution</code></td><td><a href=\"#tool-search-execution-type\"><code>ToolSearchExecutionType</code></a></td><td>Yes</td><td>Whether tool search was executed by the server or by the client.</td></tr><tr><td><code>tools</code></td><td>array of <a href=\"#tool\"><code>Tool</code></a></td><td>Yes</td><td>The loaded tool definitions returned by tool search.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-output-status-enum\"><code>FunctionCallOutputStatusEnum</code></a></td><td>Yes</td><td>The status of the tool search output item that was recorded.</td></tr><tr><td><code>created_by</code></td><td><code>string</code></td><td>No</td><td>The identifier of the actor that created the item.</td></tr></tbody></table>\n<h3 id=\"tool-search-output-item-param\"><a href=\"#tool-search-output-item-param\">Tool Search Output Item Param</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>call_id</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;tool_search_output&#x27;)</code></td><td>Yes</td><td>The item type. Always <code>tool_search_output</code>. (default: tool_search_output)</td></tr><tr><td><code>execution</code></td><td><a href=\"#tool-search-execution-type\"><code>ToolSearchExecutionType</code></a></td><td>No</td><td>Whether tool search was executed by the server or by the client.</td></tr><tr><td><code>tools</code></td><td>array of <a href=\"#tool\"><code>Tool</code></a></td><td>Yes</td><td>The loaded tool definitions returned by the tool search output.</td></tr><tr><td><code>status</code></td><td><a href=\"#function-call-item-status\"><code>FunctionCallItemStatus</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"tool-search-tool-param\"><a href=\"#tool-search-tool-param\">Tool Search Tool Param</a></h3>\n<p>Hosted or BYOT tool search configuration for deferred tools.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;tool_search&#x27;)</code></td><td>Yes</td><td>The type of the tool. Always <code>tool_search</code>. (default: tool_search)</td></tr><tr><td><code>execution</code></td><td><a href=\"#tool-search-execution-type\"><code>ToolSearchExecutionType</code></a></td><td>No</td><td>Whether tool search is executed by the server or by the client.</td></tr><tr><td><code>description</code></td><td><code>string</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>parameters</code></td><td><a href=\"#empty-model-param\"><code>EmptyModelParam</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"tools-array\"><a href=\"#tools-array\">Tools Array</a></h3>\n<p>An array of tools the model may call while generating a response. You can specify which tool to use by setting the <code>tool_choice</code> parameter. We support the following categories of tools: - <strong>Built-in tools</strong>: Tools that extend the model&#x27;s capabilities, such as web search. - <strong>Function calls (custom tools)</strong>: Functions that you define, enabling the model to call your own code with strongly typed arguments and outputs.</p>\n<p>Type: array of <a href=\"#tool\"><code>Tool</code></a></p>\n<h3 id=\"top-log-prob\"><a href=\"#top-log-prob\">Top Log Prob</a></h3>\n<p>The top log probability of a token.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>token</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>logprob</code></td><td><code>number</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>bytes</code></td><td><code>array of integer</code></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"type-param\"><a href=\"#type-param\">Type Param</a></h3>\n<p>An action to type in text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;type&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a type action, this property is always set to <code>type</code>. (default: type)</td></tr><tr><td><code>text</code></td><td><code>string</code></td><td>Yes</td><td>The text to type.</td></tr></tbody></table>\n<h3 id=\"url-citation-body\"><a href=\"#url-citation-body\">Url Citation Body</a></h3>\n<p>Citation that points to a web resource used to ground the response.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;url_citation&#x27;)</code></td><td>Yes</td><td>Annotation type; always <code>url_citation</code>. (default: url_citation)</td></tr><tr><td><code>url</code></td><td><code>string</code></td><td>Yes</td><td>URL of the cited web resource.</td></tr><tr><td><code>start_index</code></td><td><code>integer</code></td><td>Yes</td><td>Character offset where the cited span begins in the output text.</td></tr><tr><td><code>end_index</code></td><td><code>integer</code></td><td>Yes</td><td>Character offset where the cited span ends in the output text.</td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>Yes</td><td>Title of the cited web resource.</td></tr></tbody></table>\n<h3 id=\"wait-param\"><a href=\"#wait-param\">Wait Param</a></h3>\n<p>A wait action.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;wait&#x27;)</code></td><td>Yes</td><td>Specifies the event type. For a wait action, this property is always set to <code>wait</code>. (default: wait)</td></tr></tbody></table>\n<h3 id=\"web-search-action-find\"><a href=\"#web-search-action-find\">Web Search Action Find</a></h3>\n<p>A <code>find_in_page</code> action: the model searches for a pattern within an opened page.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;find_in_page&#x27;)</code></td><td>Yes</td><td>Action type; always <code>find_in_page</code>.</td></tr><tr><td><code>url</code></td><td><code>string (uri)</code></td><td>Yes</td><td>URL of the page that was searched.</td></tr><tr><td><code>pattern</code></td><td><code>string</code></td><td>Yes</td><td>Text pattern searched for within the page.</td></tr></tbody></table>\n<h3 id=\"web-search-action-open-page\"><a href=\"#web-search-action-open-page\">Web Search Action Open Page</a></h3>\n<p>An <code>open_page</code> action: opens a specific URL from the search results.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;open_page&#x27;)</code></td><td>Yes</td><td>Action type; always <code>open_page</code>.</td></tr><tr><td><code>url</code></td><td><code>string (uri)</code> | <code>null</code></td><td>No</td><td>URL the model opened.</td></tr></tbody></table>\n<h3 id=\"web-search-action-search\"><a href=\"#web-search-action-search\">Web Search Action Search</a></h3>\n<p>A <code>search</code> action: runs one or more web search queries.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;search&#x27;)</code></td><td>Yes</td><td>Action type; always <code>search</code>.</td></tr><tr><td><code>query</code></td><td><code>string</code></td><td>Yes</td><td>[DEPRECATED] The search query. Use <code>queries</code> instead.</td></tr><tr><td><code>queries</code></td><td><code>array of string</code></td><td>No</td><td>The search queries issued in this action.</td></tr><tr><td><code>sources</code></td><td><code>array of object</code></td><td>No</td><td>Sources consulted during the search.</td></tr><tr><td><code>sources[].type</code></td><td><code>enum (&#x27;url&#x27;)</code></td><td>Yes</td><td>Source type; always <code>url</code>.</td></tr><tr><td><code>sources[].url</code></td><td><code>string (uri)</code></td><td>Yes</td><td>URL of the source.</td></tr><tr><td><code>downstream_request_id</code></td><td><code>string</code></td><td>No</td><td>Identifier for the downstream search request, surfaced for debugging.</td></tr></tbody></table>\n<h3 id=\"web-search-approximate-location\"><a href=\"#web-search-approximate-location\">Web Search Approximate Location</a></h3>\n<p>Type: <code>object</code> | <code>null</code></p>\n<h3 id=\"web-search-result-item\"><a href=\"#web-search-result-item\">Web Search Result Item</a></h3>\n<p>One result returned by a web search tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string</code></td><td>No</td><td>The result type.</td></tr><tr><td><code>title</code></td><td><code>string</code></td><td>No</td><td>Title of the result.</td></tr><tr><td><code>url</code></td><td><code>string</code></td><td>No</td><td>URL of the result.</td></tr><tr><td><code>snippet</code></td><td><code>string</code></td><td>No</td><td>Text snippet excerpted from the result.</td></tr></tbody></table>\n<h3 id=\"web-search-tool\"><a href=\"#web-search-tool\">Web Search Tool</a></h3>\n<p>Search the Internet for sources related to the prompt.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;web_search&#x27;, &#x27;web_search_2025_08_26&#x27;)</code></td><td>Yes</td><td>The tool type; one of <code>web_search</code> or <code>web_search_2025_08_26</code>. (default: web_search)</td></tr><tr><td><code>filters</code></td><td><code>object</code> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>user_location</code></td><td><a href=\"#web-search-approximate-location\"><code>WebSearchApproximateLocation</code></a></td><td>No</td><td></td></tr><tr><td><code>search_context_size</code></td><td><code>enum (&#x27;low&#x27;, &#x27;medium&#x27;, &#x27;high&#x27;)</code></td><td>No</td><td>How much context window space the search may use; one of <code>low</code>, <code>medium</code>, or <code>high</code>, defaulting to <code>medium</code>. (default: medium)</td></tr></tbody></table>\n<h3 id=\"web-search-tool-call\"><a href=\"#web-search-tool-call\">Web Search Tool Call</a></h3>\n<p>The results of a web search tool call.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td>Identifier for this web search tool call.</td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;web_search_call&#x27;)</code></td><td>Yes</td><td>Item type; always <code>web_search_call</code>.</td></tr><tr><td><code>status</code></td><td><code>enum (&#x27;in_progress&#x27;, &#x27;searching&#x27;, &#x27;completed&#x27;, &#x27;failed&#x27;)</code></td><td>Yes</td><td>Status of the web search tool call.</td></tr><tr><td><code>action</code></td><td><a href=\"#web-search-action-search\"><code>WebSearchActionSearch</code></a> | <a href=\"#web-search-action-open-page\"><code>WebSearchActionOpenPage</code></a> | <a href=\"#web-search-action-find\"><code>WebSearchActionFind</code></a></td><td>Yes</td><td>The specific action taken in this web search call, such as <code>search</code>, <code>open_page</code>, or <code>find_in_page</code>.</td></tr><tr><td><code>results</code></td><td>array of <a href=\"#web-search-result-item\"><code>WebSearchResultItem</code></a> | <code>null</code></td><td>No</td><td></td></tr></tbody></table><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
9 "https://dev.meta.ai/docs/api-reference/responses/create-response": "<h1 id=\"create-a-response\"><a href=\"#create-a-response\">Create a response</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Create a model response. Optionally reference a previous response by ID to continue a multi-turn conversation with server-managed state, instead of resending the full message history.</p>\n<h2 id=\"post-responses\"><a href=\"#post-responses\">POST /responses</a></h2>\n<p>Generate a model response.</p>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/responses/schemas#create-response\"><code>CreateResponse</code></a></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 OK</p>\n<h4 id=\"content-type-applicationjson-1\"><a href=\"#content-type-applicationjson-1\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/responses/schemas#response\"><code>Response</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/responses/schemas#response-stream-event\"><code>ResponseStreamEvent</code></a></p>\n<nav><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-2\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure>\n<p>For usage examples, <code>previous_response_id</code> patterns, and guidance on when to use the Responses API versus Chat Completions, see the <a href=\"/docs/protocols/responses\">Responses</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
10 "https://dev.meta.ai/docs/api-reference/messages/schemas": "<h1 id=\"messages-schemas\"><a href=\"#messages-schemas\">Messages schemas</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>The full schema and model definitions referenced by the <a href=\"/docs/api-reference/messages/create-message\">Messages</a> endpoints. Each endpoint page links here for the detailed shape of its request and response objects.</p>\n<h2 id=\"schemas\"><a href=\"#schemas\">Schemas</a></h2>\n<h3 id=\"anthropic-content-block\"><a href=\"#anthropic-content-block\">Anthropic Content Block</a></h3>\n<p>Anthropic Messages content block. Supported block types are <code>text</code>, <code>image</code>, <code>video</code> (Meta extension), <code>document</code>, <code>tool_use</code>, <code>tool_result</code>, <code>server_tool_use</code>, <code>thinking</code>, and <code>redacted_thinking</code>. <code>cache_control</code> prompt-cache controls are accepted to improve cache hit rates. Unsupported block types return an <code>invalid_request_error</code>.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string</code></td><td>Yes</td><td>Content block discriminator, such as <code>text</code>, <code>image</code>, <code>video</code>, <code>document</code>, <code>tool_use</code>, or <code>tool_result</code>.</td></tr></tbody></table>\n<h3 id=\"anthropic-context-management-config\"><a href=\"#anthropic-context-management-config\">Anthropic Context Management Config</a></h3>\n<p>Anthropic beta context-management config. Known edit types are accepted for compatibility; no server-side context edits are applied.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>edits</code></td><td><code>array of object</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-count-tokens-request\"><a href=\"#anthropic-count-tokens-request\">Anthropic Count Tokens Request</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>max_tokens</code></td><td><code>integer</code></td><td>No</td><td>(minimum: 0)</td></tr><tr><td><code>messages</code></td><td>array of <a href=\"#anthropic-input-message\"><code>AnthropicInputMessage</code></a></td><td>Yes</td><td>(minItems: 1)</td></tr><tr><td><code>system</code></td><td><code>string</code> | array of <a href=\"#anthropic-content-block\"><code>AnthropicContentBlock</code></a></td><td>No</td><td></td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>(default: false)</td></tr><tr><td><code>tools</code></td><td>array of <a href=\"#anthropic-tool\"><code>AnthropicTool</code></a></td><td>No</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#anthropic-tool-choice\"><code>AnthropicToolChoice</code></a></td><td>No</td><td></td></tr><tr><td><code>metadata</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_p</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_k</code></td><td><code>integer</code></td><td>No</td><td></td></tr><tr><td><code>thinking</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>stop_sequences</code></td><td><code>array of string</code></td><td>No</td><td></td></tr><tr><td><code>service_tier</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>cache_control</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.type</code></td><td><code>enum (&#x27;ephemeral&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.ttl</code></td><td><code>enum (&#x27;5m&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>context_management</code></td><td><a href=\"#anthropic-context-management-config\"><code>AnthropicContextManagementConfig</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>container</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>inference_geo</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>output_config</code></td><td><a href=\"#anthropic-output-config\"><code>AnthropicOutputConfig</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-count-tokens-response\"><a href=\"#anthropic-count-tokens-response\">Anthropic Count Tokens Response</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>input_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>Number of input tokens in the supplied Messages request.</td></tr></tbody></table>\n<h3 id=\"anthropic-input-message\"><a href=\"#anthropic-input-message\">Anthropic Input Message</a></h3>\n<p>Anthropic Messages input message.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>role</code></td><td><code>enum (&#x27;user&#x27;, &#x27;assistant&#x27;, &#x27;system&#x27;, &#x27;developer&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>content</code></td><td><code>string</code> | array of <a href=\"#anthropic-content-block\"><code>AnthropicContentBlock</code></a></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-json-output-format\"><a href=\"#anthropic-json-output-format\">Anthropic Json Output Format</a></h3>\n<p>Anthropic JSON structured-output format.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;json_schema&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>schema</code></td><td><code>object</code></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-message\"><a href=\"#anthropic-message\">Anthropic Message</a></h3>\n<p>Anthropic-compatible assistant message response.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>type</code></td><td><code>enum (&#x27;message&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>role</code></td><td><code>enum (&#x27;assistant&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>content</code></td><td>array of <a href=\"#anthropic-content-block\"><code>AnthropicContentBlock</code></a></td><td>Yes</td><td></td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>stop_reason</code></td><td><code>enum (&#x27;end_turn&#x27;, &#x27;max_tokens&#x27;, &#x27;stop_sequence&#x27;, &#x27;tool_use&#x27;, &#x27;pause_turn&#x27;, &#x27;refusal&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>stop_sequence</code></td><td><code>string</code> | <code>null</code></td><td>Yes</td><td></td></tr><tr><td><code>usage</code></td><td><a href=\"#anthropic-usage\"><code>AnthropicUsage</code></a></td><td>Yes</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-message-request\"><a href=\"#anthropic-message-request\">Anthropic Message Request</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>max_tokens</code></td><td><code>integer</code></td><td>Yes</td><td>(minimum: 0)</td></tr><tr><td><code>messages</code></td><td>array of <a href=\"#anthropic-input-message\"><code>AnthropicInputMessage</code></a></td><td>Yes</td><td>(minItems: 1)</td></tr><tr><td><code>system</code></td><td><code>string</code> | array of <a href=\"#anthropic-content-block\"><code>AnthropicContentBlock</code></a></td><td>No</td><td></td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>(default: false)</td></tr><tr><td><code>tools</code></td><td>array of <a href=\"#anthropic-tool\"><code>AnthropicTool</code></a></td><td>No</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#anthropic-tool-choice\"><code>AnthropicToolChoice</code></a></td><td>No</td><td></td></tr><tr><td><code>metadata</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_p</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_k</code></td><td><code>integer</code></td><td>No</td><td></td></tr><tr><td><code>thinking</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>stop_sequences</code></td><td><code>array of string</code></td><td>No</td><td></td></tr><tr><td><code>service_tier</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>cache_control</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.type</code></td><td><code>enum (&#x27;ephemeral&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.ttl</code></td><td><code>enum (&#x27;5m&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>context_management</code></td><td><a href=\"#anthropic-context-management-config\"><code>AnthropicContextManagementConfig</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>container</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>inference_geo</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>output_config</code></td><td><a href=\"#anthropic-output-config\"><code>AnthropicOutputConfig</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-message-request-base\"><a href=\"#anthropic-message-request-base\">Anthropic Message Request Base</a></h3>\n<p>Anthropic Messages request accepted at <code>/v1/messages</code>.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td></td></tr><tr><td><code>max_tokens</code></td><td><code>integer</code></td><td>No</td><td>(minimum: 0)</td></tr><tr><td><code>messages</code></td><td>array of <a href=\"#anthropic-input-message\"><code>AnthropicInputMessage</code></a></td><td>Yes</td><td>(minItems: 1)</td></tr><tr><td><code>system</code></td><td><code>string</code> | array of <a href=\"#anthropic-content-block\"><code>AnthropicContentBlock</code></a></td><td>No</td><td></td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>(default: false)</td></tr><tr><td><code>tools</code></td><td>array of <a href=\"#anthropic-tool\"><code>AnthropicTool</code></a></td><td>No</td><td></td></tr><tr><td><code>tool_choice</code></td><td><a href=\"#anthropic-tool-choice\"><code>AnthropicToolChoice</code></a></td><td>No</td><td></td></tr><tr><td><code>metadata</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>temperature</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_p</code></td><td><code>number</code></td><td>No</td><td>(minimum: 0, maximum: 1)</td></tr><tr><td><code>top_k</code></td><td><code>integer</code></td><td>No</td><td></td></tr><tr><td><code>thinking</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>stop_sequences</code></td><td><code>array of string</code></td><td>No</td><td></td></tr><tr><td><code>service_tier</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>cache_control</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.type</code></td><td><code>enum (&#x27;ephemeral&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>cache_control.ttl</code></td><td><code>enum (&#x27;5m&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>context_management</code></td><td><a href=\"#anthropic-context-management-config\"><code>AnthropicContextManagementConfig</code></a> | <code>null</code></td><td>No</td><td></td></tr><tr><td><code>container</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>inference_geo</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>output_config</code></td><td><a href=\"#anthropic-output-config\"><code>AnthropicOutputConfig</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-output-config\"><a href=\"#anthropic-output-config\">Anthropic Output Config</a></h3>\n<p>Anthropic output controls. <code>effort</code> sets the reasoning effort; <code>max</code> selects the strongest available effort.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>effort</code></td><td><code>enum (&#x27;low&#x27;, &#x27;medium&#x27;, &#x27;high&#x27;, &#x27;xhigh&#x27;, &#x27;max&#x27;)</code></td><td>No</td><td></td></tr><tr><td><code>format</code></td><td><a href=\"#anthropic-json-output-format\"><code>AnthropicJsonOutputFormat</code></a></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-stream-event\"><a href=\"#anthropic-stream-event\">Anthropic Stream Event</a></h3>\n<p>Anthropic Messages server-sent event. Stream event names include <code>message_start</code>, <code>content_block_start</code>, <code>content_block_delta</code>, <code>content_block_stop</code>, <code>message_delta</code>, <code>message_stop</code>, and <code>error</code>.</p>\n<p>Type: <code>object</code></p>\n<h3 id=\"anthropic-tool\"><a href=\"#anthropic-tool\">Anthropic Tool</a></h3>\n<p>Anthropic tool definition. Custom (developer) tools are supported; supported hosted tools are accepted, and unsupported hosted tools return an <code>invalid_request_error</code>.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>description</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>input_schema</code></td><td><code>object</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-tool-choice\"><a href=\"#anthropic-tool-choice\">Anthropic Tool Choice</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;auto&#x27;, &#x27;any&#x27;, &#x27;none&#x27;, &#x27;tool&#x27;)</code></td><td>Yes</td><td></td></tr><tr><td><code>name</code></td><td><code>string</code></td><td>No</td><td></td></tr><tr><td><code>disable_parallel_tool_use</code></td><td><code>boolean</code></td><td>No</td><td></td></tr></tbody></table>\n<h3 id=\"anthropic-usage\"><a href=\"#anthropic-usage\">Anthropic Usage</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>input_tokens</code></td><td><code>integer</code></td><td>Yes</td><td></td></tr><tr><td><code>output_tokens</code></td><td><code>integer</code></td><td>Yes</td><td></td></tr><tr><td><code>cache_creation_input_tokens</code></td><td><code>integer</code></td><td>No</td><td></td></tr><tr><td><code>cache_read_input_tokens</code></td><td><code>integer</code></td><td>No</td><td></td></tr><tr><td><code>output_tokens_details</code></td><td><code>object</code></td><td>No</td><td></td></tr><tr><td><code>output_tokens_details.thinking_tokens</code></td><td><code>integer</code></td><td>No</td><td></td></tr></tbody></table><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
11 "https://dev.meta.ai/docs/api-reference/messages/create-message": "<h1 id=\"create-a-message\"><a href=\"#create-a-message\">Create a message</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Generate an Anthropic Messages-compatible assistant message. Requests are supplied in the Anthropic wire format and run through the same inference pipeline as the <a href=\"/docs/api-reference/responses\">Responses API</a>. Supported tools are developer-defined (<code>custom</code>) functions and built-in <code>web_search</code>.</p>\n<h2 id=\"post-messages\"><a href=\"#post-messages\">POST /messages</a></h2>\n<p>Generate an Anthropic-compatible assistant message.</p>\n<h3 id=\"parameters\"><a href=\"#parameters\">Parameters</a></h3>\n<h4 id=\"header-parameters\"><a href=\"#header-parameters\">Header parameters</a></h4>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>anthropic-version</code></td><td>string</td><td>No</td><td>Anthropic API version header. Accepted for SDK compatibility.</td></tr><tr><td><code>x-api-key</code></td><td>string</td><td>No</td><td>API key header used by Anthropic SDKs. <code>Authorization: Bearer</code> is also accepted.</td></tr></tbody></table>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/messages/schemas#anthropic-message-request\"><code>AnthropicMessageRequest</code></a></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 OK</p>\n<h4 id=\"content-type-applicationjson-1\"><a href=\"#content-type-applicationjson-1\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/messages/schemas#anthropic-message\"><code>AnthropicMessage</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/messages/schemas#anthropic-stream-event\"><code>AnthropicStreamEvent</code></a></p>\n<nav><button type=\"button\" id=\"_R_8qnpfiv5tl5iv6rlb_-tab-0\">Python (Anthropic SDK)Python (Anthropic SDK)</button><button type=\"button\" id=\"_R_8qnpfiv5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_8qnpfiv5tl5iv6rlb_-tab-2\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure>\n<p>For reasoning replay, tool calling, and structured output guidance that applies to the shared inference pipeline, see the <a href=\"/docs/protocols/responses\">Responses</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
12 "https://dev.meta.ai/docs/api-reference/images/schemas": "<h1 id=\"images-schemas\"><a href=\"#images-schemas\">Images schemas</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>The full schema and model definitions referenced by the <a href=\"/docs/api-reference/images/create-image\">Images</a> endpoints. Each endpoint page links here for the detailed shape of its request and response objects.</p>\n<h2 id=\"schemas\"><a href=\"#schemas\">Schemas</a></h2>\n<h3 id=\"create-image-edit-request\"><a href=\"#create-image-edit-request\">Create Image Edit Request</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>image</code></td><td><code>string (binary)</code></td><td>No</td><td>Image to edit. PNG format.</td></tr><tr><td><code>prompt</code></td><td><code>string</code></td><td>Yes</td><td>Text description of the edits to apply.</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Model ID.</td></tr><tr><td><code>n</code></td><td><code>integer</code></td><td>No</td><td>Number of edited images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height (e.g., &#x27;1024x1024&#x27;). The values set the aspect ratio; the image is produced at the generator&#x27;s own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.</td></tr><tr><td><code>response_format</code></td><td><code>enum (&#x27;url&#x27;, &#x27;b64_json&#x27;)</code></td><td>No</td><td>Format for the edited images. One of <code>url</code> or <code>b64_json</code>. Default: <code>b64_json</code>. (default: b64_json)</td></tr><tr><td><code>reasoning_strength</code></td><td><code>enum (&#x27;low&#x27;, &#x27;high&#x27;)</code></td><td>No</td><td>How much reasoning the image generator applies before producing the edited image. One of <code>low</code> or <code>high</code>. <code>low</code> returns after a single generation pass (no self-refinement); <code>high</code> (the default) lets the generator iteratively refine. (default: high)</td></tr><tr><td><code>moderation</code></td><td><code>string</code></td><td>No</td><td>Moderation level for the safety pipeline. One of <code>auto</code> or <code>low</code>. Enabled per model: on models where it is not enabled, any <code>moderation</code> value returns <code>400</code> (<code>code: unsupported_parameter</code>, <code>param: moderation</code>); omitting <code>moderation</code> is always valid. On enabled models, unknown or empty values return <code>400</code>.</td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>If true, streams the response as server-sent events. Defaults to false. (default: false)</td></tr><tr><td><code>partial_images</code></td><td><code>integer</code></td><td>No</td><td>Number of partial images to generate during streaming. Range: 0-3. Accepted but ignored. (minimum: 0, maximum: 3, default: 0)</td></tr><tr><td><code>tool_enablement</code></td><td><a href=\"#image-tool-enablement\"><code>ImageToolEnablement</code></a></td><td>No</td><td>Per-tool controls for the image generator&#x27;s planner. Omit to keep the default (all tools available).</td></tr></tbody></table>\n<h3 id=\"create-image-request\"><a href=\"#create-image-request\">Create Image Request</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Model ID for image generation.</td></tr><tr><td><code>prompt</code></td><td><code>string</code></td><td>Yes</td><td>Text description of the images to generate.</td></tr><tr><td><code>n</code></td><td><code>integer</code></td><td>No</td><td>Number of images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height (e.g., &#x27;1024x1024&#x27;). The value is converted into an aspect ratio only; the image is produced at the generator&#x27;s own fixed output resolution, so the returned pixel dimensions stay constant regardless of the numbers supplied \u2014 only the aspect ratio changes.</td></tr><tr><td><code>response_format</code></td><td><code>enum (&#x27;url&#x27;, &#x27;b64_json&#x27;)</code></td><td>No</td><td>Format for returned images. One of: <code>url</code>, <code>b64_json</code>. Defaults to <code>b64_json</code>. (default: b64_json)</td></tr><tr><td><code>moderation</code></td><td><code>string</code></td><td>No</td><td>Moderation level for the safety pipeline. One of <code>auto</code> or <code>low</code>. Enabled per model: on models where it is not enabled, any <code>moderation</code> value returns <code>400</code> (<code>code: unsupported_parameter</code>, <code>param: moderation</code>); omitting <code>moderation</code> is always valid. On enabled models, unknown or empty values return <code>400</code>.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Requested file type for the generated images. One of <code>png</code>, <code>jpeg</code>, or <code>webp</code>. Defaults to <code>webp</code> when omitted; any other value is rejected.</td></tr><tr><td><code>reasoning_strength</code></td><td><code>enum (&#x27;low&#x27;, &#x27;high&#x27;)</code></td><td>No</td><td>How much reasoning the image generator applies before producing the image. One of <code>low</code> or <code>high</code>. <code>low</code> returns after a single generation pass (no self-refinement); <code>high</code> (the default) lets the generator iteratively refine. (default: high)</td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>A stable end-user identifier that helps detect and mitigate abuse. Use it on the images endpoints; on the Responses and Chat Completions endpoints, use <code>safety_identifier</code> instead.</td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>If true, streams the response as server-sent events. Defaults to false. (default: false)</td></tr><tr><td><code>tool_enablement</code></td><td><a href=\"#image-tool-enablement\"><code>ImageToolEnablement</code></a></td><td>No</td><td>Per-tool controls for the image generator&#x27;s planner. Omit to keep the default (all tools available).</td></tr></tbody></table>\n<h3 id=\"edit-image-body-json-param\"><a href=\"#edit-image-body-json-param\">Edit Image Body Json Param</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Model ID.</td></tr><tr><td><code>prompt</code></td><td><code>string</code></td><td>Yes</td><td>Text description of the edits to apply.</td></tr><tr><td><code>images</code></td><td>array of <a href=\"#image-input-item\"><code>ImageInputItem</code></a></td><td>Yes</td><td>Images to edit. (minItems: 1)</td></tr><tr><td><code>n</code></td><td><code>integer</code></td><td>No</td><td>Number of edited images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height (e.g., &#x27;1024x1024&#x27;). The value is converted into an aspect ratio only; the image is produced at the generator&#x27;s own fixed output resolution, so the returned pixel dimensions stay constant regardless of the numbers supplied \u2014 only the aspect ratio changes.</td></tr><tr><td><code>response_format</code></td><td><code>enum (&#x27;url&#x27;, &#x27;b64_json&#x27;)</code></td><td>No</td><td>Format for the edited images. One of <code>url</code> or <code>b64_json</code>. Default: <code>b64_json</code>. (default: b64_json)</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Requested file type for the edited images. One of <code>png</code>, <code>jpeg</code>, or <code>webp</code>. Defaults to <code>webp</code> when omitted; any other value is rejected.</td></tr><tr><td><code>reasoning_strength</code></td><td><code>enum (&#x27;low&#x27;, &#x27;high&#x27;)</code></td><td>No</td><td>How much reasoning the image generator applies before producing the edited image. One of <code>low</code> or <code>high</code>. <code>low</code> returns after a single generation pass (no self-refinement); <code>high</code> (the default) lets the generator iteratively refine. (default: high)</td></tr><tr><td><code>moderation</code></td><td><code>string</code></td><td>No</td><td>Moderation level for the safety pipeline. One of <code>auto</code> or <code>low</code>. Enabled per model: on models where it is not enabled, any <code>moderation</code> value returns <code>400</code> (<code>code: unsupported_parameter</code>, <code>param: moderation</code>); omitting <code>moderation</code> is always valid. On enabled models, unknown or empty values return <code>400</code>.</td></tr><tr><td><code>stream</code></td><td><code>boolean</code></td><td>No</td><td>If true, streams the response as server-sent events. Defaults to false. (default: false)</td></tr><tr><td><code>user</code></td><td><code>string</code></td><td>No</td><td>A stable end-user identifier that helps detect and mitigate abuse. Use it on the images endpoints; on the Responses and Chat Completions endpoints, use <code>safety_identifier</code> instead.</td></tr><tr><td><code>tool_enablement</code></td><td><a href=\"#image-tool-enablement\"><code>ImageToolEnablement</code></a></td><td>No</td><td>Per-tool controls for the image generator&#x27;s planner. Omit to keep the default (all tools available).</td></tr></tbody></table>\n<h3 id=\"image-edit-completed-event\"><a href=\"#image-edit-completed-event\">Image Edit Completed Event</a></h3>\n<p>Image edit completed event.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;image_edit.completed&#x27;)</code></td><td>Yes</td><td>Event type; always <code>image_edit.completed</code>.</td></tr><tr><td><code>b64_json</code></td><td><code>string</code></td><td>Yes</td><td>Base64-encoded edited image data.</td></tr><tr><td><code>created_at</code></td><td><code>integer</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the event was created.</td></tr><tr><td><code>output_index</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Zero-based index of the edited image in the response.</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height. The values set the aspect ratio; the image is produced at the generator&#x27;s own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.</td></tr><tr><td><code>quality</code></td><td><code>string</code></td><td>No</td><td>Quality setting for the edited images. Accepted but ignored.</td></tr><tr><td><code>background</code></td><td><code>string</code></td><td>No</td><td>Background setting for the edited images. Accepted but ignored.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Output format for the edited images.</td></tr><tr><td><code>usage</code></td><td><a href=\"#image-gen-usage\"><code>ImageGenUsage</code></a></td><td>No</td><td>Aggregate token usage for the image edit request. Present only on the final completed event.</td></tr></tbody></table>\n<h3 id=\"image-edit-partial-image-event\"><a href=\"#image-edit-partial-image-event\">Image Edit Partial Image Event</a></h3>\n<p>Image edit partial image event.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;image_edit.partial_image&#x27;)</code></td><td>Yes</td><td>Event type; always <code>image_edit.partial_image</code>.</td></tr><tr><td><code>b64_json</code></td><td><code>string</code></td><td>Yes</td><td>Base64-encoded partial image data.</td></tr><tr><td><code>created_at</code></td><td><code>integer</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the event was created.</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height. The values set the aspect ratio; the image is produced at the generator&#x27;s own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.</td></tr><tr><td><code>quality</code></td><td><code>string</code></td><td>No</td><td>Quality setting for the edited images. Accepted but ignored.</td></tr><tr><td><code>background</code></td><td><code>string</code></td><td>No</td><td>Background setting for the edited images. Accepted but ignored.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Output format for the edited images. Accepted but ignored.</td></tr><tr><td><code>partial_image_index</code></td><td><code>integer</code></td><td>Yes</td><td>Zero-based index for the partial image.</td></tr></tbody></table>\n<h3 id=\"image-edit-stream-event\"><a href=\"#image-edit-stream-event\">Image Edit Stream Event</a></h3>\n<p>Type: <a href=\"#image-edit-partial-image-event\"><code>ImageEditPartialImageEvent</code></a> | <a href=\"#image-edit-completed-event\"><code>ImageEditCompletedEvent</code></a></p>\n<h3 id=\"image-gen-completed-event\"><a href=\"#image-gen-completed-event\">Image Gen Completed Event</a></h3>\n<p>Image generation completed event.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;image_generation.completed&#x27;)</code></td><td>Yes</td><td>Event type; always <code>image_generation.completed</code>.</td></tr><tr><td><code>b64_json</code></td><td><code>string</code></td><td>Yes</td><td>Base64-encoded image data.</td></tr><tr><td><code>created_at</code></td><td><code>integer</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the event was created.</td></tr><tr><td><code>output_index</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Zero-based index of the generated image in the response.</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height. The values set the aspect ratio; the image is produced at the generator&#x27;s own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.</td></tr><tr><td><code>quality</code></td><td><code>string</code></td><td>No</td><td>Quality setting for the generated images. Accepted but ignored.</td></tr><tr><td><code>background</code></td><td><code>string</code></td><td>No</td><td>Background setting for the generated images. Accepted but ignored.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Output format for the generated images.</td></tr><tr><td><code>usage</code></td><td><a href=\"#image-gen-usage\"><code>ImageGenUsage</code></a></td><td>No</td><td>Aggregate token usage for the image generation request. Present only on the final completed event.</td></tr></tbody></table>\n<h3 id=\"image-gen-partial-image-event\"><a href=\"#image-gen-partial-image-event\">Image Gen Partial Image Event</a></h3>\n<p>Image generation partial image event.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;image_generation.partial_image&#x27;)</code></td><td>Yes</td><td>Event type; always <code>image_generation.partial_image</code>.</td></tr><tr><td><code>b64_json</code></td><td><code>string</code></td><td>Yes</td><td>Base64-encoded partial image data.</td></tr><tr><td><code>created_at</code></td><td><code>integer</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the event was created.</td></tr><tr><td><code>size</code></td><td><code>string</code></td><td>No</td><td>Requested image shape as width x height. The values set the aspect ratio; the image is produced at the generator&#x27;s own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.</td></tr><tr><td><code>quality</code></td><td><code>string</code></td><td>No</td><td>Quality setting for the generated images. Accepted but ignored.</td></tr><tr><td><code>background</code></td><td><code>string</code></td><td>No</td><td>Background setting for the generated images. Accepted but ignored.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>Output format for the generated images. Accepted but ignored.</td></tr><tr><td><code>partial_image_index</code></td><td><code>integer</code></td><td>Yes</td><td>Zero-based index of the partial image in the streaming sequence.</td></tr></tbody></table>\n<h3 id=\"image-gen-stream-event\"><a href=\"#image-gen-stream-event\">Image Gen Stream Event</a></h3>\n<p>Type: <a href=\"#image-gen-partial-image-event\"><code>ImageGenPartialImageEvent</code></a> | <a href=\"#image-gen-completed-event\"><code>ImageGenCompletedEvent</code></a></p>\n<h3 id=\"image-gen-usage\"><a href=\"#image-gen-usage\">Image Gen Usage</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>input_tokens</code></td><td><code>integer</code></td><td>No</td><td>Number of input tokens.</td></tr><tr><td><code>input_tokens_details</code></td><td><code>object</code></td><td>No</td><td>Breakdown of input tokens by modality.</td></tr><tr><td><code>input_tokens_details.image_tokens</code></td><td><code>integer</code></td><td>No</td><td>Number of image tokens in the input.</td></tr><tr><td><code>input_tokens_details.text_tokens</code></td><td><code>integer</code></td><td>No</td><td>Number of text tokens in the input.</td></tr><tr><td><code>output_tokens</code></td><td><code>integer</code></td><td>No</td><td>Number of output tokens.</td></tr><tr><td><code>total_tokens</code></td><td><code>integer</code></td><td>No</td><td>Total number of tokens.</td></tr></tbody></table>\n<h3 id=\"image-input-item\"><a href=\"#image-input-item\">Image Input Item</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>image_url</code></td><td><code>string</code></td><td>No</td><td>Image URL.</td></tr><tr><td><code>file_id</code></td><td><code>string</code></td><td>No</td><td>File ID.</td></tr></tbody></table>\n<h3 id=\"image-object\"><a href=\"#image-object\">Image Object</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>b64_json</code></td><td><code>string</code></td><td>No</td><td>Base64-encoded image data.</td></tr><tr><td><code>url</code></td><td><code>string</code></td><td>No</td><td>Image URL.</td></tr><tr><td><code>revised_prompt</code></td><td><code>string</code></td><td>No</td><td>Revised prompt used for the image.</td></tr></tbody></table>\n<h3 id=\"image-tool-enablement\"><a href=\"#image-tool-enablement\">Image Tool Enablement</a></h3>\n<p>Per-tool controls for the image generator&#x27;s agentic planner. Omit to keep the default (all tools available); set a field to <code>false</code> to disable that tool for the request.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>enable_image_search</code></td><td><code>boolean</code></td><td>No</td><td>Whether the image generator may search the web for visual references. <code>false</code> disables it.</td></tr><tr><td><code>enable_web_search</code></td><td><code>boolean</code></td><td>No</td><td>Whether the image generator may search the web for facts. <code>false</code> disables it (also drops the browser tools).</td></tr><tr><td><code>enable_shell</code></td><td><code>boolean</code></td><td>No</td><td>Whether the image generator may run code to build layouts and charts. <code>false</code> disables it.</td></tr></tbody></table>\n<h3 id=\"images-response\"><a href=\"#images-response\">Images Response</a></h3>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>created</code></td><td><code>integer</code></td><td>Yes</td><td>Unix timestamp (seconds) for when the images were created.</td></tr><tr><td><code>data</code></td><td>array of <a href=\"#image-object\"><code>ImageObject</code></a></td><td>Yes</td><td>Array of generated images.</td></tr><tr><td><code>output_format</code></td><td><code>string</code></td><td>No</td><td>File type of the generated images. Echoes the requested <code>output_format</code> (<code>png</code>, <code>jpeg</code>, or <code>webp</code>); <code>webp</code> when omitted.</td></tr><tr><td><code>background</code></td><td><code>string</code></td><td>No</td><td>Background setting for the generated images. Accepted but ignored.</td></tr><tr><td><code>usage</code></td><td><a href=\"#image-gen-usage\"><code>ImageGenUsage</code></a></td><td>No</td><td>Token usage for the image generation request.</td></tr></tbody></table><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
13 "https://dev.meta.ai/docs/api-reference/images/create-image": "<h1 id=\"generate-an-image\"><a href=\"#generate-an-image\">Generate an image</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Generate one or more images from a text prompt.</p>\n<h2 id=\"post-imagesgenerations\"><a href=\"#post-imagesgenerations\">POST /images/generations</a></h2>\n<p>Generate one or more images from a text prompt.</p>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#create-image-request\"><code>CreateImageRequest</code></a></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 OK</p>\n<h4 id=\"content-type-applicationjson-1\"><a href=\"#content-type-applicationjson-1\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#images-response\"><code>ImagesResponse</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#image-gen-stream-event\"><code>ImageGenStreamEvent</code></a></p>\n<nav><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-0\">Python (OpenAI SDK)Python (OpenAI SDK)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_7anpfiv5tl5iv6rlb_-tab-2\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure><figure></figure>\n<p>For prompts, sizing, and worked examples, see the <a href=\"/docs/image-generation\">Image generation</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
14 "https://dev.meta.ai/docs/api-reference/images/edit-image": "<h1 id=\"edit-an-image\"><a href=\"#edit-an-image\">Edit an image</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Edit, transform, or compose one or more input images, guided by a text prompt.</p>\n<p>With the OpenAI SDK, upload the input image(s) as <code>multipart/form-data</code> \u2014 <code>client.images.edit(image=..., prompt=..., model=...)</code>, passing a list of files to compose several inputs. Over raw HTTP you can instead send a JSON body with an <code>images</code> array of <code>image_url</code>/<code>file_id</code> items (shown below); the OpenAI SDK does not send this JSON shape.</p>\n<h2 id=\"post-imagesedits\"><a href=\"#post-imagesedits\">POST /images/edits</a></h2>\n<p>Edit one or more input images from a text prompt.</p>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#edit-image-body-json-param\"><code>EditImageBodyJsonParam</code></a></p>\n<h4 id=\"content-type-multipartform-data\"><a href=\"#content-type-multipartform-data\">Content Type: multipart/form-data</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#create-image-edit-request\"><code>CreateImageEditRequest</code></a></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 OK</p>\n<h4 id=\"content-type-applicationjson-1\"><a href=\"#content-type-applicationjson-1\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#images-response\"><code>ImagesResponse</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/images/schemas#image-edit-stream-event\"><code>ImageEditStreamEvent</code></a></p>\n<nav><button type=\"button\" id=\"_R_8qnpfiv5tl5iv6rlb_-tab-0\">Python (requests)Python (requests)</button><button type=\"button\" id=\"_R_8qnpfiv5tl5iv6rlb_-tab-1\">curlcurl</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure>\n<p>For reference images, multi-image composition, and worked examples, see the <a href=\"/docs/image-generation\">Image generation</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
15 "https://dev.meta.ai/docs/api-reference/voice/schemas": "<h1 id=\"voice-schemas\"><a href=\"#voice-schemas\">Voice schemas</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>The full schema and model definitions referenced by the <a href=\"/docs/api-reference/voice/transcribe\">Audio</a> endpoints. Each endpoint page links here for the detailed shape of its request and response objects.</p>\n<h2 id=\"schemas\"><a href=\"#schemas\">Schemas</a></h2>\n<h3 id=\"audio-progress-event\"><a href=\"#audio-progress-event\">Audio Progress Event</a></h3>\n<p>One update on the independent audio-progress channel, multiplexed onto the same ordered event stream as transcript, lifecycle, and speaker events. Not part of any speech turn.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;audioProgress&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>audioProgress</code> for this event.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Total audio processed so far, in milliseconds from the start of the stream.</td></tr></tbody></table>\n<h3 id=\"authorization\"><a href=\"#authorization\">Authorization</a></h3>\n<p>Credential authorizing the session. Consumed only by the server&#x27;s authentication step and never forwarded to the model.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>accessToken</code></td><td><code>string</code></td><td>Yes</td><td><code>Bearer </code> followed by your Model API key. The prefix is part of the value.</td></tr></tbody></table>\n<h3 id=\"error-event\"><a href=\"#error-event\">Error Event</a></h3>\n<p>Fatal error the server sends just before it closes the session. The message is client-safe; internal detail is logged server-side only.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;error&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>error</code> for this event.</td></tr><tr><td><code>message</code></td><td><code>string</code></td><td>Yes</td><td>Human-readable, client-safe error message.</td></tr><tr><td><code>sessionId</code></td><td><code>string</code></td><td>Yes</td><td>Session id for log correlation. Empty if one has not been assigned yet.</td></tr><tr><td><code>errorType</code></td><td><code>string</code></td><td>No</td><td>Model API error taxonomy for this failure.</td></tr><tr><td><code>errorCode</code></td><td><code>string</code></td><td>No</td><td>Machine-readable error code, when the failure has one.</td></tr><tr><td><code>errorParam</code></td><td><code>string</code></td><td>No</td><td>Request field the error relates to, when applicable.</td></tr></tbody></table>\n<h3 id=\"realtime-handshake-request\"><a href=\"#realtime-handshake-request\">Realtime Handshake Request</a></h3>\n<p>The first JSON text frame the client sends to open a realtime session, within 10 seconds of the socket opening. Configuration is fixed once the handshake is accepted.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>authorization</code></td><td><a href=\"#authorization\"><code>Authorization</code></a></td><td>Yes</td><td></td></tr><tr><td><code>audioEncoding</code></td><td><code>enum (&#x27;PCM_24KHZ&#x27;, &#x27;PCM_16KHZ&#x27;)</code></td><td>Yes</td><td>Encoding of the streamed binary frames, sent as the enum name. Both values are signed 16-bit little-endian mono. <code>PCM_24KHZ</code> is 48,000 bytes per second and is the model&#x27;s native rate; <code>PCM_16KHZ</code> is 32,000 bytes per second and is resampled server-side. There is no default; an unset or unrecognized value is rejected.</td></tr><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Public model id. The model must support the requested mode.</td></tr><tr><td><code>mode</code></td><td><code>enum (&#x27;PUSH_TO_TALK&#x27;, &#x27;ENDPOINTING&#x27;, &#x27;DIARIZATION&#x27;)</code></td><td>No</td><td>Transcription behavior, sent as the enum name. <code>PUSH_TO_TALK</code> is single-turn and the client delimits the turn by ending the stream. <code>ENDPOINTING</code> detects speech onset and endpoint, one turn per detected segment. <code>DIARIZATION</code> additionally attributes turns to speakers. Mode availability depends on the model. (default: PUSH_TO_TALK)</td></tr><tr><td><code>partialMode</code></td><td><code>enum (&#x27;CUMULATIVE&#x27;, &#x27;DELTA&#x27;)</code></td><td>No</td><td>Representation of partial transcript text, sent as the enum name. <code>CUMULATIVE</code> sends the complete current hypothesis each time, replacing the previous partial, so the model can revise text it already emitted. <code>DELTA</code> sends only newly emitted text for the client to append, and is not compatible with every model or mode. (default: CUMULATIVE)</td></tr><tr><td><code>emitAudioProgress</code></td><td><code>boolean</code></td><td>No</td><td>Whether the server emits <code>audioProgress</code> events. Compatible runtimes emit one event per processed audio chunk. (default: true)</td></tr><tr><td><code>keywords</code></td><td><code>array of string</code></td><td>No</td><td>Terms to bias recognition toward, such as names, jargon, and product words the model would otherwise mishear. Biasing does not guarantee an exact spelling.</td></tr><tr><td><code>languageBias</code></td><td><code>array of string</code></td><td>No</td><td>Languages to bias transcription toward, each as a language name, e.g. <code>[&quot;English&quot;, &quot;French&quot;]</code>. A list of languages, not free-form context. Omit it to let the model detect the language.</td></tr></tbody></table>\n<h3 id=\"realtime-handshake-response\"><a href=\"#realtime-handshake-response\">Realtime Handshake Response</a></h3>\n<p>Server reply to a successful handshake, sent before any transcript frames. This is the only server frame with no <code>type</code> field.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td><td>Yes</td><td>Session id for end-to-end log correlation.</td></tr></tbody></table>\n<h3 id=\"server-message\"><a href=\"#server-message\">Server Message</a></h3>\n<p>Envelope for every server event after the handshake. The <code>type</code> field names the event and its payload is merged alongside it. Transcript, lifecycle, speaker, and progress events are multiplexed into one ordered stream. Dispatch on <code>type</code> and ignore unknown values.</p>\n<p>Type: <a href=\"#transcript-event\"><code>TranscriptEvent</code></a> | <a href=\"#speech-start-event\"><code>SpeechStartEvent</code></a> | <a href=\"#speech-end-event\"><code>SpeechEndEvent</code></a> | <a href=\"#speech-complete-event\"><code>SpeechCompleteEvent</code></a> | <a href=\"#speaker-event\"><code>SpeakerEvent</code></a> | <a href=\"#audio-progress-event\"><code>AudioProgressEvent</code></a> | <a href=\"#error-event\"><code>ErrorEvent</code></a></p>\n<h3 id=\"speaker-event\"><a href=\"#speaker-event\">Speaker Event</a></h3>\n<p>Labels the transcript span immediately before it: the span starts at the previous <code>speechStart</code> or <code>speaker</code> event, whichever came later, and ends here. Emitted in <code>DIARIZATION</code>. Does not indicate a speech boundary, a speaker change, or a final transcript, and the same label can repeat.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;speaker&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>speaker</code> for this event.</td></tr><tr><td><code>label</code></td><td><code>string</code></td><td>Yes</td><td>Model-generated speaker label, such as <code>A</code>. Meaningful only within one session, and not a verified identity.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model emitted this label, in milliseconds from the start of the stream. Not a precise acoustic boundary.</td></tr></tbody></table>\n<h3 id=\"speech-complete-event\"><a href=\"#speech-complete-event\">Speech Complete Event</a></h3>\n<p>The completed transcript for one speech turn, including any post processing.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;speechComplete&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>speechComplete</code> for this event.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model emitted this event, in milliseconds from the start of the stream. Not a precise acoustic boundary.</td></tr><tr><td><code>turnId</code></td><td><code>integer (int32)</code></td><td>Yes</td><td>Id for this speech turn. Correlate lifecycle events by equality within the session; numbering is not otherwise meaningful.</td></tr><tr><td><code>transcript</code></td><td><code>string</code></td><td>Yes</td><td>Transcript for the entire turn. It can differ from the last partial, because the model may post-process the turn after speech ends.</td></tr></tbody></table>\n<h3 id=\"speech-end-event\"><a href=\"#speech-end-event\">Speech End Event</a></h3>\n<p>The model detected the end of speech. A boundary event, not the final transcript: use <code>speechComplete</code> for the turn&#x27;s text.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;speechEnd&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>speechEnd</code> for this event.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model emitted this event, in milliseconds from the start of the stream. Not a precise acoustic boundary.</td></tr><tr><td><code>turnId</code></td><td><code>integer (int32)</code></td><td>Yes</td><td>Id for this speech turn.</td></tr></tbody></table>\n<h3 id=\"speech-start-event\"><a href=\"#speech-start-event\">Speech Start Event</a></h3>\n<p>The model detected the beginning of speech.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;speechStart&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>speechStart</code> for this event.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model emitted this event, in milliseconds from the start of the stream. Not a precise acoustic boundary.</td></tr><tr><td><code>turnId</code></td><td><code>integer (int32)</code></td><td>Yes</td><td>Id for this speech turn. A later turn can open before an earlier turn&#x27;s <code>speechComplete</code> arrives, so keep state keyed by <code>turnId</code>.</td></tr></tbody></table>\n<h3 id=\"transcribe-request\"><a href=\"#transcribe-request\">Transcribe Request</a></h3>\n<p>The <code>request</code> part of the multipart body, sent as JSON.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>model</code></td><td><code>string</code></td><td>Yes</td><td>Public model id. The model must support the requested mode.</td></tr><tr><td><code>audioEncoding</code></td><td><code>enum (&#x27;WAV&#x27;)</code></td><td>Yes</td><td>Container of the uploaded <code>audio</code> part, sent as the enum name. <code>WAV</code> is a RIFF/WAVE container holding mono integer PCM at 16 kHz or 24 kHz. There is no default; an unset or unrecognized value is rejected.</td></tr><tr><td><code>mode</code></td><td><code>enum (&#x27;PUSH_TO_TALK&#x27;, &#x27;ENDPOINTING&#x27;, &#x27;DIARIZATION&#x27;)</code></td><td>No</td><td>Transcription behavior, sent as the enum name. <code>PUSH_TO_TALK</code> is single-turn and the uploaded clip is the turn. <code>ENDPOINTING</code> detects speech onset and endpoint, one turn per detected segment. <code>DIARIZATION</code> additionally attributes turns to speakers. Mode availability depends on the model. (default: PUSH_TO_TALK)</td></tr><tr><td><code>keywords</code></td><td><code>array of string</code></td><td>No</td><td>Terms to bias recognition toward, such as names, jargon, and product words the model would otherwise mishear. Biasing does not guarantee an exact spelling.</td></tr><tr><td><code>languageBias</code></td><td><code>array of string</code></td><td>No</td><td>Languages to bias transcription toward, each as a language name, e.g. <code>[&quot;English&quot;, &quot;French&quot;]</code>. A list of languages, not free-form context. Omit it to let the model detect the language.</td></tr><tr><td><code>partialMode</code></td><td><code>enum (&#x27;CUMULATIVE&#x27;, &#x27;DELTA&#x27;)</code></td><td>No</td><td>Representation of partial transcript text, sent as the enum name. Applies to <code>text/event-stream</code> responses only. <code>CUMULATIVE</code> replaces the previous partial; <code>DELTA</code> sends only newly emitted text for the client to append. (default: CUMULATIVE)</td></tr><tr><td><code>emitAudioProgress</code></td><td><code>boolean</code></td><td>No</td><td>Whether to emit <code>audioProgress</code> events. Applies to <code>text/event-stream</code> responses only; the buffered responses never surface them. (default: true)</td></tr></tbody></table>\n<h3 id=\"transcribe-response\"><a href=\"#transcribe-response\">Transcribe Response</a></h3>\n<p>The buffered <code>application/json</code> response.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td><code>string</code></td><td>Yes</td><td>The <code>sessionId</code> query parameter, or the id the server generated when it was absent.</td></tr><tr><td><code>transcript</code></td><td><code>string</code></td><td>Yes</td><td>Final transcript for the whole clip. Populated in every mode; in the multi-turn modes it is the turn transcripts joined in turn order.</td></tr><tr><td><code>audioDurationMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Total audio duration processed, in milliseconds.</td></tr><tr><td><code>turns</code></td><td>array of <a href=\"#turn\"><code>Turn</code></a></td><td>Yes</td><td>Every turn the model reported, in ascending <code>turnId</code> order. Empty in <code>PUSH_TO_TALK</code>. A turn the clip ended part-way through carries the boundaries the model gave and an empty transcript.</td></tr></tbody></table>\n<h3 id=\"transcript-event\"><a href=\"#transcript-event\">Transcript Event</a></h3>\n<p>One streamed transcript update.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>enum (&#x27;transcript&#x27;)</code></td><td>Yes</td><td>Event discriminator; always <code>transcript</code> for this event.</td></tr><tr><td><code>transcript</code></td><td><code>string</code></td><td>Yes</td><td>Transcript text for this segment. Under <code>CUMULATIVE</code> it replaces the previous partial; under <code>DELTA</code> it is appended.</td></tr><tr><td><code>final</code></td><td><code>boolean</code></td><td>Yes</td><td>Transcript stability as reported by the model. In <code>PUSH_TO_TALK</code>, <code>true</code> marks stream completion. In <code>ENDPOINTING</code> and <code>DIARIZATION</code>, use <code>speechComplete</code> for turn completion instead.</td></tr><tr><td><code>audioProcessedMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Total audio processed so far, in milliseconds.</td></tr></tbody></table>\n<h3 id=\"turn\"><a href=\"#turn\">Turn</a></h3>\n<p>One speech turn the model detected, reported in the buffered transcribe response. Populated in <code>ENDPOINTING</code> and <code>DIARIZATION</code> only.</p>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>turnId</code></td><td><code>integer (int32)</code></td><td>Yes</td><td>Id for this turn. Turns are reported in ascending id order; numbering is not otherwise meaningful.</td></tr><tr><td><code>startMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model detected the turn&#x27;s speech onset, in milliseconds from the start of the clip. Not a precise acoustic boundary.</td></tr><tr><td><code>endMs</code></td><td><code>integer (int64)</code></td><td>Yes</td><td>Audio processed when the model detected the turn&#x27;s speech end, in milliseconds from the start of the clip. Not a precise acoustic boundary.</td></tr><tr><td><code>transcript</code></td><td><code>string</code></td><td>Yes</td><td>Finalized transcript for this turn, including any post processing.</td></tr><tr><td><code>speaker</code></td><td><code>string</code></td><td>No</td><td>Model-generated speaker label, such as <code>A</code>. Present in <code>DIARIZATION</code> only.</td></tr></tbody></table><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->",
16 "https://dev.meta.ai/docs/api-reference/voice/transcribe": "<h1 id=\"transcribe-a-recording\"><a href=\"#transcribe-a-recording\">Transcribe a recording</a></h1><button type=\"button\">Table of contents<svg viewBox=\"0 0 32 32\" fill=\"none\" width=\"16\" height=\"16\"><path d=\"M24.62 12.38a.876.876 0 0 1 0 1.24l-8 8a.876.876 0 0 1-1.24 0l-8-8a.876.876 0 0 1 1.24-1.24L16 19.763l7.38-7.381a.876.876 0 0 1 1.24 0z\" fill=\"currentColor\"></path></svg></button><nav><ul></ul></nav>\n<p>Transcribe one complete audio recording in a single request.</p>\n<p>Send <code>multipart/form-data</code> with two parts: <code>request</code>, the transcription settings as JSON, and <code>audio</code>, the clip. The <code>Accept</code> header selects between a buffered JSON body, a server-sent event stream, and plain text.</p>\n<h2 id=\"post-asrtranscribe\"><a href=\"#post-asrtranscribe\">POST /asr/transcribe</a></h2>\n<p>Transcribe a complete audio recording.</p>\n<h3 id=\"parameters\"><a href=\"#parameters\">Parameters</a></h3>\n<h4 id=\"query-parameters\"><a href=\"#query-parameters\">Query parameters</a></h4>\n<table><thead><tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionId</code></td><td>string</td><td>No</td><td>Correlation id used in server-side logs and echoed in the response. When omitted, the server generates one.</td></tr></tbody></table>\n<h3 id=\"request-body\"><a href=\"#request-body\">Request body</a></h3>\n<h4 id=\"content-type-multipartform-data\"><a href=\"#content-type-multipartform-data\">Content Type: multipart/form-data</a></h4>\n<p><code>object</code></p>\n<h3 id=\"response\"><a href=\"#response\">Response</a></h3>\n<p><code>HTTP 200</code> \u2014 The transcript, in the shape selected by <code>Accept</code>. <code>application/json</code>, <code>*/*</code>, or an absent header returns the buffered body. <code>text/event-stream</code> returns the realtime event stream, which ends after the last event and appends no summary. <code>text/plain</code> returns one turn per line in <code>ENDPOINTING</code>, or lines of the form <code>A:Hello</code> in <code>DIARIZATION</code> (a turn the model never attributed renders as <code>unknown:&lt;transcript&gt;</code>).</p>\n<h4 id=\"content-type-applicationjson\"><a href=\"#content-type-applicationjson\">Content Type: application/json</a></h4>\n<p><a href=\"/docs/api-reference/voice/schemas#transcribe-response\"><code>TranscribeResponse</code></a></p>\n<h4 id=\"content-type-textevent-stream\"><a href=\"#content-type-textevent-stream\">Content Type: text/event-stream</a></h4>\n<p><a href=\"/docs/api-reference/voice/schemas#server-message\"><code>ServerMessage</code></a></p>\n<h3 id=\"response-1\"><a href=\"#response-1\">Response</a></h3>\n<p><code>HTTP 400</code> \u2014 The audio is not a supported WAV file, the audio exceeds 10 minutes, or the body is not <code>multipart/form-data</code>.</p>\n<h3 id=\"response-2\"><a href=\"#response-2\">Response</a></h3>\n<p><code>HTTP 406</code> \u2014 The <code>Accept</code> header requested a media type this endpoint does not produce.</p>\n<h3 id=\"response-3\"><a href=\"#response-3\">Response</a></h3>\n<p><code>HTTP 413</code> \u2014 The request body exceeds the maximum of 32 MB.</p>\n<h3 id=\"response-4\"><a href=\"#response-4\">Response</a></h3>\n<p><code>HTTP 429</code> \u2014 The caller reached its concurrency or hourly session limit. Retry with exponential backoff.</p>\n<h3 id=\"response-5\"><a href=\"#response-5\">Response</a></h3>\n<p><code>HTTP 500</code> \u2014 Transcription failed, or processing exceeded the server budget. Once an event stream has started there is no status left to set, so the failure arrives as a terminal <code>error</code> event on the open stream under <code>HTTP 200</code>.</p>\n<nav><button type=\"button\" id=\"_R_eanpfiv5tl5iv6rlb_-tab-0\">curlcurl</button><button type=\"button\" id=\"_R_eanpfiv5tl5iv6rlb_-tab-1\">Python (requests)Python (requests)</button><kbd>\u2190</kbd><kbd>\u2192</kbd>to navigate</nav><figure></figure><figure></figure>\n<p>Errors carry an HTTP status and a client-safe message with a <code>type</code>, plus <code>code</code> and <code>param</code> when the failure has them. On <code>text/event-stream</code> the failure arrives instead as a terminal <code>error</code> event carrying the same taxonomy. Retain the session id: it is the only correlation handle for a support request.</p>\n<p>For audio conversion, modes, and worked examples, see the <a href=\"/docs/speech-to-text\">Speech to text</a> feature page.</p><!--$--><!--/$--></article><aside>On this page<nav><ul></ul></nav></aside><!--$?--><template id=\"B:0\"></template><!--/$-->"