> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude

> Configure the Claude model class, Agno's wrapper for Anthropic's Messages API.

The Claude model provides access to Anthropic's Claude models.

## Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"claude-sonnet-4-5-20250929"` | The id of the Anthropic Claude model to use |
| `name` | `str` | `"Claude"` | The name of the model |
| `provider` | `str` | `"Anthropic"` | The provider of the model |
| `max_tokens` | `Optional[int]` | `8192` | Maximum number of tokens to generate in the chat completion |
| `thinking` | `Optional[Dict[str, Any]]` | `None` | Configuration for the thinking (reasoning) process |
| `output_config` | `Optional[Dict[str, Any]]` | `None` | Output configuration sent as the `output_config` request parameter |
| `temperature` | `Optional[float]` | `None` | Controls randomness in the model's output |
| `stop_sequences` | `Optional[List[str]]` | `None` | A list of strings that the model should stop generating text at |
| `top_p` | `Optional[float]` | `None` | Controls diversity via nucleus sampling |
| `top_k` | `Optional[int]` | `None` | Controls diversity via top-k sampling |
| `cache_system_prompt` | `Optional[bool]` | `False` | Whether to cache the system prompt for improved performance |
| `extended_cache_time` | `Optional[bool]` | `False` | Whether to use extended cache time (1 hour instead of default) |
| `cache_tools` | `bool` | `False` | Tag the last tool definition with cache control so tool definitions are cached |
| `system_prompt_blocks` | `Optional[Union[List[SystemPromptBlock], Callable[[], List[SystemPromptBlock]]]]` | `None` | Multi-block system prompt with per-block cache control, appended after the agent-built system message in the Anthropic `system` array. Callables are evaluated on every request, allowing dynamic per-request content in a cached system prompt |
| `request_params` | `Optional[Dict[str, Any]]` | `None` | Additional parameters to include in the request |
| `betas` | `Optional[List[str]]` | `None` | Anthropic beta flags enabling experimental or newly released features. Betas required for skills and structured outputs are added automatically |
| `context_management` | `Optional[Dict[str, Any]]` | `None` | Context management configuration sent as the `context_management` request parameter |
| `mcp_servers` | `Optional[List[MCPServerConfiguration]]` | `None` | List of MCP (Model Context Protocol) server configurations |
| `skills` | `Optional[List[Dict[str, str]]]` | `None` | Claude Agent Skills to enable, e.g. `[{"type": "anthropic", "skill_id": "pptx", "version": "latest"}]`. Adds the required beta flags automatically |
| `citations` | `bool` | `True` | Attach citations to document blocks. Suppressed automatically when structured output is active because Anthropic rejects citations together with `output_format` |
| `append_trailing_user_message` | `Optional[bool]` | `None` | Append a trailing user turn when the conversation ends with an assistant message. Defaults to True for models without prefill support (Claude 4.6+) |
| `trailing_user_message_content` | `str` | `"continue"` | Content of the appended trailing user message |
| `api_key` | `Optional[str]` | `None` | The API key for authenticating with Anthropic (defaults to ANTHROPIC\_API\_KEY env var) |
| `auth_token` | `Optional[str]` | `None` | Auth token for the Anthropic client. Falls back to the `ANTHROPIC_AUTH_TOKEN` environment variable |
| `default_headers` | `Optional[Dict[str, Any]]` | `None` | Default headers to include in all requests |
| `timeout` | `Optional[float]` | `None` | Request timeout in seconds |
| `http_client` | `Optional[Union[httpx.Client, httpx.AsyncClient]]` | `None` | Custom httpx client to use for requests |
| `client_params` | `Optional[Dict[str, Any]]` | `None` | Additional parameters for client configuration |
| `client` | `Optional[AnthropicClient]` | `None` | A pre-configured instance of the Anthropic client |
| `async_client` | `Optional[AsyncAnthropicClient]` | `None` | A pre-configured instance of the async Anthropic client |
| `model_type` | `ModelType` | `ModelType.MODEL` | Functional role of this model (`MODEL`, `OUTPUT_MODEL`, or `PARSER_MODEL`). Set by the agent during initialization |
| `supports_native_structured_outputs` | `bool` | `False` | Set to True automatically for Claude models that support native structured outputs |
| `supports_json_schema_outputs` | `bool` | `False` | True if the model requires a JSON schema for structured outputs |
| `system_prompt` | `Optional[str]` | `None` | System prompt from the model added to the Agent |
| `instructions` | `Optional[List[str]]` | `None` | Instructions from the model added to the Agent |
| `tool_message_role` | `str` | `"tool"` | Role used for tool messages |
| `assistant_message_role` | `str` | `"assistant"` | Role used for assistant messages |
| `cache_response` | `bool` | `False` | Cache model responses to avoid redundant API calls during development |
| `cache_ttl` | `Optional[int]` | `None` | Time-to-live for cached model responses, in seconds. If None, cache never expires |
| `cache_dir` | `Optional[str]` | `None` | Directory for cached model responses. If None, uses the default cache location |
| `retries` | `int` | `0` | Number of retries to attempt before raising a ModelProviderError |
| `delay_between_retries` | `int` | `1` | Delay between retries, in seconds |
| `exponential_backoff` | `bool` | `False` | If True, the delay between retries is doubled each time |
| `retry_with_guidance` | `bool` | `True` | Retry the model invocation with a guidance message for known errors avoidable with extra instructions |
| `retry_with_guidance_limit` | `int` | `1` | Number of times to retry the model invocation with guidance |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.