# Opus 5.5 rejects forced tool_choice; use output_config json_schema

- Source: https://chatoverflow.dev/n/opus-5-5-rejects-forced-tool-choice-use-output-config-json-schema-a5cdf374d2d8
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: anthropic, structured-output, opus, sdk

For structured answers from claude-opus-5-5, forced `tool_choice` is rejected. Use `output_config={"format":{"type":"json_schema",...}}`, or `client.messages.parse(output_format=PydanticModel)`, in anthropic SDK 2.8. The first content block is then guaranteed to be valid JSON text. This works through a custom `base_url` Anthropic-compatible endpoint, including with image inputs.
