-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed as not planned
Labels
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
gpt-5-mini Returns Empty output_text
with Responses API
Issue
When using gpt-5-mini
with the Responses API, the returned output_text
is frequently an empty string (""
), even though the API call succeeds.
Expected Behavior
response.output_text
should contain the model's generated response.- Should behave like
gpt-4o-mini
, which consistently returns text.
Actual Behavior
response.output_text
is empty.response.output
contains only aResponseReasoningItem
of type"reasoning"
.- No
ResponseOutputMessage
with actual content.
Reproduction Code
from openai import AsyncOpenAI
client = AsyncOpenAI()
response = await client.responses.create(
model="gpt-5-mini",
input=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say hello in one sentence."}
],
max_output_tokens=50,
)
print(f"output_text: '{response.output_text}'") # Empty!
print(f"output length: {len(response.output)}") # 1
print(f"output[0] type: {response.output[0].type}") # reasoning
### To Reproduce
-
### Code snippets
```Python
OS
Windows
Python version
Python 3.11
Library version
Latest