OpenAI Stateful Reasoning
Reasoning models that support stateful reasoning can reuse thinking states across turns — by passing
tags: ["stateful"]+rs_id, subsequent turns build directly on the internal reasoning from the previous turn, avoiding redundant reasoning charges.
Supported Endpoints and Models
- Endpoint:
v1/responses(OpenAI Responses API; not supported on Chat Completions) - Applicable models: Refer to the Response model list for models that support stateful reasoning.
- Not required for: Non-reasoning models such as
gpt-5.1-chat(standard multi-turn handling suffices) - Note: The examples on this page are specific to stateful capabilities and are not general model recommendations; for ordinary reasoning tasks, prefer the
gpt-5.5/gpt-5.4series.
Trigger Parameters
tags ["stateful"] Required. Instructs the platform to enable stateful mode.
rs_id string (optional) The response ID returned from the previous turn; omit on the first call of a new session.
How It Works
- On the first call, omit
rs_id. The response returns anid(i.e., thers_id) along with the current thinking state. - On the second call, include
tags: ["stateful"]and thers_idreturned from the first call. The model reuses the internal reasoning from the previous turn instead of reasoning from scratch. - State is retained in platform memory with a limited TTL; it will expire if no calls are made for an extended period.
Examples
Turn 1 (Start a new session)
curl $TURING_BASE_URL/responses \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "turing/gpt-5.2",
"input": "Please analyze the development trends in quantum computing",
"reasoning": {"effort": "high"},
"tags": ["stateful"]
}'
# The response returns id: "rs_abc123..."
Turn 2 (Continue based on the previous turn's state)
curl $TURING_BASE_URL/responses \
-H "Authorization: Bearer $TURING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "turing/gpt-5.2",
"input": "Based on the analysis above, provide investment recommendations",
"rs_id": "rs_abc123...",
"tags": ["stateful"]
}'
Comparison with Chat Completions
| Dimension | Chat Completions (no stateful) | Responses + stateful |
|---|---|---|
| Multi-turn reasoning | Reasoning is re-executed each turn; tokens are billed repeatedly | Turn 2+ reuses the thinking state from Turn 1 |
| Protocol support | All protocols | v1/responses only |
| Model scope | All reasoning models | Models listed in the Response model list that support stateful reasoning |
| State ownership | Client manages via messages | Platform caches via rs_id |
| Best for | Standard multi-turn chat | Long, complex reasoning chains (math proofs, code debugging, analytical reports) |
Important Notes
rs_idcannot be shared across users; it is scoped per API key.- State TTL is subject to platform limits and will be purged after extended idle periods — once expired, requests must restart from Turn 1.
- Cannot be mixed with the
v1/chat/completionsprotocol — under Chat Completions, the internal reasoning of OpenAI reasoning models is neither controllable nor visible (see Reasoning → OpenAI/Azure).
Related Documentation
- Responses API → Stateful Reasoning — Complete field reference for the Responses protocol
- Reasoning → OpenAI/Azure — OpenAI reasoning model matrix
- OpenAI Official: Reasoning