Persistent Multi-Turn State
What Is the Conversations API?
The Conversations API is OpenAI's dedicated endpoint for managing persistent, server-side conversation state. It replaces the manual pattern of tracking message arrays client-side or using the legacy Assistants API Threads.
Why It Exists
With Chat Completions, developers had to store and re-send the entire message history on every request - leading to token waste, context truncation bugs, and complex client-side state management. The Conversations API eliminates this by letting OpenAI manage the conversation server-side.
Relationship to the Responses API
The Conversations API works hand-in-hand with the Responses API. When you set store: true and use previous_response_id in a Responses API call, you are implicitly creating a Conversation. The Conversations API gives you explicit CRUD control over these stored conversations - list, retrieve, and delete them programmatically.
API Usage Patterns
import OpenAI from "openai";
const openai = new OpenAI();
// Start a new conversation via the Responses API
const r1 = await openai.responses.create({
model: "o3-mini",
store: true,
input: "I need help planning a product launch."
});
// Continue the conversation - server remembers context
const r2 = await openai.responses.create({
model: "o3-mini",
store: true,
previous_response_id: r1.id,
input: "What marketing channels should I prioritize?"
});
// List all stored conversations
const conversations = await openai.responses.list();
// Delete a conversation when no longer needed
await openai.responses.del(r1.id);
Key Benefits
- Zero client-side state: No message arrays, no truncation logic, no local databases.
- Automatic prompt caching: Stored conversations get automatic prefix caching for up to 90% input token savings.
- Seamless migration: Replaces Assistants API Threads - use Conversations API + Responses API instead.
- Full audit trail: Every response is stored with metadata for compliance and debugging.
store: true + previous_response_id replaces Threads + Runs entirely.