Skip to main content

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.4 series.

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 an id (i.e., the rs_id) along with the current thinking state.
  • On the second call, include tags: ["stateful"] and the rs_id returned 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

DimensionChat Completions (no stateful)Responses + stateful
Multi-turn reasoningReasoning is re-executed each turn; tokens are billed repeatedlyTurn 2+ reuses the thinking state from Turn 1
Protocol supportAll protocolsv1/responses only
Model scopeAll reasoning modelsModels listed in the Response model list that support stateful reasoning
State ownershipClient manages via messagesPlatform caches via rs_id
Best forStandard multi-turn chatLong, complex reasoning chains (math proofs, code debugging, analytical reports)

Important Notes

  • rs_id cannot 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/completions protocol — under Chat Completions, the internal reasoning of OpenAI reasoning models is neither controllable nor visible (see Reasoning → OpenAI/Azure).