# ChatAnthropic

> **Class** in `langchain_anthropic`

📖 [View in docs](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic)

Anthropic (Claude) chat models.

See the [LangChain docs for `ChatAnthropic`](https://docs.langchain.com/oss/python/integrations/chat/anthropic)
for tutorials, feature walkthroughs, and examples.

See the [Claude Platform docs](https://platform.claude.com/docs/en/about-claude/models/overview)
for a list of the latest models, their capabilities, and pricing.

## Signature

```python
ChatAnthropic()
```

## Description

**Example:**

```python
# pip install -U langchain-anthropic
# export ANTHROPIC_API_KEY="your-api-key"

from langchain_anthropic import ChatAnthropic

model = ChatAnthropic(
    model="claude-sonnet-4-5-20250929",
    # temperature=,
    # max_tokens=,
    # timeout=,
    # max_retries=,
    # base_url="...",
    # Refer to API reference for full list of parameters
)
```

**Note:**

Any param which is not explicitly supported will be passed directly to
[`Anthropic.messages.create(...)`](https://platform.claude.com/docs/en/api/python/messages/create)
each time to the model is invoked.

## Extends

- `BaseChatModel`

## Properties

- `model_config`
- `model`
- `max_tokens`
- `temperature`
- `top_k`
- `top_p`
- `default_request_timeout`
- `max_retries`
- `stop_sequences`
- `anthropic_api_url`
- `anthropic_api_key`
- `anthropic_proxy`
- `default_headers`
- `betas`
- `model_kwargs`
- `streaming`
- `stream_usage`
- `thinking`
- `effort`
- `mcp_servers`
- `context_management`
- `reuse_last_container`
- `inference_geo`
- `lc_secrets`

## Methods

- [`is_lc_serializable()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/is_lc_serializable)
- [`get_lc_namespace()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/get_lc_namespace)
- [`set_default_max_tokens()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/set_default_max_tokens)
- [`build_extra()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/build_extra)
- [`bind_tools()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/bind_tools)
- [`with_structured_output()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/with_structured_output)
- [`get_num_tokens_from_messages()`](https://reference.langchain.com/python/langchain-anthropic/chat_models/ChatAnthropic/get_num_tokens_from_messages)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/29134dc82dcb71fa693e57231bcc10f78a1b0c2b/libs/partners/anthropic/langchain_anthropic/chat_models.py#L766)