cohere-install-auth
Install and configure Cohere SDK authentication with API v2. Use when setting up a new Cohere integration, configuring API keys, or initializing the CohereClientV2 in your project. Trigger with phrases like "install cohere", "setup cohere", "cohere auth", "configure cohere API key".
- License 许可
- MIT
- 最近更新
- 2026-07-13
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- cohere-install-auth
- tags
- [ "saas", "ai", "nlp", "cohere" ]
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Install and configure Cohere SDK authentication with API v2. Use when setting up a new Cohere integration, configuring API keys, or initializing the CohereClientV2 in your project. Trigger with phrases like "install cohere", "setup cohere", "cohere auth", "configure cohere API key".
- allowed-tools
- Read, Write, Edit, Bash(npm:*), Bash(pip:*), Grep
- compatible-with
- claude-code
03 SKILL.md 正文
Cohere Install & Auth
Overview
Set up the Cohere SDK (v2) and configure authentication for Chat, Embed, Rerank, and Classify endpoints.
Prerequisites
- Node.js 18+ or Python 3.10+
- Package manager (npm, pnpm, or pip)
- Cohere account at dashboard.cohere.com
- API key from Cohere dashboard (trial keys are free, production keys require billing)
Instructions
Step 1: Install SDK
# Node.js / TypeScript
npm install cohere-ai
# Python
pip install cohere
Step 2: Configure API Key
# Set environment variable
export CO_API_KEY="your-api-key-here"
# Or create .env file (add .env to .gitignore!)
echo 'CO_API_KEY=your-api-key-here' >> .env
Key types:
- Trial key — free, rate-limited (5-20 calls/min per endpoint, 1000/month others)
- Production key — metered billing, 1000 calls/min all endpoints, unlimited monthly
Step 3: Verify Connection (TypeScript)
import { CohereClientV2 } from 'cohere-ai';
const cohere = new CohereClientV2({
token: process.env.CO_API_KEY,
});
async function verify() {
const response = await cohere.chat({
model: 'command-a-03-2025',
messages: [
{ role: 'user', content: 'Say "connection verified" and nothing else.' },
],
});
console.log('Status:', response.message?.content?.[0]?.text);
}
verify().catch(console.error);
Step 4: Verify Connection (Python)
import cohere
import os
co = cohere.ClientV2(api_key=os.environ.get("CO_API_KEY"))
response = co.chat(
model="command-a-03-2025",
messages=[
{"role": "user", "content": "Say 'connection verified' and nothing else."}
],
)
print("Status:", response.message.content[0].text)
Available Models
| Model | ID | Context | Best For |
|---|---|---|---|
| Command A | command-a-03-2025 |
256K | Latest, most capable |
| Command R+ | command-r-plus-08-2024 |
128K | Complex RAG, agents |
| Command R | command-r-08-2024 |
128K | RAG, cost-effective |
| Command R7B | command-r7b-12-2024 |
128K | Fast, lightweight |
| Embed English v4 | embed-v4.0 |
128K | Embeddings (EN) |
| Embed Multilingual v3 | embed-multilingual-v3.0 |
512 | Embeddings (100+ langs) |
| Rerank v3.5 | rerank-v3.5 |
4K | Search reranking |
Output
- Installed
cohere-ai(TS) orcohere(Python) package - Environment variable
CO_API_KEYconfigured - Verified API connectivity with a chat completion
Error Handling
| Error | Cause | Solution |
|---|---|---|
CohereApiError: invalid api token |
Wrong or expired key | Regenerate at dashboard.cohere.com |
CohereConnectionError |
Network blocked | Ensure HTTPS to api.cohere.com allowed |
429 Too Many Requests |
Trial rate limit hit | Wait 60s or upgrade to production key |
MODULE_NOT_FOUND cohere-ai |
Package not installed | Run npm install cohere-ai |
SDK Auto-Detection
The SDK reads CO_API_KEY automatically if set. You can skip the token param:
// Auto-reads CO_API_KEY from environment
const cohere = new CohereClientV2();
Resources
Next Steps
After successful auth, proceed to cohere-hello-world for your first real API call.
04 同仓库更多 Skills
zustand-store-creator
Create zustand store creator operations. Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like "zustand store creator", "zustand creator", "zustand".
zero-trust-config-helper
Configure with zero trust config helper operations. Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like "zero trust config helper", "zero helper", "zero".
zapier-integration-helper
Assist with zapier integration helper operations. Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like "zapier integration helper", "zapier helper", "zapier".
yaml-config-validator
Validate yaml config validator operations. Auto-activating skill for DevOps Basics. Triggers on: yaml config validator, yaml config validator Part of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like "yaml config validator", "yaml validator", "yaml".
xvary-stock-research
Thesis-driven equity analysis from public SEC EDGAR and market data; /analyze, /score, /compare workflows with bundled Python tools (Claude Code, Cursor, Codex).
xss-vulnerability-scanner
Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals. Triggers on: xss vulnerability scanner, xss vulnerability scanner Part of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like "xss vulnerability scanner", "xss scanner", "xss".