Rate Limits
How Yunxin rate limiting works — tiers, headers, 429 responses, and retry strategy.
Overview
Rate limits keep the platform fast and fair for everyone. The primary limit is requests per minute (RPM), enforced in a sliding window and shared across all servers. Limits are resolved in this order, most specific first:
- Per-API-key limit — a custom limit you set on an individual key (Dashboard → API Keys).
- Tier limit — your account tier's RPM, applied to AI-generation endpoints.
- Per-endpoint limit — protective limits on specific routes (see below).
- Global default — a baseline fallback.
Tier limits
| Tier | Requests / min |
|---|---|
| Free | 10 |
| Basic | 50 |
| Fellow | 100 |
| Pro | 100 |
| Enterprise | Custom (negotiated; effectively unlimited) |
Fellow is Yunxin's curated program tier — apply from the Fellows page. Each account also has a monthly token quota independent of the per-minute request limit.
Endpoint-specific limits
Some routes carry their own protective limits regardless of tier, for example:
| Endpoint | Limit |
|---|---|
POST /v1/chat/completions | 60 / min |
POST /v1/files | 20 / min |
POST /api/auth/login | 5 / min |
Health checks, the model list, and batch/collection management endpoints are excluded from rate limiting entirely.
Rate-limit headers
Responses include headers describing your current limit state:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1709251200
X-RateLimit-Resource: api_key
X-RateLimit-Used: 3
X-Request-Priority: 2
X-Concurrency-Remaining: 8| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window. |
X-RateLimit-Remaining | Requests remaining in the current window. |
X-RateLimit-Reset | Unix timestamp when the window resets. |
X-RateLimit-Resource | The scope the limit was applied at: ip, user, or api_key. |
X-RateLimit-Used | Requests already used in the current window. |
X-Request-Priority | Your priority level: 1 low, 2 normal, 3 high, 4 critical. |
X-Concurrency-Remaining | Remaining concurrent in-flight slots. |
When you're throttled
Exceeding a limit returns 429 Too Many Requests with a Retry-After header and this body:
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded: 60 requests per minute allowed. Please retry in 12 seconds.",
"retry_after": 12
}
}Retry strategy
Honor Retry-After (or error.retry_after) when present; otherwise back off exponentially with jitter:
import time, random
def call_with_retry(fn, max_retries=5):
for attempt in range(max_retries):
try:
return fn()
except Exception as e:
if "rate_limit" not in str(e).lower():
raise
wait = (2 ** attempt) + random.uniform(0, 1)
time.sleep(wait)
raise RuntimeError("Max retries exceeded")Staying under the limit
- Respect the headers. Watch
X-RateLimit-Remainingand slow down before you hit zero. - Use streaming. A streamed response is a single request regardless of output length.
- Batch offline work. For large non-interactive jobs, use the Batch API (also ~50% cheaper).
- Cache repeated prompts. Avoid re-requesting identical completions.
- Set per-key limits. Cap noisy services with a custom per-key limit so one client can't starve the rest.
- Monitor consumption. Track usage from the Dashboard or the Usage & Monitoring endpoints.
How is this guide?