-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Description
Description
The responses.parse() method throws an error when combining Pydantic structured outputs with GPT-5's
new reasoning and text parameters.
Environment
- openai-python: 1.99.3 (AsyncOpenAI and OpenAI)
- Model: gpt-5
Minimal reproduction
from pydantic import BaseModel
from openai import AsyncOpenAI
class BookSummary(BaseModel):
title: str
summary: str
rating: int
client = AsyncOpenAI()
This fails
response = await client.responses.parse(
model="gpt-5",
input=[
{"role": "user", "content": "Summarize this book..."}
],
text_format=BookSummary,
reasoning={"effort": "minimal"},
text={"verbosity": "medium"}
)
Error
Error code: 400 - {'error': {'message': "Unsupported parameter: 'reasoning.effort' is not supported
with this model.", 'type': 'invalid_request_error', 'param': 'reasoning.effort'}}
Expected behavior
responses.parse() should support GPT-5's reasoning/verbosity parameters alongside Pydantic models.
Impact
Cannot use structured outputs with GPT-5's performance optimization features, forcing a choice between
type safety or the new model capabilities.
To Reproduce
client = AsyncOpenAI()
from pydantic import BaseModel
from openai import AsyncOpenAI
class BookSummary(BaseModel):
title: str
summary: str
rating: int
response = await client.responses.parse(
model="gpt-5",
input=[
{"role": "user", "content": "Summarize this book..."}
],
text_format=BookSummary,
reasoning={"effort": "minimal"},
text={"verbosity": "medium"}
)
OS
macOS Sequoia 15.5
Python version
Python v3.13.5
Library version
openai v1.99.3