Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/predicted-outputs-openai-api-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-api-openai-api-predicted-outputs-typescript-use.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  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