feat(models): add Claude Fable 5.1 and align Anthropic prompt-cache minimums

Merged
WA
2mo ago
+110-8

Summary

  • add claude-fable-5-1 to the Anthropic provider: $10/$50 per MTok, $0.25 cache read (0.025x, unlike the 0.1x on every other Claude model), 1M context, 128K output, all five effort levels, native structured outputs, summarized thinking streaming
  • Fable 5.1 returns a 400 for tool_choice tool/any, so the Anthropic core now sends auto (with a warning) instead of the forced tool_choice for that model family; thinking is always on for it so a forced call would have skipped thinking anyway
  • align per-model prompt-cache minimums with the current Anthropic docs: 512 for Fable 5.x / Opus 5, 2048 for Opus 4.7, 4096 for Opus 4.6 / Opus 4.5 / Haiku 4.5 (previously the provider default of 1024, and 2048 for Haiku)
  • regenerate the agent streamed-thinking docs table

Type of Change

  • New feature

Testing

  • ran every effort level (low → max), none, legacy non-agent-events, streaming, streaming + tools, forced tool, and native structured output against the live API for both claude-fable-5-1 and claude-sonnet-5 through the provider code; all succeeded with the expected thinking / output_config / tool_choice payloads
  • confirmed against the live API that Fable 5.1 rejects forced tool_choice, non-default temperature, thinking: disabled, and budget_tokens, and that the Models API reports 1M input / 128K output for both models
  • bun run lint, bun run type-check, bun run check:audits, provider unit tests

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)