| name | cohere-common-errors |
| description | Diagnose and fix Cohere API v2 errors and exceptions.
Use when encountering Cohere errors, debugging failed requests,
or troubleshooting CohereError, CohereTimeoutError, rate limits.
Trigger with phrases like "cohere error", "fix cohere",
"cohere not working", "debug cohere", "cohere 429", "cohere 400".
|
| allowed-tools | Read, Grep, Bash(curl:*) |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","nlp","cohere"] |
| compatibility | Designed for Claude Code |
Cohere Common Errors
Overview
Quick reference for real Cohere API v2 errors with exact messages, causes, and fixes.
Prerequisites
cohere-ai SDK installed
CO_API_KEY configured
- Access to error logs
Error Reference
400 — Bad Request: Missing Required Field
CohereError: model is required
Cause: API v2 requires model for all endpoints (Chat, Embed, Rerank, Classify).
Fix:
await cohere.chat({ messages: [...] });
await cohere.chat({ model: 'command-a-03-2025', messages: [...] });
400 — Embed: Missing embedding_types
CohereError: embedding_types is required for embed models v3 and higher
Fix:
await cohere.embed({
model: 'embed-v4.0',
texts: ['hello'],
inputType: 'search_document',
embeddingTypes: ['float'],
});
400 — Embed: Missing input_type
CohereError: input_type is required for embed models v3 and higher
Fix: Use one of: search_document, search_query, classification, clustering, image.
401 — Invalid API Token
CohereError: invalid api token
Cause: CO_API_KEY is missing, wrong, or revoked.