mistral-rate-limits

Featured

Implement Mistral AI rate limiting, backoff, and request management. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for Mistral AI. Trigger with phrases like "mistral rate limit", "mistral throttling", "mistral 429", "mistral retry", "mistral 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

# Mistral Rate Limits ## Overview Rate limit management for Mistral AI API. Mistral enforces per-workspace RPM (requests/minute) and TPM (tokens/minute) limits that vary by usage tier (Experiment free tier vs Scale pay-as-you-go). View your workspace limits at [admin.mistral.ai/plateforme/limits](https://admin.mistral.ai/plateforme/limits). ## Prerequisites - Mistral API key configured - Understanding of workspace tier (Experiment vs Scale) - Application with retry infrastructure ## Mistral Rate Limit Architecture Limits are set at the **workspace** level, not per key. All API keys in a workspace share the same RPM/TPM budget. | Endpoint | What's limited | |----------|---------------| | `/v1/chat/completions` | RPM + TPM (input + output) | | `/v1/embeddings` | RPM + TPM (input only) | | `/v1/fim/completions` | RPM + TPM | | `/v1/moderations` | RPM | **Headers returned on every response:** - `x-ratelimit-limit-requests` — your RPM cap - `x-ratelimit-remaining-requests` — remaining RPM - `x-ratelimit-limit-tokens` — your TPM cap - `x-ratelimit-remaining-tokens` — remaining TPM - `Retry-After` — seconds to wait (on 429 only) ## Instructions ### Step 1: Token-Aware Rate Limiter ```typescript class MistralRateLimiter { private requestTimes: number[] = []; private tokenBuckets: Array<{ time: number; tokens: number }> = []; private readonly rpm: number; private readonly tpm: number; constructor(rpm: number, tpm: number) { this.rpm = rpm; this.tpm = tpm; ...

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