Skip to main content

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:

  • model parameter is empty or missing
  • messages is an empty array
  • temperature out of range (0–2)
  • Incorrect JSON format

401 Unauthorized — invalid_api_key​

Cause: API Key is invalid or authentication failed.

Solution:

  1. Confirm API Key starts with sk-real200-
  2. Confirm Authorization: Bearer <key> format is correct
  3. Check Key status in console

402 Payment Required — insufficient_quota​

Cause: Insufficient account balance or Key quota exhausted.

Solution:

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.