output_model to delegate final response formatting to a different model. The primary model handles reasoning and tool calls, then the output model formats the result.
Why Use an Output Model?
| Use Case | Example |
|---|---|
| Better writing | Research with GPT-5.2, write with Claude Opus 4.5 |
| Cost optimization | Reason with DeepSeek, format with GPT-5-mini |
| Structured output | Use a model without native support, format with one that has it |
Better Writing
GPT-5.2 excels at research and tool use, but Claude Opus 4.5 produces better prose. Combine them:Cost Optimization
Use a capable but expensive model for complex reasoning, a cheaper model for formatting:Structured Output Support
Some models lack native structured output. Use an output model that supports it:How It Works
- Primary model processes the request and executes tool calls
- Primary model generates an intermediate response
- Intermediate response passes to the output model
- Output model formats and returns the final response
Custom Formatting Prompt
Useoutput_model_prompt to control the output style:
When to Use Output Model
| Scenario | Recommendation |
|---|---|
| Need better prose quality | output_model with Claude Opus 4.5 |
| Need to reduce costs | output_model with GPT-5-mini |
| Primary model lacks structured output | output_model + output_schema |
| Need specific formatting style | output_model + output_model_prompt |
| Simple structured data extraction | output_schema alone (no output model needed) |
Related
- Structured Output: Get validated Pydantic objects
- Structured Input: Pass validated input to agents