# ChatCohere

> **Class** in `langchain_cohere`

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

Implements the `BaseChatModel` (and `BaseLanguageModel`) interface with Cohere's
large language models.

Find out more about us at https://cohere.com and https://huggingface.co/CohereForAI

This implementation uses the Chat API - see https://docs.cohere.com/reference/chat

To use this you'll need to a Cohere API key - either pass it to cohere_api_key
parameter or set the `COHERE_API_KEY` environment variable.

API keys are available on https://cohere.com - it's free to sign up and trial API
keys work with this implementation.

## Signature

```python
ChatCohere()
```

## Description

**Basic Example:**

```python
from langchain_cohere import ChatCohere
from langchain_core.messages import HumanMessage

llm = ChatCohere(cohere_api_key="{API KEY}")

message = [HumanMessage(content="Hello, can you introduce yourself?")]

print(llm.invoke(message).content)
```

## Extends

- `BaseChatModel`
- `BaseCohere`

## Properties

- `preamble`
- `model_config`
- `model_name`

## Methods

- [`bind_tools()`](https://reference.langchain.com/python/langchain-cohere/chat_models/ChatCohere/bind_tools)
- [`with_structured_output()`](https://reference.langchain.com/python/langchain-cohere/chat_models/ChatCohere/with_structured_output)
- [`get_num_tokens()`](https://reference.langchain.com/python/langchain-cohere/chat_models/ChatCohere/get_num_tokens)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-cohere/blob/98e3d038d365eebd6dabcf8c4d94072580f7401d/libs/cohere/langchain_cohere/chat_models.py#L622)