Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

cache-diagnostics changedbuild-with-claude/cache-diagnostics

Nearest release: v2.1.239, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+16added
Lines−16removed
From line 30 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits13to this page, all time

The whole hunk

from line 30, old and new numbered
/
lines
from line 30
3030 ```bash cURL
3131 # Turn 1: establish the cache and opt in to diagnostics
3232 response=$(curl -sS --fail-with-body https://api.anthropic.com/v1/messages \
33 --header "x-api-key: $ANTHROPIC_API_KEY" \
34 --header "anthropic-version: 2023-06-01" \
35 --header "anthropic-beta: cache-diagnosis-2026-04-07" \
36 --header "content-type: application/json" \
37 --data '{
33 -H "x-api-key: $ANTHROPIC_API_KEY" \
34 -H "anthropic-version: 2023-06-01" \
35 -H "anthropic-beta: cache-diagnosis-2026-04-07" \
36 -H "content-type: application/json" \
37 -d '{
3838 "model": "claude-opus-5",
3939 "max_tokens": 1024,
4040 "cache_control": {"type": "ephemeral"},
from line 47
4747 
4848 # Turn 2: reference the previous turn so the API can compare prefixes
4949 curl -sS --fail-with-body https://api.anthropic.com/v1/messages \
50 --header "x-api-key: $ANTHROPIC_API_KEY" \
51 --header "anthropic-version: 2023-06-01" \
52 --header "anthropic-beta: cache-diagnosis-2026-04-07" \
53 --header "content-type: application/json" \
54 --data @- <<EOF | jq '{id, diagnostics}' # diagnostics: null means no divergence was found
50 -H "x-api-key: $ANTHROPIC_API_KEY" \
51 -H "anthropic-version: 2023-06-01" \
52 -H "anthropic-beta: cache-diagnosis-2026-04-07" \
53 -H "content-type: application/json" \
54 -d @- <<EOF | jq '{id, diagnostics}' # diagnostics: null means no divergence was found
5555 {
5656 "model": "claude-opus-5",
5757 "max_tokens": 1024,
from line 427
427427 # Turn 2: stream the response. diagnostics arrives on the message_start event;
428428 # a null value means no divergence was found.
429429 curl -sS --fail-with-body https://api.anthropic.com/v1/messages \
430 --header "x-api-key: $ANTHROPIC_API_KEY" \
431 --header "anthropic-version: 2023-06-01" \
432 --header "anthropic-beta: cache-diagnosis-2026-04-07" \
433 --header "content-type: application/json" \
434 --data @- <<EOF | jq -R 'select(startswith("data: ")) | ltrimstr("data: ") | fromjson | select(.type == "message_start") | .message.diagnostics'
430 -H "x-api-key: $ANTHROPIC_API_KEY" \
431 -H "anthropic-version: 2023-06-01" \
432 -H "anthropic-beta: cache-diagnosis-2026-04-07" \
433 -H "content-type: application/json" \
434 -d @- <<EOF | jq -R 'select(startswith("data: ")) | ltrimstr("data: ") | fromjson | select(.type == "message_start") | .message.diagnostics'
435435 {
436436 "model": "claude-opus-5",
437437 "max_tokens": 1024,
from line 1078
10781078 
10791079## Limitations
10801080 
1081* **Beta:** Field names and semantics may change before general availability.
1081* **Beta:** Field names and semantics may change while this feature is in beta.
10821082* **Claude API only:** Not available on Amazon Bedrock or Google Cloud.
10831083* **Limited retention:** Fingerprints for `previous_message_id` lookup expire after a short period. Run diagnostic comparisons between closely spaced requests.
10841084* **Same workspace:** The previous request must have been made with an API key from the same organization and workspace. To check, compare the `anthropic-workspace-id` [response header](https://platform.claude.com/docs/en/api/overview#response-headers) on the two responses.
Feedback