cohere-rate-limits

Featured

Implement Cohere rate limiting, backoff, and request queuing patterns. Use when handling 429 errors, implementing retry logic, or optimizing API request throughput for Cohere. Trigger with phrases like "cohere rate limit", "cohere throttling", "cohere 429", "cohere retry", "cohere backoff".

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 Rate Limits ## Overview Handle Cohere rate limits with exponential backoff, request queuing, and proactive throttling. Real rate limits from Cohere's documentation. ## Prerequisites - `cohere-ai` SDK installed - Understanding of async/await patterns ## Actual Cohere Rate Limits | Key Type | Endpoint | Rate Limit | Monthly Limit | |----------|----------|-----------|---------------| | **Trial** | Chat | 20 calls/min | 1,000 total | | **Trial** | Embed | 5 calls/min | 1,000 total | | **Trial** | Rerank | 5 calls/min | 1,000 total | | **Trial** | Classify | 5 calls/min | 1,000 total | | **Production** | All endpoints | 1,000 calls/min | Unlimited | Trial keys are free. Production keys require billing at [dashboard.cohere.com](https://dashboard.cohere.com). ## Instructions ### Step 1: Exponential Backoff with Jitter ```typescript import { CohereError, CohereTimeoutError } from 'cohere-ai'; interface RetryConfig { maxRetries: number; baseDelayMs: number; maxDelayMs: number; } const DEFAULT_RETRY: RetryConfig = { maxRetries: 5, baseDelayMs: 1000, maxDelayMs: 60_000, }; async function withBackoff<T>( operation: () => Promise<T>, config = DEFAULT_RETRY ): Promise<T> { for (let attempt = 0; attempt <= config.maxRetries; attempt++) { try { return await operation(); } catch (err) { if (attempt === config.maxRetries) throw err; // Only retry on rate limits (429) and server errors (5xx) let shouldRetry = false; le...

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