Developer Dashboard

Cohere Models

AvalAI provides access to Cohere's suite of models designed for enterprise use cases, including advanced chat, retrieval-augmented generation (RAG), embedding, and reranking capabilities.

Chat Models (Command Series)

Cohere's Command models are optimized for conversational AI and long-context tasks.

Command R+

Cohere's most powerful and scalable model, excelling at complex RAG and tool use tasks.

FeatureDetails
Model IDcommand-r-plus
Context window128,000 tokens
CapabilitiesChat, Advanced RAG, Tool Use (Function Calling), Multilingual
Input pricing$0.50 / 1M tokens
Output pricing$1.50 / 1M tokens
StrengthsState-of-the-art for RAG, complex workflows, enterprise-grade reliability
Best forDemanding RAG applications, multi-step tool use, complex business logic
python
response = client.chat.completions.create(
    model="command-r-plus",
    messages=[
        {
            "role": "user",
            "content": "Based on the provided documents [cite documents], summarize the key findings regarding market trends.",
        },
        # Add documents/citations as needed by Cohere's chat endpoint structure
    ],
    # Add tool definitions if using Tool Use
)
Responses API version This version uses `gpt-5.5` because `command-r-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.

Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
)

response = client.responses.create(
    model="gpt-5.5",
    input=[
        {
            "role": "user",
            "content": [
                {
                    "type": "input_text",
                    "text": "Based on the provided documents [cite documents], summarize the key findings regarding market trends.",
                },
                {"type": "input_file", "file_id": "file_abc123"},
            ],
        }
    ],
)

print(response.output_text)
  • messagesinput
  • system message → instructions or a developer item
  • choices[0].message.contentresponse.output_text
  • for tools and multimodal output, inspect response.output by item type.

Command R

A highly capable and scalable model balancing performance and cost for RAG and tool use.

FeatureDetails
Model IDcommand-r
Context window128,000 tokens
CapabilitiesChat, RAG, Tool Use (Function Calling), Multilingual
Input pricing$0.50 / 1M tokens (Note: Typically lower than R+, check Cohere pricing)
Output pricing$1.50 / 1M tokens (Note: Typically lower than R+, check Cohere pricing)
StrengthsStrong balance of performance and cost for RAG and tool use
Best forGeneral RAG applications, chatbots requiring citations, tool-enabled workflows
python
response = client.chat.completions.create(
    model="command-r",
    messages=[
        {"role": "user", "content": "What is Cohere's Command R model?"},
    ],
)
Responses API version This version uses `gpt-5.5` because `command-r` may not be enabled for `/v1/responses` in the current AvalAI model data.

Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
)

response = client.responses.create(
    model="gpt-5.5",
    instructions="You are a helpful assistant.",
    input="What is Cohere",
)

print(response.output_text)
  • messagesinput
  • system message → instructions or a developer item
  • choices[0].message.contentresponse.output_text
  • for tools and multimodal output, inspect response.output by item type.

Note: Older models like command and cohere.command-light might also be available with smaller context windows.

Rerank Models

Cohere's Rerank models improve the quality of search results for RAG systems by re-ordering documents based on relevance to the query.

Rerank v4.0 Pro

The highest-quality reranking model with 32,768-token context window—8x larger than v3.5.

FeatureDetails
Model IDcohere-rerank-v4.0-pro
Context Window32,768 tokens
Input typeQuery string, list of document texts/IDs
Output typeRe-ordered list of documents with relevance scores [0, 1]
Languages100+ languages supported
Pricing$0.0025 / query
StrengthsHighest accuracy, long document support, multilingual
Best forProduction RAG systems requiring maximum relevance accuracy
python
import requests

response = requests.post(
    "https://api.avalai.ir/v1/rerank",
    headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
    json={
        "model": "cohere-rerank-v4.0-pro",
        "query": "What is the capital of Canada?",
        "documents": [
            "Ottawa is the capital of Canada.",
            "Toronto is the largest city in Canada.",
        ],
        "top_n": 2,
    },
)

Rerank v4.0 Fast

A cost-effective reranking model optimized for high-throughput applications with minimal latency.

FeatureDetails
Model IDcohere-rerank-v4.0-fast
Context Window32,768 tokens
Input typeQuery string, list of document texts/IDs
Output typeRe-ordered list of documents with relevance scores [0, 1]
Languages100+ languages supported
Pricing$0.002 / query
StrengthsFast, cost-effective, good accuracy
Best forHigh-throughput applications with cost sensitivity
python
import requests

response = requests.post(
    "https://api.avalai.ir/v1/rerank",
    headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"},
    json={
        "model": "cohere-rerank-v4.0-fast",
        "query": "What is the capital of Canada?",
        "documents": [
            "Ottawa is the capital of Canada.",
            "Toronto is the largest city in Canada.",
        ],
        "top_n": 2,
    },
)

Rerank v3.5

The previous generation reranking model.

FeatureDetails
Model IDcohere.rerank-v3-5:0
Input typeQuery string, list of document texts/IDs
Output typeRe-ordered list of documents with relevance scores
Pricing$1.00 / 1,000 Search Units
StrengthsSignificantly improves search relevance for documents
Best forEnhancing RAG systems, semantic search applications
python
# Example using Cohere's SDK (AvalAI might use a compatible endpoint)
# results = co.rerank(query="What is the capital of Canada?", documents=docs, model="cohere.rerank-v3-5:0")

Embedding Models (Embed Series)

Cohere's Embed models generate high-quality text and (for v3 Multilingual) image embeddings for semantic search and other representation tasks.

Embed English v3

State-of-the-art English embedding model.

FeatureDetails
Model IDcohere.embed-english-v3.0
Dimensions1024
Max input tokens512
Input pricing$0.10 / 1M tokens
StrengthsTop performance on English embedding benchmarks
Best forSemantic search, clustering, classification (English)
python
response = client.embeddings.create(
    model="cohere.embed-english-v3.0",
    input=["Your text here", "Another piece of text"],
    input_type="search_document",  # Or: search_query, classification, clustering
)

Embed Multilingual v3

State-of-the-art multilingual embedding model, supporting 100+ languages and image inputs.

FeatureDetails
Model IDcohere.embed-multilingual-v3.0
Dimensions1024
Max input tokens512 (text)
Input pricing$0.10 / 1M tokens (text)
StrengthsHigh performance across many languages, supports text & image embeddings
Best forMultilingual semantic search, cross-modal search (text/image)
python
# Text Embedding
response = client.embeddings.create(
    model="cohere.embed-multilingual-v3.0",
    input=["Aquí está tu texto", "Ein weiterer Text"],
    input_type="search_document",
)

# Image Embedding requires specific handling, check cohere.AvalAI docs

Embed v4 (AWS)

Cohere's latest multimodal embedding model supporting text, images, and mixed content including PDFs. Features a massive 128k context window and flexible output dimensions. Served via AWS infrastructure.

FeatureDetails
Model IDcohere.embed-v4:0
ProviderAWS
Dimensions256, 512, 1024, or 1536 (default)
Max input tokens128,000 tokens
Input typesText, Images, Mixed texts/images (PDFs)
Text pricingContact for pricing
Image pricingContact for pricing
Similarity metricsCosine Similarity, Dot Product Similarity, Euclidean Distance
StrengthsMultimodal support, large context window, flexible dimensions
Best forDocument embeddings, PDF processing, multimodal search, RAG systems
python
# Text Embedding
response = client.embeddings.create(
    model="cohere.embed-v4:0",
    input=["Your text here", "Another piece of text"],
    encoding_format="float",
)

# You can also specify custom dimensions
response = client.embeddings.create(
    model="cohere.embed-v4:0",
    input=["Your text here"],
    dimensions=1024,  # Choose from 256, 512, 1024, or 1536
    encoding_format="float",
)

Embed v4 (Azure) - High Rate Limit

The same Cohere Embed v4 model served via Azure AI services infrastructure. Offers up to 30x higher rate limits compared to the AWS endpoint, ideal for high-throughput production workloads.

FeatureDetails
Model IDembed-v-4-0
ProviderAzure AI Services
Dimensions256, 512, 1024, or 1536 (default)
Max input tokens128,000 tokens
Input typesText, Images, Mixed texts/images (PDFs)
Text pricing$0.12 / 1M tokens
Image pricing$0.47 / 1M tokens
Similarity metricsCosine Similarity, Dot Product Similarity, Euclidean Distance
Rate limitsUp to 30x higher than AWS endpoint
StrengthsHigh throughput, enterprise-grade stability, identical quality
Best forHigh-throughput applications, production RAG systems, batch processing
python
# Text Embedding with high rate limits
response = client.embeddings.create(
    model="embed-v-4-0",
    input=["Your text here", "Another piece of text"],
    encoding_format="float",
)

# You can also specify custom dimensions
response = client.embeddings.create(
    model="embed-v-4-0",
    input=["Your text here"],
    dimensions=1024,  # Choose from 256, 512, 1024, or 1536
    encoding_format="float",
)

Note: Both cohere.embed-v4:0 (AWS) and embed-v-4-0 (Azure) produce identical embeddings. Choose based on your rate limit and throughput requirements.

Note: Light and v2 versions of embedding models might also be available.

Using Cohere Models via AvalAI

Access Cohere models using standard AvalAI API endpoints. Chat models use the OpenAI-compatible /chat/completions endpoint. Embedding and Rerank models may use /embeddings and potentially custom endpoints compatible with Cohere's API structure. Check AvalAI documentation for specifics on Rerank usage.

python
from openai import OpenAI

client = OpenAI(
    api_key="your-avalai-api-key",  # Replace with your actual API key
    base_url="https://api.avalai.ir/v1",  # AvalAI API endpoint
)

# Example using Command R+ Chat
response = client.chat.completions.create(
    model="cohere.command-r-plus",
    messages=[{"role": "user", "content": "What are Cohere's main product areas?"}],
)

# Example using Embed English v3
embed_response = client.embeddings.create(
    model="cohere.embed-english-v3.0", input=["This is a test sentence."]
)

print(response.choices[0].message.content)
# print(embed_response.data[0].embedding)
Responses API version This version uses `gpt-5.5` because `cohere.command-r-plus` may not be enabled for `/v1/responses` in the current AvalAI model data.

Use this version when the selected model supports /v1/responses. messages moves to input, and the final text is read from response.output_text.

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
)

response = client.responses.create(
    model="gpt-5.5",
    instructions="You are a helpful assistant.",
    input="What are Cohere",
)

print(response.output_text)
  • messagesinput
  • system message → instructions or a developer item
  • choices[0].message.contentresponse.output_text
  • for tools and multimodal output, inspect response.output by item type.