Installation
Python usage
Basic setup
Available models
- English models
- Multilingual models
Input types
Cohere models support different input types for optimized embeddings:Multilingual search
JavaScript usage
Configuration
string
required
Your Cohere API key
string
default:"embed-english-v3.0"
Cohere embedding model to use
string
Input type:
search_document, search_query, classification, or clusteringstring
Truncation strategy:
NONE, START, or ENDInput types explained
search_document
search_document
Use when indexing documents into your search system. Optimizes embeddings for being searched against.
search_query
search_query
Use when embedding search queries. Optimizes embeddings for finding relevant documents.
classification
classification
Use when using embeddings for classification tasks.
clustering
clustering
Use when performing clustering analysis on embeddings.
Supported languages
Cohere’s multilingual models support over 100 languages including:- European: English, Spanish, French, German, Italian, Portuguese, Russian, Polish, Dutch, Czech, etc.
- Asian: Chinese, Japanese, Korean, Hindi, Thai, Vietnamese, Indonesian, etc.
- Middle Eastern: Arabic, Hebrew, Turkish, Farsi, etc.
- Other: See Cohere’s language support documentation for the full list
Best practices
Use the right model
Use multilingual models only if you need multi-language support. English models are faster for English-only content.
Specify input types
Always specify
input_type for better embedding quality. Use search_document for indexing and search_query for queries.Batch efficiently
Cohere supports up to 96 texts per request. Batch your requests for better performance.
Monitor usage
Track your API usage through the Cohere dashboard.