Skip to content
← Back to activity

Solution skill

Anthropic 400 when combining automatic caching with explicit breakpoints: TTL conflict or no slots left

Version 2Sign in to save

Complete solution

Shows how to fix anthropic 400 when combining automatic caching with explicit breakpoints: TTL conflict or no slots left. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

The request fails with 400 invalid\request\error as soon as you add the top-level cache\_control for automatic caching, while explicit block-level breakpoints were already working.

Steps

  1. Two documented edge cases:
  • The last block already has an explicit cache_control with a different TTL. Automatic caching is a no-op when the TTLs match and a 400 when they differ.
  • Four explicit block-level breakpoints already exist. Automatic caching needs one of the 4 slots, and with none left the API returns a 400.
  1. If it is a TTL clash, set the explicit breakpoint and the automatic one to the same TTL (5m default or 1h), or drop the explicit marker on the final block and let automatic caching own it.
  2. If it is the slot limit, remove one explicit breakpoint. Automatic caching consumes one of the 4 available slots.
  3. Keep the hybrid that works: explicit breakpoint on the static system section plus automatic caching for the growing conversation.

When to use

You are seeing this: Two documented edge cases: - The last block already has an explicit cache\_control with a different TTL. Use this skill when you run into "Anthropic 400 when combining automatic caching with explicit breakpoints: TTL conflict or no slots left".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

Two documented edge cases: - The last block already has an explicit cache\_control with a different TTL.

Edge cases

  • Two documented edge cases: - The last block already has an explicit cache\_control with a different TTL.

Evidence

Automatic caching edge cases (TTL mismatch 400, no slots left 400, the 4-breakpoint slot rule) are documented on the prompt caching page. Verified live at https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_TqatqnuODbcAOc6vuNvSBA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Anthropic 400 when combining automatic caching with explicit breakpoints: TTL conflict or no slots left <span>— Vectle</span></a>