Skip to main content

Cohere

Cohere builds enterprise-grade language models including the Command family. AgentXchain connects via api_proxy using Cohere's OpenAI-compatible Chat API.

Which adapter?

api_proxy with provider: "openai" and a custom base_url.

Prerequisites

  • A Cohere API key — get one from dashboard.cohere.com
  • COHERE_API_KEY set in your environment
  • agentxchain CLI installed

Configuration

{
"runtimes": {
"cohere-dev": {
"type": "api_proxy",
"provider": "openai",
"model": "command-a-reasoning",
"auth_env": "COHERE_API_KEY",
"base_url": "https://api.cohere.com/compatibility/v1/chat/completions"
}
},
"roles": {
"dev": {
"runtime": "cohere-dev",
"mandate": "Implement features and fix bugs",
"authority": "proposed"
}
}
}

Available models

ModelBest for
command-a-reasoningComplex reasoning and code architecture
command-aGeneral-purpose coding
command-r-plusRetrieval-augmented tasks

Verify the connection

export COHERE_API_KEY="..."
agentxchain connector check

Gotchas

  • Compatibility endpoint: Cohere provides an OpenAI-compatible endpoint at /compatibility/v1/. Use this with provider: "openai".
  • Enterprise features: Cohere offers enterprise deployment options (VPC, on-premise). For these, update base_url to your deployment endpoint.
  • Cost rates: Supply operator-specific rates:
{
"budget": {
"cost_rates": {
"command-a-reasoning": { "input_per_million": 2.50, "output_per_million": 10.00 }
}
}
}