Skip to content
Skillv1.0.0

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 phrase

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/cohere-install-auth/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill cohere-install-auth. Copyright stays with the author (MIT).

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) or cohere (Python) package
  • Environment variable CO_API_KEY configured
  • 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

Examples

Use a local secret store or CI secret injection, then fail fast before issuing a request if the key was not supplied. The check prevents an accidental unauthenticated request while keeping the credential out of source control and logs.

import { CohereClientV2 } from 'cohere-ai';

const token = process.env.CO_API_KEY;
if (!token) throw new Error('CO_API_KEY is required; configure it in the secret manager');

const client = new CohereClientV2({ token });
const result = await client.chat({
  model: 'command-r7b-12-2024',
  messages: [{ role: 'user', content: 'Reply with OK.' }],
  maxTokens: 5,
});
console.log(result.message?.content?.[0]?.text);

For a CI verification, inject CO_API_KEY only into the trusted job that needs it, mask it in the runner, and rotate it immediately if it appears in an artifact or log.

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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-cohere-install-auth/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-cohere-install-auth.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-cohere-install-auth",
  "kind": "skill",
  "name": "cohere-install-auth",
  "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\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "saas",
      "ai",
      "nlp",
      "cohere",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/cohere-install-auth/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/cohere-install-auth/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/cohere-install-auth/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*),",
      "Bash(pip:*),",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Cohere Install & Auth\n\n## Overview\n\nSet up the Cohere SDK (v2) and configure authentication for Chat, Embed, Rerank, and Classify endpoints.\n\n## Prerequisites\n\n- Node.js 18+ or Python 3.10+\n- Package manager (npm, pnpm, or pip)\n- Cohere account at [dashboard.cohere.com](https://dashboard.cohere.com)\n- API key from Cohere dashboard (trial keys are free, production keys require billing)\n\n## Instructions\n\n### Step 1: Install SDK\n\n```bash\n# Node.js / TypeScript\nnpm install cohere-ai\n\n# Python\npip install cohere\n```\n\n### Step 2: Configure API Key\n\n```bash\n# Set environment variable\nexport CO_API_",
  "cost": {
    "context_tokens": 1088
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-cohere-install-auth/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.