openai · OpenAI Platform Docs
Predicted Outputs
Teaches how to use the prediction parameter in Chat Completions to provide known output tokens to reduce API latency, including implementation via SDKs and streaming.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Predicted Outputs
Teaches how to use the prediction parameter in Chat Completions to provide known output tokens to reduce API latency, including implementation via SDKs and streaming.
When To Use
Use when you need to reduce latency in Chat Completions API responses by providing existing text or code that is expected to appear in the model's output.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/predicted-outputs-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-predicted-outputs-typescript-user-class.typescript | A TypeScript code example demonstrating the implementation of a User class for use with OpenAI predicted outputs. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating the implementation of a User class for use with OpenAI predicted outputs. |
examples/predicted-outputs-openai-predicted-outputs-javascript-refactor.javascript | A JavaScript code example demonstrating how to use the OpenAI API to refactor a class structure using predicted outputs. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI API to refactor a class structure using predicted outputs. |
examples/predicted-outputs-openai-predicted-outputs-python-refactor.python | A Python script demonstrating how to use the predicted outputs feature to refactor a TypeScript class by replacing a property. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the predicted outputs feature to refactor a TypeScript class by replacing a... |
examples/predicted-outputs-openai-predicted-outputs-curl-request.bash | A curl command demonstrating how to send a chat completion request using the predicted outputs feature. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a chat completion request using the predicted outputs feature. |
examples/predicted-outputs-openai-predicted-outputs.javascript | A JavaScript code example demonstrating how to implement and receive predicted outputs using the OpenAI API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to implement and receive predicted outputs using the OpenAI API. |
examples/predicted-outputs-openai-predicted-outputs-javascript-refactor-2.javascript | A JavaScript example demonstrating how to use the predicted outputs feature to refactor a class structure using the OpenAI SDK. | Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the predicted outputs feature to refactor a class structure using the O... |
examples/predicted-outputs-openai-predicted-outputs-python-refactor-2.python | A Python script demonstrating how to use the predicted outputs feature to refactor a TypeScript class by replacing a property. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the predicted outputs feature to refactor a TypeScript class by replacing a... |
examples/predicted-outputs-openai-predicted-outputs-typescript-hono-server.typescript | A TypeScript example using the Hono web framework to implement a server setup for testing predicted outputs. | Exact payloads, commands, or snippets shown in A TypeScript example using the Hono web framework to implement a server setup for testing predicted outputs. |
examples/predicted-outputs-openai-predicted-outputs-text-generation.text | A text-based example demonstrating how to use predicted outputs to append a specific GET route to an existing application file. | Exact payloads, commands, or snippets shown in A text-based example demonstrating how to use predicted outputs to append a specific GET route to an existing applica... |
examples/predicted-outputs-openai-predicted-outputs.typescript | A TypeScript code example demonstrating the implementation of predicted outputs using the OpenAI API. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating the implementation of predicted outputs using the OpenAI API. |
examples/predicted-outputs-openai-predicted-outputs-2.javascript | A JavaScript code example demonstrating how to implement and verify predicted outputs using the OpenAI API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to implement and verify predicted outputs using the OpenAI API. |
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.md
