ToolKiti

API Error Code Database

Structured reference of common API errors with causes, fixes, and curl examples. Built for AI agents and developers.

429OpenAI

Rate Limit Exceeded

Cause

Too many requests in a short period. OpenAI enforces RPM (requests per minute) and TPM (tokens per minute) limits.

Fix

Implement exponential backoff. Start with 1s delay, double each retry up to 60s. Check response header `x-ratelimit-reset-requests` for reset time.

curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $KEY" -d '{"model":"gpt-4o","messages":[{"role":"user","content":"hi"}]}'
401OpenAI

Invalid Authentication

Cause

API key is missing, expired, or invalid. The Authorization header format is wrong.

Fix

Verify Bearer token in header. Check key at platform.openai.com/api-keys. Regenerate if compromised.

curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
503OpenAI

Service Unavailable

Cause

OpenAI servers are overloaded or under maintenance. Temporary outage.

Fix

Retry with backoff. Monitor status.openai.com for incidents. Consider fallback to another provider (Anthropic, Gemini).

500OpenAI

Internal Server Error

Cause

Unexpected server-side error. Usually transient.

Fix

Retry request. If persists >5 min, check status page. Log the request ID from response headers for support.

400OpenAI

Bad Request

Cause

Malformed request body. Invalid JSON, missing required fields, or parameter out of range.

Fix

Validate JSON structure. Check max_tokens is within model limits. Ensure messages array is not empty.

429Anthropic

Rate Limited

Cause

Exceeded requests per minute. Anthropic has tiered rate limits.

Fix

Backoff with retry-after header value. Upgrade tier at console.anthropic.com for higher limits.

529Anthropic

Overloaded

Cause

Anthropic servers at capacity. Temporary overload condition.

Fix

Wait and retry. This is Anthropic's equivalent of 503. Exponential backoff recommended.

403Google Gemini

Permission Denied

Cause

API key lacks permission for the requested model or region.

Fix

Enable the API in Google Cloud Console. Check the model name is correct. Verify billing is set up.

429Google Gemini

Resource Exhausted

Cause

Quota exceeded. Free tier has strict limits.

Fix

Check quota at console.cloud.google.com/apis. Wait for quota reset or upgrade to paid tier.

402DeepSeek

Insufficient Balance

Cause

Account balance is zero or negative. Prepaid credits exhausted.

Fix

Top up at platform.deepseek.com. Check usage dashboard for consumption rate.

429Stripe

Too Many Requests

Cause

Exceeded Stripe API rate limit (100/sec in test mode, 25/sec in live).

Fix

Use idempotency keys for retries. Implement exponential backoff. Batch operations where possible.

401GitHub

Bad Credentials

Cause

Token is expired, revoked, or lacks required scopes.

Fix

Generate new token at github.com/settings/tokens. Check required scopes in API docs.

403GitHub

Resource Not Accessible

Cause

Token has insufficient permissions for this resource.

Fix

Add required scopes to token. Check organization access settings.

429Vercel

Rate Limited

Cause

Exceeded Vercel API rate limit (varies by plan).

Fix

Check x-ratelimit-remaining header. Backoff 1-60s. Upgrade plan for higher limits.

503Supabase

Database Unavailable

Cause

Project is paused (free tier) or database is restarting.

Fix

Go to app.supabase.com and unpause project. Wait for restart to complete (~30s).

← Back to ToolKiti