Skip to navigation

Using Cohere Models on OpenRouter

Cohere models are supported on OpenRouter, which provides a single API for models from many providers. You can use Cohere’s Command, Embed, Rerank, and North models through OpenRouter with an OpenRouter API key. Browse them on Cohere’s OpenRouter page.

Benefits

  • One API and API key: Use Cohere models alongside models from other providers, with one API key and one account for billing.
  • Easy switching: Move between models by changing the model parameter, without changing your integration.
  • Served by Cohere: Cohere is the provider for its models on OpenRouter, so OpenRouter forwards your requests to the Cohere API.

Latest additions: Embed 5 and Rerank 5

The latest Cohere models on OpenRouter are Embed 5 and Rerank 5, each available in Pro and Fast variants:

  • Embed 5 (cohere/embed-5-pro, cohere/embed-5-fast): Embeds text, images, and mixed text-and-image inputs such as PDF pages, with a 128k-token context window. Pro and Fast share an embedding space, so you can index with Pro and query with Fast.
  • Rerank 5 (cohere/rerank-5-pro, cohere/rerank-5-fast): Reranks text with calibrated relevance scores, with a 32,768-token context window for each query and document combined.

Available models

ModelOpenRouter model IDCohere API model ID
Embed 5 Procohere/embed-5-proembed-v5.0-pro
Embed 5 Fastcohere/embed-5-fastembed-v5.0-fast
Rerank 5 Procohere/rerank-5-prorerank-v5.0-pro
Rerank 5 Fastcohere/rerank-5-fastrerank-v5.0-fast
Rerank 4 Procohere/rerank-4-prorerank-v4.0-pro
Rerank 4 Fastcohere/rerank-4-fastrerank-v4.0-fast
Rerank v3.5cohere/rerank-v3.5rerank-v3.5
Command A+cohere/command-a-pluscommand-a-plus-05-2026
Command Acohere/command-acommand-a-03-2025
Command R+ (08-2024)cohere/command-r-plus-08-2024command-r-plus-08-2024
Command R (08-2024)cohere/command-r-08-2024command-r-08-2024
Command R7B (12-2024)cohere/command-r7b-12-2024command-r7b-12-2024
North Mini Codecohere/north-mini-code:freenorth-mini-code-1.0

For pricing, see each model’s OpenRouter page. For model details, see the models overview.

Setup checklist

  1. Create an OpenRouter account and an API key, and set the key as the OPENROUTER_API_KEY environment variable.
  2. Install the OpenRouter Python SDK with pip install openrouter (Python 3.10 or later; source on GitHub), or call OpenRouter’s HTTP API directly.
  3. Choose a model from the table above and pass its OpenRouter model ID as the model parameter. Each model’s OpenRouter page includes example requests.
  4. Call the API for the model type:
  5. To combine embeddings, reranking, and generation in one pipeline, follow OpenRouter’s RAG cookbook.

Differences from the Cohere API

OpenRouter’s APIs use OpenRouter’s request and response formats rather than Cohere’s, and support a subset of the Cohere API’s parameters:

  • Chat: OpenRouter’s chat API is OpenAI-compatible. Supported parameters vary by model; for example, tool use (tools) is available for Command A+, Command R+ (08-2024), Command R (08-2024), and North Mini Code, but not for Command A or Command R7B.
  • Embeddings: OpenRouter supports input, input_type, dimensions, and encoding_format (float or base64). Embeddings are returned in data[].embedding. To embed images, use OpenRouter’s multimodal input format. For int8 or binary embeddings, use the Cohere Embed API.
  • Rerank: OpenRouter supports query, documents, and top_n. Results are returned in results[], each with an index, relevance_score, and document. Context Focus (relevant_spans) isn’t part of OpenRouter’s Rerank API; to use it, call the Cohere Rerank API.