[DOCS] Missing beta header requirements in Agent SDK Structured Outputs documentation

Resolved 💬 4 comments Opened Jan 18, 2026 by coygeek Closed Jan 21, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://platform.claude.com/docs/en/agent-sdk/structured-outputs

Section/Topic

The "Quick start" examples and "Output format configuration" sections.

Current Documentation

The SDK documentation provides code examples for Python and TypeScript using the output_format option. For example:

options = ClaudeAgentOptions(
    output_format={
        "type": "json_schema",
        "schema": schema
    }
)

It does not mention or include any requirement for a beta header.

What's Wrong or Missing?

The main Claude API documentation for Structured Outputs (https://platform.claude.com/docs/en/build-with-claude/structured-outputs) explicitly states:

"To use the feature, set the beta header structured-outputs-2025-11-13."

However, the Agent SDK documentation fails to mention this. Furthermore, the internal transport implementation (specifically subprocess_cli.py in the Python SDK) does not automatically inject this header when output_format is detected. Consequently, users following the SDK documentation will likely find that their structured output requests are either ignored or return standard text because the underlying Messages API request is missing the required beta flag.

Suggested Improvement

The documentation should be updated to include the betas parameter in the ClaudeAgentOptions for all Structured Output examples.

Suggested Python Example:

options = ClaudeAgentOptions(
    model="claude-sonnet-4-5",
    betas=["structured-outputs-2025-11-13"], # This line is currently missing from docs
    output_format={
        "type": "json_schema",
        "schema": schema
    }
)

Suggested TypeScript Example:

const response = await query({
  prompt: "...",
  options: {
    model: "claude-sonnet-4-5",
    betas: ["structured-outputs-2025-11-13"], // This line is currently missing from docs
    outputFormat: {
      type: 'json_schema',
      schema: schema
    }
  }
});

Impact

High - Prevents users from using a feature

Additional Context

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗