Implementation:Openai Openai python Response Reasoning Item
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for representing a reasoning chain-of-thought item returned by reasoning models in the Responses API, provided by the openai-python SDK.
Description
ResponseReasoningItem is a Pydantic model describing the chain of thought used by a reasoning model while generating a response. It contains a required summary list of Summary objects (each with text and type fields), an optional content list of Content objects holding the actual reasoning text, an optional encrypted_content string (populated when reasoning.encrypted_content is included), and a status field indicating whether the reasoning is in_progress, completed, or incomplete. These items should be included in subsequent input for multi-turn conversations.
Usage
Import this type when processing reasoning output items from models like o1 or o3, or when preserving reasoning context across conversation turns.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/responses/response_reasoning_item.py
Signature
class ResponseReasoningItem(BaseModel):
"""A description of the chain of thought used by a reasoning model."""
id: str
summary: List[Summary]
type: Literal["reasoning"]
content: Optional[List[Content]] = None
encrypted_content: Optional[str] = None
status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
Import
from openai.types.responses import ResponseReasoningItem
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | The unique identifier of the reasoning content. |
| summary | List[Summary] | Yes | Reasoning summary content. Each Summary has text (str) and type (Literal["summary_text"]). |
| type | Literal["reasoning"] | Yes | The type of the object. Always reasoning.
|
| content | Optional[List[Content]] | No | Reasoning text content. Each Content has text (str) and type (Literal["reasoning_text"]). |
| encrypted_content | Optional[str] | No | Encrypted content of the reasoning item, populated when requested via the include parameter. |
| status | Optional[Literal["in_progress", "completed", "incomplete"]] | No | The status of the item. Populated when items are returned via API. |
Usage Examples
import openai
client = openai.OpenAI()
response = client.responses.create(
model="o3-mini",
input="Explain step by step: why is the sky blue?",
include=["reasoning.encrypted_content"],
)
for item in response.output:
if item.type == "reasoning":
for s in item.summary:
print(f"Summary: {s.text}")
if item.encrypted_content:
print(f"Encrypted content length: {len(item.encrypted_content)}")