Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JXVi2GMQ7bR5EmbUFdDj7N
19 lines
1.2 KiB
Plaintext
19 lines
1.2 KiB
Plaintext
# Prompt caching: what each client sends and what Usage reports
|
|
|
|
A. Anthropic: the strategy decides whether the system prompt carries a cache breakpoint
|
|
strategy NONE system is a plain string
|
|
call 1: promptTokens=6014 cacheRead=0 cacheWrite=0
|
|
call 2: promptTokens=6014 cacheRead=0 cacheWrite=0
|
|
strategy SYSTEM_ONLY system is a list of 1 block(s), cache_control on block 0: true
|
|
call 1: promptTokens=3 cacheRead=0 cacheWrite=6011
|
|
call 2: promptTokens=3 cacheRead=6011 cacheWrite=0
|
|
|
|
B. OpenAI and Gemini: nothing to switch on, but the order of the text decides the hit
|
|
OPENAI timestamp AFTER the policy: call 1 cacheRead=0 call 2 cacheRead=6016 of 6019 prompt tokens
|
|
OPENAI timestamp BEFORE the policy: call 1 cacheRead=0 call 2 cacheRead=0 of 6019 prompt tokens
|
|
GEMINI timestamp AFTER the policy: call 1 cacheRead=0 call 2 cacheRead=6016 of 6019 prompt tokens
|
|
GEMINI timestamp BEFORE the policy: call 1 cacheRead=0 call 2 cacheRead=0 of 6019 prompt tokens
|
|
|
|
C. A prompt below the vendor's minimum: the client still asks, the vendor does not cache
|
|
Anthropic SYSTEM_ONLY, 847-character policy: cache_control sent=true, cacheRead=0 cacheWrite=0
|