Verified July 27, 2026

Claude Fable 5 in LangChain and LangGraph

First-class support in both SDKs. The failures come from code you wrote before this model existed.

The short answer

Supported in both languages. In Python, pass model claude-fable-5 to ChatAnthropic and control depth with output_config containing effort, adding task_budget for agentic loops. In JavaScript, upgrade @langchain/anthropic to a version that includes the Claude 5-series support added on June 9, 2026. Then delete every temperature argument in your chain — this model rejects sampling parameters outright.

Support status

Fully supported, verified July 27, 2026. On the Python side, ChatAnthropic exposes output_config with three documented keys: effort, taking max, xhigh, high, medium or low; format, normally set through with_structured_output; and task_budget, an advisory token budget for an agentic loop, currently in beta and requiring langchain-anthropic 1.4.1 or later. On the JavaScript side, support for claude-fable-5 and claude-mythos-5 landed on June 9, 2026 — the change added default max_tokens family mappings for both IDs, extended the adaptive-only invocation compatibility logic so the Claude 5 series follows the same sampling and thinking constraints as claude-opus-4-7, and bumped the underlying Anthropic SDK.

Setup

Version, model, effort, budget — in that order.

  1. 1

    Pin a version that knows about Fable 5

    In Python, install langchain-anthropic 1.4.1 or later if you want task budgets, and set ANTHROPIC_API_KEY. In JavaScript, take a @langchain/anthropic release that includes the June 2026 Claude 5-series change; older versions do not apply the adaptive-only parameter handling and will send defaults this model rejects.

  2. 2

    Construct the model without sampling parameters

    Instantiate ChatAnthropic with model claude-fable-5 and an explicit max_tokens. Do not pass temperature, top_p or top_k — all three return a 400 on this model. Do not pass a thinking block either: adaptive thinking is always on, and thinking type disabled is rejected.

  3. 3

    Set effort deliberately

    Pass output_config with an effort value, or use the top-level effort argument on ChatAnthropic. The default is high, and setting effort explicitly to the model's default is equivalent to omitting it — it does not break prompt caching, whereas changing it between requests does.

  4. 4

    For LangGraph loops, add a task budget

    Add task_budget to output_config with type tokens and a total sized from real data, and send the task-budgets-2026-03-13 beta header. The minimum total is 20,000 tokens; below that the API returns a 400. The countdown is injected server-side and the model paces itself against it.

Gotchas

Four ways a chain that worked on Opus stops working here.

  • task_budget is advisory, and starving it looks like a refusal

    The budget is a countdown the model paces itself against, not an enforced cap — max_tokens remains the only hard limit, and Claude may overshoot slightly rather than abandon an in-flight action. Worse, a technically valid but too-small budget on a long task makes the model scope down hard or stop early, which reads as a refusal in your logs. If unexpected early stops appear right after you add a budget, raise it before debugging anything else.

  • An old @langchain/anthropic sends parameters it should strip

    The JavaScript change that added Fable 5 also extended the adaptive-only compatibility logic and the default max_tokens mapping. On an older version the model ID still resolves, so nothing obviously fails at import time — you just get default sampling parameters on the wire and a 400 you will try to debug in your own code first.

  • temperature=0 is in every LangChain example you have copied

    Determinism through temperature=0 is close to a reflex in LangChain code, and it is a 400 on Fable 5, along with top_p and top_k. Search your chains, your agent constructors and your config files for it. Steer with the prompt instead; there is no sampling knob on this model to compensate with.

  • You cannot turn thinking off to save money

    On models where thinking is optional, disabling it is a standard cost measure. On Fable 5, thinking type disabled returns a 400 — adaptive thinking is always on and effort is the only depth control. If you have a routing layer that disables thinking for cheap paths, it needs a model-specific branch.

Cost notes

In a LangGraph agent, every node is a full request, so a 1M context window multiplied across nodes is how budgets disappear. Three things actually move the number. Effort is the primary lever, and Anthropic's own guidance is that lower effort on Fable 5 often exceeds xhigh on previous models — so start at high, and test medium before assuming you need more. Prompt caching returns 90% on cached input reads, but the resolved effort value is rendered into the prompt, so varying effort per node invalidates the cache. And task budgets shape behaviour without capping spend; if you need a hard limit, you still enforce it yourself by summing usage across the loop.

Get the parameter rules right the first time

Which parameters this model accepts, which return a 400, and what replaced the ones that were removed — our API reference has the full list with the error shapes.

FAQ