openai · OpenAI Platform Docs
Predicted Outputs | OpenAI API
Teaches how to use the predicted outputs feature to constrain model responses by providing expected text sequences, which improves reliability and reduces latency.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Predicted Outputs | OpenAI API
Teaches how to use the predicted outputs feature to constrain model responses by providing expected text sequences, which improves reliability and reduces latency.
When To Use
Use when you need to force a model to follow a specific format or include certain tokens to ensure output consistency and reduce token usage.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/predicted-outputs-openai-api-workflow-guide.md | A guide explaining how to use predicted outputs to speed up Chat Completions by providing known output tokens. | Questions about a guide explaining how to use predicted outputs to speed up Chat Completions by providing known output tokens. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-typescript-use.text | A TypeScript class definition for a User object used to demonstrate predicted outputs in the OpenAI API. | Exact payloads, commands, or snippets shown in A TypeScript class definition for a User object used to demonstrate predicted outputs in the OpenAI API. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-typescript-ref.text | A TypeScript code example demonstrating how to use the predicted outputs feature to refactor a class property. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the predicted outputs feature to refactor a class property. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-python-refacto.text | A Python code example demonstrating how to use the predicted outputs feature to refactor a TypeScript class property. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the predicted outputs feature to refactor a TypeScript class property. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-curl-request.text | A curl command demonstrating how to use the predicted outputs feature in a chat completions request. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to use the predicted outputs feature in a chat completions request. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-chat-completio.text | A text representation of a chat completion response object demonstrating the predicted outputs field structure. | Exact payloads, commands, or snippets shown in A text representation of a chat completion response object demonstrating the predicted outputs field structure. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-typescript-ref-2.text | A TypeScript code example demonstrating how to use the predicted outputs feature to refactor a class property. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to use the predicted outputs feature to refactor a class property. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-python-refacto-2.text | A Python code example demonstrating how to use the predicted outputs feature to refactor a TypeScript class definition. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the predicted outputs feature to refactor a TypeScript class definition. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-hono-server.text | A Hono web server implementation demonstrating the setup for a service using predicted outputs. | Exact payloads, commands, or snippets shown in A Hono web server implementation demonstrating the setup for a service using predicted outputs. |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-text-prompt.text | A text prompt demonstrating how to use the predicted outputs feature to instruct the model to append a specific route to an existing application. | Exact payloads, commands, or snippets shown in A text prompt demonstrating how to use the predicted outputs feature to instruct the model to append a specific route... |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-hono-javascrip.text | A JavaScript code example using the Hono framework demonstrating the implementation of predicted outputs within an API route. | Exact payloads, commands, or snippets shown in A JavaScript code example using the Hono framework demonstrating the implementation of predicted outputs within an AP... |
examples/predicted-outputs-openai-api-openai-api-predicted-outputs-chat-completio-2.text | A text representation of a chat completion response object demonstrating the predicted outputs field structure. | Exact payloads, commands, or snippets shown in A text representation of a chat completion response object demonstrating the predicted outputs field structure. |
What This Skill Covers
- Predicted Outputs enable you to speed up API responses from Chat Completions when many of the output tokens are known ahead of time. This is most common when...
- Main sections:
Code refactoring example,Streaming example,Position of predicted text in response,Limitations.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/predicted-outputs
