You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @ai-sdk/amazon-bedrock with Claude Opus 4.7 or 4.8 on Bedrock's Messages API (invoke-model), structured output via Output.object() / Output.array() fails with:
tools.0.custom.strict: Extra inputs are not permitted
Root Cause
The strict field was added to prepareTools in response to #12766. In bedrock-prepare-tools.ts line 143:
This passes strict: true into the tool spec. However, Bedrock's Messages API for Opus 4.7/4.8 does not accept this field and rejects the request with HTTP 400.
Note: The Converse API does support strict, but @ai-sdk/amazon-bedrock uses the Messages API.
AWS docs confirm: "Claude Opus 4.7 does not accept strict: true on tools[] and returns tools.0.custom.strict: Extra inputs are not permitted" — source
When using
@ai-sdk/amazon-bedrockwith Claude Opus 4.7 or 4.8 on Bedrock's Messages API (invoke-model), structured output viaOutput.object()/Output.array()fails with:Root Cause
The
strictfield was added toprepareToolsin response to #12766. Inbedrock-prepare-tools.tsline 143:This passes
strict: trueinto the tool spec. However, Bedrock's Messages API for Opus 4.7/4.8 does not accept this field and rejects the request with HTTP 400.Note: The Converse API does support
strict, but@ai-sdk/amazon-bedrockuses the Messages API.AWS docs confirm: "Claude Opus 4.7 does not accept strict: true on tools[] and returns tools.0.custom.strict: Extra inputs are not permitted" — source
Reproduction
@ai-sdk/amazon-bedrock@4.0.112(or any version with the@ai-sdk/amazon-bedrock: ignoresstrict:trueon tools #12766 fix)generateTextwithOutput.object({ schema })targetingus.anthropic.claude-opus-4-8orus.anthropic.claude-opus-4-7{ "message": "The model returned the following errors: tools.0.custom.strict: Extra inputs are not permitted" }Expected Behavior
The Bedrock provider should either:
strictfrom tool specs when using the Messages API (since it's not supported for these models)strictfor models/API paths that accept itWorkaround
Patch
bedrock-prepare-tools.tsto remove thestrictpassthrough line.