Skip to main content

Base URL

All API requests should be made to:
https://api.eggapi.ai

Authentication

Egg API uses Bearer token authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
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/json header for POST requests
  • Include the Authorization header with your API key

Response Format

All responses follow a consistent format:

Success Response

{
  "data": {
    // Response data here
  },
  "error": null
}

Error Response

{
  "data": null,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "prompt is required"
  }
}

HTTP Status Codes

Status CodeDescription
200Success
202Accepted (async task created)
400Bad Request / Validation Error
401Unauthorized (invalid API key)
403Forbidden (insufficient balance)
404Not Found
429Rate Limited
500Internal Server Error

Error Codes

CodeDescription
VALIDATION_ERRORRequest parameters are invalid
UNAUTHORIZEDAPI key is missing or invalid
INSUFFICIENT_BALANCEAccount balance is too low
NOT_FOUNDRequested resource doesn’t exist
RATE_LIMITEDToo many requests
INTERNAL_ERRORServer error
UPSTREAM_ERRORProvider error

Rate Limits

  • Per IP: 100 requests per second
  • Per API Key: Varies by plan
When rate limited, you’ll receive a 429 status code with the RATE_LIMITED error code.

Pagination

List endpoints support pagination with the following query parameters:
ParameterDefaultMaxDescription
page1-Page number
per_page20100Items per page
Paginated responses include:
{
  "data": {
    "items": [...],
    "pagination": {
      "page": 1,
      "per_page": 20,
      "total": 100,
      "total_pages": 5
    }
  }
}

Available Endpoints