cohere-common-errors

Featured

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".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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:** ```typescript // Wrong (v1 style) await cohere.chat({ messages: [...] }); // Correct (v2) 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:** ```typescript await cohere.embed({ model: 'embed-v4.0', texts: ['hello'], inputType: 'search_document', embeddingTypes: ['float'], // Required for v3+ }); ``` --- ### 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. **Fix:** ```bash # Verify key is set echo $CO_API_KEY # Test directly curl -H "Authorization: Bearer $CO_API_KEY" \ https://api.cohere.com/v2/chat \ -H "Content-Type: application/json" \ -d '{"model":"command-r7b-12-2024","messages":[{"role":"user","conten...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category