AI EngineerGuide

Top-level output_format returns a 400 on Claude Sonnet 5.5

Returns 400 Applies to claude-sonnet-5-5 on the Anthropic Messages API.

Anthropic's docs describe this error but don't quote the exact message, so we don't either.

How to fix it

Move the schema to output_config.format.

Before
{
  "max_tokens": 1024,
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "claude-sonnet-4-5-20250929",
  "output_format": {
    "schema": {
      "type": "object"
    },
    "type": "json_schema"
  }
}
After (Claude Sonnet 5.5)
{
  "max_tokens": 1024,
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "claude-sonnet-5-5",
  "output_config": {
    "format": {
      "schema": {
        "type": "object"
      },
      "type": "json_schema"
    }
  }
}

Official source

The output_format parameter is deprecated. To use it anyway, add the structured-outputs-2025-11-13 beta header. Without it, the API returns a 400 error. Use output_config.format instead.

https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45 (last checked 2026-11-02)

Other changes for the same models

All migration errors

FAQ

How do I fix this when moving to claude-sonnet-5-5?

Move the schema to output_config.format.

Where is this documented?

In Anthropic’s official docs: https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45, last checked 2026-11-02.