canonical: https://jentic.com/apis/cohere.com/cohere

# Cohere API

Jentic publishes the only available OpenAPI specification for Cohere API, keeping it validated and agent-ready. Generate text with conversational chat models, produce vector embeddings for semantic search and RAG pipelines, and rerank search results for relevance using 4 focused endpoints. The v2 API supports streaming responses, tool use in chat, and configurable embedding input types for document indexing versus search queries.

## For AI agents

Generate text responses with Cohere's Command models, create embeddings for semantic search, and rerank document lists by relevance. Supports tool use and streaming for agent workflows.

## Scope

Does not handle vector storage, image generation, or audio processing - use for text generation, embeddings, and reranking only.

## Capabilities

- Generate multi-turn chat responses with tool use and citation grounding
- Produce vector embeddings optimized for either document storage or query matching
- Rerank a list of documents by relevance to a given query
- Stream partial chat responses token-by-token for real-time display
- Configure embedding input types to distinguish indexing from retrieval contexts

## Use cases

### AI Agent RAG with Jentic Discovery

AI agents discover Cohere's embed and rerank endpoints through Jentic's intent-based search to build retrieval-augmented generation pipelines. Agents generate embeddings with input_type set to 'search_document' for indexing, then use 'search_query' at retrieval time and rerank candidates for final relevance scoring. The entire flow - embed, retrieve, rerank, generate - runs through Jentic without manual SDK configuration.

Example prompt: Search Jentic for 'rerank documents by relevance', load the POST /v2/rerank schema, and execute with a query and 20 candidate documents to get relevance scores

### Semantic Search Embeddings

Generate high-dimensional vector embeddings using POST /v2/embed for semantic search, clustering, and classification. Cohere's embed models support configurable input_type parameters - use 'search_document' when indexing and 'search_query' when searching - which optimizes vector quality for asymmetric retrieval. Processes batches of texts in a single call for efficient bulk embedding generation.

Example prompt: Generate embeddings for 50 document chunks via POST /v2/embed with model embed-english-v3.0 and input_type 'search_document'

### Conversational AI with Grounded Citations

Build conversational interfaces using POST /v2/chat that ground responses in provided documents and return inline citations. Cohere's Command models support multi-turn context, connectors for real-time document retrieval, and tool use for agent orchestration. Streaming mode delivers tokens incrementally for responsive user experiences.

Example prompt: Send a multi-turn conversation to POST /v2/chat with model command-r-plus, include 3 documents for grounding, and parse citation annotations from the response

### Search Result Reranking

Improve search precision by reranking candidate documents using POST /v2/rerank. Pass a query and a list of text documents, and receive relevance scores that reorder results by semantic match quality. Works with any upstream retrieval system - BM25, vector search, or hybrid - to boost the most relevant results to the top without re-indexing.

Example prompt: Rerank 25 candidate documents against a user query via POST /v2/rerank with model rerank-english-v3.0 and return the top 5 by relevance score

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v2/chat | Generate chat responses with tool use and citations |
| POST | /v2/embed | Create vector embeddings for text inputs |
| POST | /v2/rerank | Rerank documents by relevance to a query |
| POST | /v1/chat | Legacy chat endpoint (v1 compatibility) |

## Key resources

- **Chat** — Multi-turn text generation with grounding, citations, and tool use
- **Embed** — Vector embedding generation with configurable input types for search vs storage
- **Rerank** — Document relevance scoring and reordering for search result improvement

## Why Jentic

- **Setup:** Wiring the Cohere API by hand means building its Bearer header, targeting api.cohere.com, and picking the right chat, embed, or rerank endpoint with its model and input_type options yourself. Through Jentic you install once, import the Cohere API from the API Directory, store the Bearer token once, and your agent calls it.
- **Permission scoping:** Cohere takes its target in the request body (the model and inputs for /v2/chat, /v2/embed, and /v2/rerank) rather than a resource id in the URL path, so scope the agent by operations: limit it to the operations it needs, such as chat completion, embedding, or reranking. The operations you allow are the only ones that run.
- **Credential handling:** Your Cohere token is stored once, encrypted, by your own Jentic One instance and injected at execution time as the Bearer token. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'rerank documents by relevance' or 'embed text for search', and Jentic returns the matching Cohere operation with its input schema, including input_type and model options, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **OpenAI API** — Broader model ecosystem with GPT-4o, DALL-E, Whisper, and 126 endpoints
- **Mistral AI API** — Open-weight European LLM with competitive pricing
- **Pinecone API** — Vector database for storing and querying Cohere embeddings at scale

## FAQ

### Why is there no official OpenAPI spec for Cohere API?

Cohere does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Cohere API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Cohere API use?

The Cohere API uses Bearer token authentication. You pass your API key in the Authorization header as 'Bearer {your-api-key}'. Through Jentic, your Cohere API key is stored encrypted in your Jentic One instance and agents receive scoped access tokens without exposing the raw key.

### Can I rerank search results with the Cohere API?

Yes. The POST /v2/rerank endpoint accepts a query and a list of documents, returning relevance scores for each. Use the rerank-english-v3.0 model for English content or rerank-multilingual-v3.0 for other languages. Pass up to 1000 documents per request with a configurable top_n parameter to limit results.

### What are the rate limits for the Cohere API?

Rate limits depend on your plan tier. The Production tier allows 10,000 API calls per minute. Trial keys are limited to 20 requests per minute and 1000 per month. The API returns 429 status codes when limits are exceeded, with Retry-After headers indicating when to retry.

### How do I generate embeddings for a RAG pipeline through Jentic?

Search Jentic for 'create text embeddings for search' to discover the POST /v2/embed operation. Set input_type to 'search_document' when indexing your corpus and 'search_query' when embedding user queries. This asymmetric configuration optimizes retrieval quality. Install with pip install jentic and use the search-load-execute flow.

### What is the difference between input_type 'search_document' and 'search_query'?

The POST /v2/embed endpoint's input_type parameter tells the model whether you are embedding documents for storage or queries for retrieval. Use 'search_document' when indexing your corpus to optimize vectors for being found. Use 'search_query' when embedding a user's question to optimize for finding relevant documents. This asymmetric approach improves retrieval accuracy compared to using the same type for both.

### Can I limit what my agent is allowed to do with the Cohere API?

Yes. Because Jentic One is self-hosted, you set the rules that decide which Cohere operations your agent may call, and the operations you allow are the only ones that run. The Cohere API selects its target in the request body rather than a resource id in the URL, so you scope the agent by operation: allow only what it needs, such as chat completion via POST /v2/chat, embedding via POST /v2/embed, or reranking via POST /v2/rerank. Your Bearer token stays encrypted in your own instance and is injected only when an allowed operation executes.
