Embed 5 and Rerank 5 are now live on OpenRouter. Here’s how to turn them into a working RAG pipeline in a few dozen lines of Python code through a single API.
There are Cohere’s most powerful retrieval models yet, delivering leading performance on enterprise documents and complex retrieval tasks. If you’re already using OpenRouter, you can get started immediately - using the same API key and credits as your existing models, with no additional setup.
RAG grounds an LLM's answer in your own data by fetching relevant chunks before it writes. Embedding search provides a fast and effective first-stage approximation. A reranker then reads the query and each candidate together, adding precision to what’s been retrieved.
Two features of the Cohere models shape this design:
- Embed 5 Pro and Fast share one embedding space. Index with
embed-5-profor quality, then query withembed-5-fastfor latency. - Rerank 5 scores are calibrated. A score means the same thing across queries and domains, so one relevance threshold can filter out weak context before it reaches the LLM.
By the end you'll have a short Python script that answers questions over your docs with scored citations. This same approach can be applied to virtually any retrieval use case, from enterprise search and customer support to knowledge management and document discovery.
A RAG pipeline has two halves: an offline job that builds a searchable index, and an online path that runs for every question. Knowing which calls happen once and which happen per request help explain most of the pipeline's cost and latency. Indexing runs once per corpus. Each question then costs one Embed 5 Fast call, one Rerank 5 call and one chat call, all through OpenRouter's API.
The post includes a short Python walkthrough using the OpenRouter SDK to index documents with Embed 5, query with Embed 5 Fast, rerank with Rerank 5, and generate cited answers.