Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

AnthropicLLM

Claude models from Anthropic, using your Anthropic API key. Good for agents that need strong reasoning, instruction following and tool use. Authenticates with ANTHROPIC_API_KEY from your environment, or an explicit api_key.

Fields

str
default:"UNSET"
Claude model name, e.g. “claude-sonnet-5-5”. Defaults to ‘claude-sonnet-5-5’.
str | None
default:"UNSET"
Custom Anthropic API endpoint, e.g. for a proxy. Defaults to None (not set).
float | None
default:"UNSET"
Sampling temperature, 0 to 1. Ignored on Opus 4.7+, Sonnet 5+ and Fable models. On Claude 4.x set temperature or top_p, not both. Defaults to None (not set).
Literal['auto', 'required', 'none']
default:"UNSET"
“auto” lets Claude decide, “required” forces a tool call, “none” disables tools. “required” becomes “auto” on models that disallow forced tool use. Defaults to ‘auto’.
int
default:"UNSET"
Maximum tokens in each reply, including any thinking tokens. Defaults to 4096.
int | None
default:"UNSET"
Sample only from the K most likely tokens. Ignored on Opus 4.7+, Sonnet 5+ and Fable models. Defaults to None (not set).
float | None
default:"UNSET"
Nucleus sampling probability mass, 0 to 1. Ignored on Opus 4.7+, Sonnet 5+ and Fable models. On Claude 4.x set temperature or top_p, not both. Defaults to None (not set).
Literal['ephemeral'] | None
default:"UNSET"
Set to “ephemeral” to turn on prompt caching for the system prompt, tools and recent turns, cutting cost and latency on long conversations. Defaults to None (not set).
bool | None
default:"UNSET"
Allow (True) or prevent (False) Claude from calling several tools in a single turn. Defaults to None (not set).
dict | None
default:"UNSET"
Extended thinking settings, passed as given, e.g. {“type”: “adaptive”}, or {“type”: “enabled”, “budget_tokens”: 2048} on older models. Defaults to None (not set).
Literal['low', 'medium', 'high', 'xhigh', 'max'] | None
default:"UNSET"
How much effort Claude spends on a reply: “low”, “medium”, “high”, “xhigh” or “max”. Lower is faster and cheaper. Defaults to None (not set).
int
default:"UNSET"
Number of automatic retries after transient API errors. Defaults to 0.