PuppyIP Resource Center
AI API Guides 8 min read Published 2026-11-04

Claude API message threads: five-minute expiry, 404 recovery, caching and billing

Message threads are in beta in the Messages API: send a complete conversation first, then send only new messages. Keep your application's full transcript and a replay path for expired or unstored turns. Threads do not cache prompts automatically or change API pricing or rate limits.

Claude API Message threads Conversation recovery Prompt caching API troubleshooting

Service eligibility and regional restrictions

PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.

Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.

Key Takeaways

  • Anthropic lists message threads beta in its November 2, 2026 release notes. Requests require message-threads-2026-08-12; the date in that header is not the announcement date.
  • Create takes the full conversation, system and tools. Continue takes the latest response id and only new messages; system and tools must be omitted entirely.
  • Threads expire five minutes after the last request, and storage is best effort. Keep your own complete history rather than retaining only previous_message_id.
  • Prompt caching needs separate configuration. Threads do not change API pricing or rate limits, and the docs provide no generalizable numerical latency or cost improvement.
  • This beta is not ZDR or HIPAA eligible. Listed platform support does not establish availability for every country, account or organization.

What problem do message threads solve?

Message threads provide short-lived conversation state for the Messages API. For a growing conversation or agent loop, the server reconstructs stored context so later requests need only carry new messages. Anthropic says this can reduce request size and deliver lower, steadier time to first token, without promising a fixed speedup.

They are not a long-term conversation database. They are also separate from Claude Code prompt-cache TTL and session threads in Claude Managed Agents. For Claude Code cache hits and /usage, see https://puppyip.com/en/resources/claude-code-prompt-cache-ttl-usage-guide. For background workflows and budgets, see https://puppyip.com/en/resources/claude-managed-agents-dynamic-workflows-completion-budget-guide.

How do you create and continue a thread?

First, send anthropic-beta: message-threads-2026-08-12 on every threaded /v1/messages request. Include the complete messages history, any system prompt and tools on the first request, with thread set to {"type":"create"}. Save the complete assistant response and its id. The SDK thread helper adds the beta header automatically.

Next, set thread to {"type":"continue","previous_message_id":"latest previous response id"} and put only messages added since that response in messages. Omit system and tools completely; even passing null returns 400. Use the new response id for each following turn.

For example, after an initial user question and assistant answer, the second request carries only the user's follow-up. Resending stored messages can duplicate conversation content or cause an error. Threads are append-only, and each response id can be continued once. To edit earlier messages or branch a conversation, create a new thread with the appropriate full history.

How do you recover after five-minute expiry or a 404?

A thread expires five minutes after its last request; each response actually stored resets that timer. The data is deleted no more than one hour after its last use. Expiry and deletion are separate deadlines. A successful create or continue response does not confirm that the turn was stored, so the next continuation may be the first sign that it is unavailable.

Check error.details.error_code first. thread_not_found can mean expiry, an unstored turn, a fallback response, a previous turn still generating, or an organization, workspace or identity mismatch, among other causes. A nonexistent model can also produce a 404, so the status alone does not identify a thread-expiry problem. Use the same API key, workspace and creating user or service account throughout a thread; rule out those mismatches before replaying.

When replay is needed, send your locally held full conversation, including received assistant responses, with the required system and tools in a new create request. Remove cache_control breakpoints from old messages before replay. Continue from the new response id. If thread_not_found recurs immediately after replay, follow the documented fallback of sending the complete conversation without thread.

The SDK helper can assist with replay, but keeps history only in the helper object's memory. It does not persist a copy across process exits. Your application needs complete recovery history under its own retention rules; previous_message_id alone cannot restore the conversation.

Which fields must stay fixed across requests?

Keep model, tool_choice, thinking, mcp_servers apart from authorization tokens, context_management, output_config, skills in container, top-level cache_control, and the set of anthropic-beta values identical on each request. Changes return 400 thread_fingerprint_mismatch. Start a new thread to change those fields or the initial system/tools. Non-fixed fields such as max_tokens, stop_sequences, stream, metadata and service_tier can change.

On the documented Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5 models, changing system or tools invalidates prior thinking/redacted_thinking blocks. Omit those old blocks when replaying into a new thread, as the docs instruct, to avoid a 400.

Requests using MCP or container still need those fields each time: the server does not store MCP URLs, MCP authorization tokens or the container id, and MCP authorization tokens may change. On Claude Platform on AWS, requests in a thread must use credentials for the IAM role or IAM user that created it.

For the documented Claude API integration with server-side fallbacks, include the field on every request or on none; adding or dropping it mid-thread is not allowed, although its value can change. Some organizations cannot combine fallbacks and threads. Retain the exact error and local history, then follow the documented recovery path. Changing a proxy does not replace platform eligibility or identity requirements.

Do smaller requests automatically cache prompts or lower the bill?

Threads do not cache prompts automatically. Prompt caching is separate and retains its minimum-length and breakpoint rules. You can configure top-level cache_control on each request or set block-level breakpoints yourself. A threaded request supports at most four breakpoints: top-level cache_control counts as one, and fixed system/tools breakpoints from create still count on continuations.

Anthropic explicitly says threads do not change pricing or rate limits. The server reconstructs context before calling the model, so less uploaded history does not establish fewer billed model input tokens or automatic savings. Review actual usage, cache reads and writes, and billing separately. This article contains no cost or latency measurements.

Which platform, retention and feature limits matter before adoption?

The docs list beta availability on every model through the Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed), and Claude in Microsoft Foundry. Do not substitute other cloud product names. The docs do not provide a complete country, account or organization eligibility matrix, or a general-availability date. Check your actual organization and platform requirements.

Thread contents, system prompts and tools are held in server memory encrypted with a server-managed key, never written to durable storage, and deleted no more than one hour after last use. Threads are not eligible for zero data retention (ZDR) or HIPAA; short-lived memory is not ZDR. Using threads does not change other eligible features' ZDR status. There is no API to list, read or delete threads.

Threads do not support Message Batches, token counting, or compaction, including on-demand compaction; submit the full conversation for token counting. Context editing has only the documented clear_thinking_20251015 exception with keep='all'. Organizations with HIPAA readiness or Inference hooks enabled are also unsupported. Files are held by reference, so your application must keep them available. For unsupported combinations, follow the documented path of sending the complete conversation without thread.

Sources

Frequently Asked Questions

Can I continue as soon as a streamed response provides an id?

Wait for message_stop. The id appears at message_start, but continuing while the previous turn is generating can return 404. If a continue stream drops before message_stop, retry that same continue. If it returns thread_already_continued or thread_continue_in_flight, replay the full history in a new create request.

How do I resume a response with stop_reason pause_turn?

Continue from that response id with messages: [], without adding a new user message while paused. If resume returns 404, create a new thread with the full conversation, including the paused response. Do not continue a refusal response; instead, omit or rephrase the triggering turn and create a new thread.

What if a fallback model answered the turn?

On the documented Claude API path, fallback responses are not stored, so their ids cannot continue the thread. Check usage.iterations for fallback_message, or the final message_delta when streaming. Include that response and your next message in a full-history create. To retry the original model/fallbacks, retain the server-side-fallback-2026-07-01 beta header and original parameters. If fallback answers again, replay again on the next turn. Alternatively, create a new thread using the model in fallback_message and parameters that model accepts, omitting fallbacks.