Base URL
All API requests should be made to:Authentication
Egg API uses Bearer token authentication. Include your API key in theAuthorization header:
Get your API key from the dashboard. Keep it secure and never expose it in client-side code.
Request Format
All requests should:- Use HTTPS
- Include
Content-Type: application/jsonheader for POST requests - Include the
Authorizationheader with your API key
Response Format
All responses follow a consistent format:Success Response
Error Response
HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 202 | Accepted (async task created) |
| 400 | Bad Request / Validation Error |
| 401 | Unauthorized (invalid API key) |
| 403 | Forbidden (insufficient balance) |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Internal Server Error |
Error Codes
| Code | Description |
|---|---|
VALIDATION_ERROR | Request parameters are invalid |
UNAUTHORIZED | API key is missing or invalid |
INSUFFICIENT_BALANCE | Account balance is too low |
NOT_FOUND | Requested resource doesn’t exist |
RATE_LIMITED | Too many requests |
INTERNAL_ERROR | Server error |
UPSTREAM_ERROR | Provider error |
Rate Limits
- Per IP: 100 requests per second
- Per API Key: Varies by plan
429 status code with the RATE_LIMITED error code.
Pagination
List endpoints support pagination with the following query parameters:| Parameter | Default | Max | Description |
|---|---|---|---|
page | 1 | - | Page number |
per_page | 20 | 100 | Items per page |