FG
💻 Software🤖 AI & LLMsAnthropic

Adding extra_headers for the anthropic web-fetch tool causes the structured_output example to fail

Fresh3 months ago
Mar 14, 20260 views
Confidence Score87%
87%

Problem

Adding the `extra_headers` and `tools` options in the`messages.create` call causes the call with `output_format` to fail. I am using version 0.75 of the sdk. I took the example from here: https://platform.claude.com/docs/en/build-with-claude/structured-outputs#quick-start and added these two options in the create call [code block] This causes the example to fail with this error [code block] Are these options incompatible with structured output. I'm not sure this is an sdk error or an error in the api itself, please close if not appropriate.

Error Output

Error: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'output_format: Extra inputs are not permitted'}, 'request_id': 'req_011CWFjdN1tMWCHmGWcYGVfp'}

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Adding extra_headers for the anthropic web-fetch tool causes the structured_output example to fail

Low Risk

I also tried removing the `extra_headers` option and passing in just the `tools` for web-fetch, but that gives the following error: [code block]

84

Trust Score

1 verification

100% success
  1. 1

    I also tried removing the `extra_headers` option and passing in just the `tools`

    [code block]

    text
    anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': "tools.0: Input tag 'web_fetch_20250910' found using 'type' does not match any of the expected tags: 'bash_20250124', 'custom', 'text_editor_20250124', 'text_editor_20250429', 'text_editor_20250728', 'web_search_20250305'"}, 'request_id': 'req_011CWFk9Hw9cd88px4fHED9r'}

Validation

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

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

claudeanthropicllmapi