# Cohere (https://www.librechat.ai/docs/configuration/librechat_yaml/ai_endpoints/cohere)

Cohere provides the Command family of models, used in LibreChat as a custom endpoint. Its API does not follow the OpenAI spec, so it relies on a compatibility layer that maps a subset of parameters.

## Get an API key

Create a key from the [Cohere dashboard](https://dashboard.cohere.com/). Add it to your `.env` file:

```bash filename=".env"
COHERE_API_KEY=your-api-key
```

## Configuration

Add the endpoint under `endpoints.custom` in your `librechat.yaml`:

```yaml filename="librechat.yaml"
    - name: "cohere"
      apiKey: "${COHERE_API_KEY}"
      baseURL: "https://api.cohere.ai/v1"
      models:
        default: ["command-r","command-r-plus","command-light","command-light-nightly","command","command-nightly"]
        fetch: false
      modelDisplayLabel: "cohere"
      titleModel: "command"
      dropParams: ["stop", "user", "frequency_penalty", "presence_penalty", "temperature", "top_p"]
```

## Notes

- Cohere does not follow the OpenAI spec. A compatibility layer maps a subset of OpenAI parameters to Cohere's equivalents: `stop` to `stopSequences`, `top_p` to `p`, `frequency_penalty` to `frequencyPenalty`, and `presence_penalty` to `presencePenalty` (each with different min/max ranges). `model` and `stream` are shared and sent by default; `max_tokens` maps to `maxTokens` but is not sent by default. The example above uses `dropParams` to remove most of these and fall back to Cohere's defaults.
- For the full list of Cohere-specific parameters, see the [Cohere API documentation](https://docs.cohere.com/reference/chat).
