Topic: Claude conversation export
Can You Export Claude API Conversations? No — and Here's Why
The Anthropic Messages API (POST /v1/messages) is stateless by design. Unlike claude.ai, which stores every conversation turn in Anthropic's servers and exposes it via a data export, the API stores nothing between requests — no conversation ID, no server-side history, no recovery path. If you made architecture decisions in a Claude API session and closed the app without saving, the conversation is gone. This page explains the architecture, the one export that does exist (claude.ai conversations), the Claude Projects nuance, and what to do if you need to recover or preserve API-session content.
TL;DR
Claude API (POST /v1/messages): stateless — no history stored, no export path. Capture at the time or it is gone. Claude.ai (web interface): stateful — conversations stored server-side, exportable via Settings → Account → Export Data → conversations.json. Claude Projects: project-level system prompt stored server-side; conversation history within the project stored and included in the claude.ai export. Anthropic API data use: API prompts are NOT used for model training by default (opt-in required), unlike claude.ai which defaults to allowing improvement use unless you opt out.
How the Anthropic Messages API works — why it cannot store history
The Anthropic Messages API follows the same stateless architecture as the OpenAI Chat Completions API. Each request to POST /v1/messages must include the full conversation history in the messages array:
POST /v1/messages
{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"messages": [
{ "role": "user", "content": "Should we use Postgres or MongoDB for the analytics schema?" },
{ "role": "assistant", "content": "For an analytics schema, Postgres is typically..." },
{ "role": "user", "content": "What about the write throughput concern?" }
]
}
The server receives this request, generates a response, and returns it. Nothing from the conversation is stored on Anthropic's side after the response is returned. The next request from the same client — even one second later — has no server-side memory of the prior turns. The client application is responsible for maintaining conversation state by including prior turns in every request.
There is no conversation ID, no session token, and no endpoint to retrieve prior turns. The API has no GET /v1/conversations/{id} route. If the client application crashes, closes, or simply does not save the messages array, the conversation history is permanently gone from Anthropic's servers because it was never there to begin with.
This is architectural, not an oversight. Stateless request-response is the correct model for an API: it is simpler to reason about, easier to scale horizontally, and gives API customers full control over where and how conversation history is stored (in their own database, with their own retention policy, accessible via their own retrieval logic). The product-layer (claude.ai) adds the server-side storage on top of this same API, just as ChatGPT adds it on top of the OpenAI Chat Completions API.
The split: what is and isn't stored
| Surface | Stored server-side? | Retrievable / exportable? |
|---|---|---|
| Anthropic Messages API calls | No — stateless, nothing stored after response | No — never stored, no recovery path |
| claude.ai conversations (personal) | Yes — stored in Anthropic's servers per account | Yes — Settings → Account → Export Data → conversations.json |
| Claude Projects (claude.ai) | Yes — project metadata and conversation history stored | Yes — included in the claude.ai data export, labeled with project context |
| Claude for Work / Teams accounts | Yes — stored per organization account | Yes — individual member export via account settings; admin export varies by plan |
| Uploaded file attachments (claude.ai) | Temporarily during session; not permanently | Filename appears in export; binary content absent |
| Artifacts / Canvas outputs (claude.ai) | Generated during session; view in conversation history | Conversation text is exported; artifact files (HTML, code) absent as separate files |
| System prompt (API customer-defined) | No — passed in each request, not stored | No — customer owns their system prompt; Anthropic does not store it |
| API usage counts (tokens, cost) | Yes — for billing purposes, aggregated by workspace | Yes — via Anthropic console usage tab; aggregated counts, not message content |
The claude.ai export — what it contains
If your Claude usage was through the claude.ai web interface (not through the API), an export is available:
- Go to claude.ai → Settings → Account
- Click Export Data
- Click Request Data Export
- Anthropic emails a download link within a few hours (sometimes faster)
- Download the ZIP file; it contains
conversations.json
The conversations.json file is a JSON array of conversation objects. Each conversation has:
uuid— unique identifier for the conversationname— the conversation title (auto-generated or renamed by you)created_atandupdated_at— timestampschat_messages— array of message objects, each withuuid,sender("human" or "assistant"),text, andcreated_at
The format is notably simpler than ChatGPT's conversations.json, which uses a mapping DAG to represent branching conversation trees. Claude's format is a flat linear array — one message after another, in order. There is no branching structure, no tool-call node representation, and no complex message content types. This makes it straightforward to parse with a simple jq or Python script:
# Extract all human turns from a claude.ai export
jq -r '.[] | .name as $name |
.chat_messages[] |
select(.sender == "human") |
"\($name): \(.text)"' conversations.json
What is NOT in the export: binary files you uploaded as attachments (the filename appears in the conversation text but the file itself is not included), artifacts generated during the session (code artifacts, HTML canvas outputs — the conversation text references them but they are not separate files in the export), and any conversations you deleted before requesting the export.
Claude Projects — the semi-stateful exception
Claude Projects (available on Pro and Team plans) adds a project-level context layer on top of the standard conversation model. A Project stores:
- A project-level system prompt (Custom Instructions for the project)
- Project Knowledge files — documents you upload that persist across all conversations in the project
- All conversations within the project, associated with the project context
Project conversations are stored server-side and appear in the claude.ai data export with the project association visible in the conversation metadata. The Project Knowledge files themselves are NOT included as binaries in the export — same binary-exclusion rule as uploaded attachments. The project system prompt IS stored server-side and is accessible in the Project settings; it appears in the export as part of the conversation context.
Projects are a claude.ai product feature, not an API feature. There is no "Projects API" that lets you create a Project server-side and then have API calls associate with it. If you are building a product on top of the Anthropic API and want persistent context, you store the project context in your own database and inject it as a system prompt on each API call.
Contrast with ChatGPT — the same split exists there
The claude.ai vs Anthropic API split is symmetric with the ChatGPT vs OpenAI API split documented in the OpenAI Playground export reference. In both cases:
- The product (claude.ai / ChatGPT) stores conversations server-side and provides a data export
- The API (Anthropic Messages API / OpenAI Chat Completions API) is stateless and provides no history storage or export
- The product is built on top of the same API, adding the persistence layer that the API does not have
The one difference: OpenAI's Assistants API does create server-side Threads with persistent message history, retrievable via the API. Anthropic does not have an equivalent — there is no thread-persistence API. If you need conversation history stored server-side for an application built on Claude, you store it in your own database.
Anthropic's data use policy for API customers
By default, prompts submitted via the Anthropic API are not used to train Claude. This is the opposite of claude.ai's default behavior, where conversations may be reviewed and used to improve the product unless you explicitly opt out in Settings → Privacy → "Improve Claude for everyone."
API customers who want to opt in to having their usage data inform model improvements can do so through the Anthropic console. The default opt-out for API traffic reflects the expectation that API customers are building applications on behalf of their own users and may handle sensitive data that should not feed into model training without explicit consent.
For organizations with data handling requirements: the API provides stronger data isolation by default than claude.ai. Conversations made via claude.ai by employees on a personal account are subject to claude.ai's privacy defaults (which allow improvement use unless opted out). Conversations made via a properly configured API integration are not, by default.
Capture-at-the-time workarounds for API sessions
If you use Claude via the API — through a custom tool, a Claude Code session, or a third-party application that calls the API directly — and you want to preserve the conversation, the options are:
- Log every request and response locally. The most complete option. Log the full
messagesarray from each request (which contains the prior conversation history) alongside the API response. A minimal Node.js logging proxy that writes every exchange to a timestamped JSON file captures the full session without modifying the application:// Minimal Claude API request logger import fs from 'fs'; import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); const session = []; async function callClaude(userMessage) { session.push({ role: 'user', content: userMessage }); const response = await client.messages.create({ model: 'claude-sonnet-4-6', max_tokens: 1024, messages: session }); const assistantText = response.content[0].text; session.push({ role: 'assistant', content: assistantText }); // Log full session after every turn const filename = `claude-session-${Date.now()}.json`; fs.writeFileSync(filename, JSON.stringify(session, null, 2)); return assistantText; } - Copy conversation text before closing. The manual version of logging. Works for one-off exploration sessions but does not capture the full structured turn-by-turn format.
- Use claude.ai instead of the API for non-automated conversations. If you are using Claude interactively to think through decisions — not building a product — the right surface is claude.ai, which stores the history automatically and makes it exportable. The API is the right choice when you need programmatic control; claude.ai is the right choice when you want conversation persistence for free.
- Use Claude Code (the CLI tool). Claude Code sessions are interactive by design and store conversation context within the session. For engineering decision-making workflows, Claude Code is an API-powered tool that handles the conversation management layer, making the statelessness of the API invisible to the user.
The decision-capture implication
The statelessness asymmetry has a practical consequence for decision capture. Decisions made in claude.ai are always recoverable from the export, even months later. Decisions made via API calls are recoverable only if the client application saved them at the time. The architectural reasoning, the alternatives considered, the trade-offs evaluated — all of that is gone from Anthropic's infrastructure the moment the API response is returned.
This matters because the majority of consequential AI-assisted architecture decisions happen in interactive sessions — a senior engineer and Claude working through a schema design or a system decomposition for 45 minutes. If that session happened in claude.ai, the reasoning is retrievable. If it happened in a custom API tool, or in an IDE assistant backed by the API, or in Claude Code in a session that was not saved, the reasoning exists only in the engineer's memory and in whatever notes they happened to take.
The WhyChose extractor reads claude.ai conversation exports — the structured JSON that the data export produces — and surfaces the decisions embedded in those conversations as structured records with original context and trade-offs. It cannot help with API sessions that were not saved, because those sessions left no export artifact for it to read. The practical advice: for consequential decisions, use claude.ai (or save API sessions explicitly), and export quarterly.
Related questions
Does the Anthropic API store conversation history?
No. The Anthropic Messages API (POST /v1/messages) is stateless. Each request must include the complete conversation history in the messages array — the server does not remember any prior turns. When the response is returned, nothing from the conversation is persisted on Anthropic's side beyond the temporary processing required to generate the response. There is no conversation ID, no session ID, and no server-side history to retrieve or export. If you close the application using the API without saving the conversation, it is gone — there is no recovery path.
Is there a Claude API equivalent to ChatGPT's conversations.json export?
No. ChatGPT stores every conversation turn in OpenAI's database associated with your account; the conversations.json file in the data export is a dump of that stored history. The Anthropic API stores nothing between requests, so there is no server-side history to dump. The equivalent export that DOES exist is the claude.ai personal data export (Settings → Account → Export Data), which covers conversations you had through the claude.ai web interface — not through the API. If you used Claude exclusively through API calls and did not save the conversation client-side, there is no export to request.
Does Anthropic use my API prompts to train Claude?
By default, no. Anthropic's privacy policy for API customers states that prompts submitted via the API are not used to train models by default. This is the opposite of Claude.ai's default behavior, where conversations may be reviewed by Anthropic to improve the product unless you opt out in Settings → Privacy → "Improve Claude for everyone." API customers who want to explicitly opt in to having their data used for training can do so through the Anthropic console. The distinction matters for organizations with data handling requirements: API access provides stronger data isolation guarantees than claude.ai by default.
What does the Claude.ai data export actually contain?
The claude.ai export (Settings → Account → Export Data → Request Data Export) produces a ZIP file containing conversations.json — a JSON array of conversation objects. Each conversation has a uuid, name (the conversation title), created_at, updated_at, and a chat_messages array. Each message in chat_messages has a uuid, sender ('human' or 'assistant'), text, and created_at. Projects are included as separate entries if you use Claude Projects. What is NOT included: files you uploaded as attachments (filenames appear but binaries are absent), artifacts generated during the conversation, and API-session conversations which were never stored. The format is simpler than ChatGPT's conversations.json — a flat linear array rather than a mapping DAG, with no branching structure or tool-call nodes.
Further reading
- How to export Claude conversations — the full guide — the step-by-step export path for claude.ai personal accounts, Claude for Work teams, and what the resulting JSON contains. Start here if you want the actual export procedure rather than the architecture explanation.
- Extract decisions from Claude — using WhyChose with a claude.ai export — how to take the conversations.json from a claude.ai export and run the WhyChose extractor to surface structured decision records from your conversation history.
- Claude for Work team conversation export — how team-plan accounts handle export differently from personal accounts, including admin-level export options and data retention policies for enterprise plans.
- Can you export OpenAI Playground conversations? No — and here's why — the symmetric reference for the ChatGPT / OpenAI API split. The same stateless-API architecture applies, with the same capture-at-the-time recommendation. Useful if your team uses both platforms.
- Perplexity API vs product — what's stored, what's stateless, and what you can export — the third entry completing the API-vs-product statelessness cluster. Perplexity API is stateless (same architecture); the Perplexity product has worse export coverage than both ChatGPT and Claude — no native export button, only a slow GDPR request with partial content return. Useful for teams who use Perplexity for research alongside ChatGPT/Claude for deliberation.
- ChatGPT conversations.json format — the complete field reference — the structure of the ChatGPT data export, which is significantly more complex than the Claude export. Includes the mapping DAG, tool-call node types, and branching conversation model that Claude's format does not have.
- The open-source extractor — reads claude.ai conversation exports and surfaces embedded decision records. Requires a saved export; API sessions that were not captured at the time cannot be recovered.
- Claude Desktop app conversation export — the native desktop app case: Claude Desktop is server-side (not local storage), uses the same export path as claude.ai, and the local app data directory contains MCP configuration rather than conversation content.