Error Code Dictionary
This document lists all Real200 API error codes, their triggers, and solutions.
Error Formatâ
{
"error": {
"message": "Error description",
"type": "error_type",
"code": "error_code",
"param": "related_parameter (if applicable)"
}
}
4xx Client Errorsâ
400 Bad Request â invalid_request_errorâ
Cause: Request parameters do not conform to API specifications.
Common scenarios:
modelparameter is empty or missingmessagesis an empty arraytemperatureout of range (0â2)- Incorrect JSON format
401 Unauthorized â invalid_api_keyâ
Cause: API Key is invalid or authentication failed.
Solution:
- Confirm API Key starts with
sk-real200- - Confirm
Authorization: Bearer <key>format is correct - Check Key status in console
402 Payment Required â insufficient_quotaâ
Cause: Insufficient account balance or Key quota exhausted.
Solution:
- Top up account
- Check and increase Key quota limit
429 Too Many Requests â rate_limit_exceededâ
Cause: Request frequency exceeds limits.
Retry Strategy:
import time
from openai import OpenAI
client = OpenAI(api_key="sk-real200-xxx", base_url="https://real200.com/v1")
for attempt in range(3):
try:
response = client.chat.completions.create(model="gpt-4o", messages=[...])
break
except Exception as e:
if "429" in str(e):
wait = 2 ** attempt # Exponential backoff: 2s, 4s, 8s
time.sleep(wait)
else:
raise
5xx Server Errorsâ
500 Internal Server Error â api_errorâ
Cause: Real200 server internal error.
Solution: Wait and retry. Smart routing will automatically switch to other providers.
502 Bad Gateway â bad_gatewayâ
Cause: Provider returned invalid response.
Solution: Usually auto-recovers. Smart routing automatically switches to backup providers.