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

# Cohere

> Use Cohere's Command models with Agno agents.

Pass a model ID from the [Cohere model catalog](https://docs.cohere.com/v2/docs/models) to `Cohere`. The default is `command-a-03-2025`.

## Installation

```bash theme={null}
uv pip install -U agno cohere
```

## Authentication

Set `CO_API_KEY`. Create a key in the [Cohere dashboard](https://dashboard.cohere.com/api-keys).

<CodeGroup>
  ```bash Mac theme={null}
  export CO_API_KEY=***
  ```

  ```bash Windows theme={null}
  setx CO_API_KEY ***
  ```
</CodeGroup>

## Example

Use `Cohere` with your `Agent`:

<CodeGroup>
  ```python agent.py theme={null}
  from agno.agent import Agent
  from agno.models.cohere import Cohere

  agent = Agent(
      model=Cohere(id="command-a-03-2025"),
      markdown=True
  )

  # Print the response in the terminal
  agent.print_response("Share a 2 sentence horror story.")

  ```
</CodeGroup>

## Params

| Parameter           | Type                                               | Default               | Description                                                                                                                           |
| ------------------- | -------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                | `str`                                              | `"command-a-03-2025"` | The specific model ID used for generating responses.                                                                                  |
| `name`              | `str`                                              | `"cohere"`            | The name identifier for the model.                                                                                                    |
| `provider`          | `str`                                              | `"Cohere"`            | The provider of the model.                                                                                                            |
| `temperature`       | `Optional[float]`                                  | `None`                | The sampling temperature to use, between 0 and 1. Higher values make the output more random.                                          |
| `max_tokens`        | `Optional[int]`                                    | `None`                | The maximum number of tokens to generate in the response.                                                                             |
| `top_k`             | `Optional[int]`                                    | `None`                | The number of highest probability vocabulary tokens to keep for top-k-filtering.                                                      |
| `top_p`             | `Optional[float]`                                  | `None`                | Nucleus sampling parameter. The model considers the results of the tokens with top\_p probability mass.                               |
| `frequency_penalty` | `Optional[float]`                                  | `None`                | Number between 0 and 1. Higher values reduce repetition based on each token's frequency.                                              |
| `presence_penalty`  | `Optional[float]`                                  | `None`                | Number between 0 and 1. Higher values reduce repetition based on whether a token has appeared.                                        |
| `seed`              | `Optional[int]`                                    | `None`                | Random seed for deterministic text generation.                                                                                        |
| `logprobs`          | `Optional[bool]`                                   | `None`                | Whether to return log probabilities of the output tokens.                                                                             |
| `request_params`    | `Optional[Dict[str, Any]]`                         | `None`                | Additional parameters to include in the request.                                                                                      |
| `strict_tools`      | `bool`                                             | `False`               | Whether to use strict mode for tools (enforce strict parameter requirements).                                                         |
| `add_chat_history`  | `bool`                                             | `False`               | Whether to add chat history to the Cohere messages instead of using the conversation\_id.                                             |
| `api_key`           | `Optional[str]`                                    | `None`                | The API key for authenticating requests to the Cohere service.                                                                        |
| `client_params`     | `Optional[Dict[str, Any]]`                         | `None`                | Additional parameters for client configuration.                                                                                       |
| `http_client`       | `Optional[Union[httpx.Client, httpx.AsyncClient]]` | `None`                | A custom httpx client to use for requests. Pass an `httpx.Client` for the sync client or an `httpx.AsyncClient` for the async client. |
| `client`            | `Optional[CohereClient]`                           | `None`                | A pre-configured instance of the Cohere client.                                                                                       |
| `async_client`      | `Optional[CohereAsyncClient]`                      | `None`                | A pre-configured instance of the async Cohere client.                                                                                 |

`Cohere` is a subclass of the [Model](/reference/models/model) class and has access to the same params.

## Developer Resources

* [Basic Cohere agent](/models/providers/native/cohere/usage/basic)
* [Cohere model catalog](https://docs.cohere.com/v2/docs/models)
* [Cohere rate limits](https://docs.cohere.com/v2/docs/rate-limits)
