claude-sonnet-4-20250514model is good for most use-cases and supports image input.claude-opus-4-1-20250805model is their best model.claude-3-5-haiku-20241022model is their fastest model.
Claude API expects a
max_tokens param to be sent with each request. Unless
set as a param, Agno will default to 8192. See the
docs for more information.Authentication
Set yourANTHROPIC_API_KEY environment. You can get one from Anthropic here.
Example
UseClaude with your Agent:
Beta Features
You can use Anthropic’s beta features with Agno by setting thebetas parameter:
Claude model here.
Prompt caching
You can enable system prompt caching by settingcache_system_prompt to True:
Claude model here.
Structured Outputs
Structured outputs are used to ensure that the model’s response matches a defined schema. This is useful to eliminate issues like missing fields or invalid values. Use it for production systems that need reliable, consistent responses in a specific format. Agno uses Claude’s native support for structured outputs. This feature is available forclaude-sonnet-4-5-20250929 and all newer models. See Anthropic’s structured outputs documentation for more details.
Claude model:
Params
Claude is a subclass of the Model class and has access to the same params.