Advanced
Error Handling & Rate Limits
Your plan defines request limits across three rolling windows:
Base URL & authentication
Base URL: https://api.openadapter.in
All requests need an Authorization: Bearer sk-cv-... header. Generate or copy your API key from the Dashboard → API Keys page.
Rate Limits
Your plan defines request limits across three rolling windows:
- 5-hour window — short-term burst limit
- Weekly window — medium-term usage cap
- Monthly window — overall quota
Windows reset automatically on a rolling basis. Check your current usage on the Usage page. When a limit is reached, the API returns 429 Too Many Requests with a message showing which window was exceeded.
Error Codes
| Status | Description |
|---|---|
401 | Invalid or missing API key |
403 | Account inactive or unauthorized |
429 | Rate limit exceeded (check response body for which window) |
502 | All upstream providers failed (the gateway retried automatically) |
503 | Service temporarily unavailable |
Example Error Response
{
"error": {
"message": "Rate limit exceeded: monthly window (1500/1500 requests used)",
"type": "rate_limit_error",
"code": 429
}
}Handling Errors
import openai
try:
response = client.chat.completions.create(
model="glm-4.7",
messages=[{"role": "user", "content": "Hello!"}]
)
except openai.RateLimitError as e:
print(f"Rate limited: {e}")
# Wait and retry, or check your Usage page
except openai.AuthenticationError as e:
print(f"Auth error: {e}")
# Check your API key
except openai.APIError as e:
print(f"API error: {e}")
# Transient error — safe to retryAvailable Endpoints
GET https://api.openadapter.in/v1/models List available models
GET https://api.openadapter.in/v1/models/:id Get model details
POST https://api.openadapter.in/v1/chat/completions Chat (OpenAI format)
POST https://api.openadapter.in/v1/messages Chat (Anthropic format)
POST https://api.openadapter.in/v1/images/generations Generate images
POST https://api.openadapter.in/v1/audio/transcriptions Transcribe audio
POST https://api.openadapter.in/v1/audio/speech Text-to-speech
POST https://api.openadapter.in/v1/tools/* Web tools (search, scrape, crawl)