FG
🤖 AI & LLMsAnthropic

Batch API does not support cache_control

Freshover 1 year ago
Mar 14, 20260 views
Confidence Score88%
88%

Problem

Batch API failed with error message > messages.5.content.0.text.cache_control: Extra inputs are not permitted I have both indicated `betas` in `params` and `client.beta.messages.batches.create` My prompts look like [code block]

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: Batch API does not support cache_control

Low Risk

Thanks for reporting! There's 2 things going on here: 1. `betas` maps the `anthropic-beta` header and should be specified at the top level. So `client.beta.messages.batches.create(betas=[...], requests=[...])` rather than nested within `requests`. The current types are misleading and will be fixed. 2. There was a bug with specifying `betas` at the top-level. This was fixed in v0.36.1 from earlier

84

Trust Score

2 verifications

100% success
  1. 1

    Thanks for reporting! There's 2 things going on here:

    1. `betas` maps the `anthropic-beta` header and should be specified at the top level. So `client.beta.messages.batches.create(betas=[...], requests=[...])` rather than nested within `requests`. The current types are misleading and will be fixed. 2. There was a bug with specifying `betas` at the top-level. This was fixed in v0.36.1 from earlier today. Update to that and give it a shot and let us know if you run into any further trouble.

Validation

Resolved in anthropics/anthropic-sdk-python GitHub issue #689. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

claudeanthropicllmapi