Skip to content

fix(messages): accept cache_control on Messages.parse - #1908

Open
Alphaxiaoteng wants to merge 1 commit into
anthropics:mainfrom
Alphaxiaoteng:fix/messages-parse-cache-control
Open

fix(messages): accept cache_control on Messages.parse#1908
Alphaxiaoteng wants to merge 1 commit into
anthropics:mainfrom
Alphaxiaoteng:fix/messages-parse-cache-control

Conversation

@Alphaxiaoteng

Copy link
Copy Markdown

Summary

  • Fixes Messages.parse (and AsyncMessages.parse) don't take cache_control? #1907: Messages.parse / AsyncMessages.parse omitted cache_control even though Messages.create, Messages.stream, and beta.messages.parse already accept it.
  • Forward the parameter into the /v1/messages body (same as create).
  • Add sync/async regression tests that assert the request body includes cache_control.

Test plan

  • uv run pytest tests/api_resources/test_messages_parse_cache_control.py -q → 2 passed
  • Confirmed cache_control is present on both sync and async parse signatures

Made with Cursor

Parity with Messages.create and beta.messages.parse so structured
output helpers can set top-level prompt caching. Fixes anthropics#1907.
@Alphaxiaoteng
Alphaxiaoteng requested a review from a team as a code owner September 3, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Messages.parse (and AsyncMessages.parse) don't take cache_control?

1 participant