Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/predicted-outputs-workflow-guide.mdA 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.typescriptA 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.javascriptA 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.pythonA 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.bashA 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.javascriptA 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.javascriptA 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.pythonA 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.typescriptA 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.textA 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.typescriptA 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.javascriptA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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