Developer Reference

E2X API Documentation

Complete developer documentation for the E2X generative AI inference API: quickstart in cURL, TypeScript, Python & Go, Bearer authentication, async job lifecycle, webhooks, rate limits, and error codes.

Base URL & Response Format

All production API requests target the E2X API gateway over HTTPS at https://api.e2x.ai. Every authenticated and public endpoint exchanges UTF-8 JSON with a deterministic X-Request-ID header for end-to-end tracing.

JSONStandard Response Envelope
{
  "success": true,
  "data": {
    "jobId": "job_01J...",
    "status": "pending",
    "estimatedCompletionTime": 12,
    "costMicroCents": 60000
  },
  "requestId": "req_a91f4c82d0b3"
}

Micro-Cents Financial Precision

E2X prices and settles all inference workloads in integer micro-cents to eliminate IEEE 754 floating-point rounding drift: 1 USD = 1,000,000 microCents (1 cent = 10,000 microCents). For example, 60000 equals $0.060000.

Documentation Sections

Core Endpoints at a Glance

GET/health
Unauthenticated Public

Returns gateway readiness ({ status: 'ok', timestamp, service: 'e2x-api-gateway' }) without authentication.

POST/v1/jobs/estimate
Bearer Token Required

Calculates dynamic pricing in micro-cents before balance deduction (check_status permission).

POST/v1/jobs/submit
Bearer Token Required

Validates input schema, reserves cost atomically, and queues an asynchronous generation job (submit_job permission).

GET/v1/jobs/:jobId
Bearer Token Required

Fetches current job status (pending, processing, completed, failed, cancelled), progress percentage, outputs, and billing.

POST/v1/uploads/presign
Bearer Token Required

Issues a 15-minute signed PUT upload URL for temporary image or video inputs hosted on assets.e2x.ai.

GET/v1/catalog/models
Unauthenticated Public

Lists active catalog models, 3-part slugs, schemas, and pricing without requiring an API key.

Request & Payload Conventions

PropertyBehavior
AuthorizationAll authenticated routes expect Authorization: Bearer <API_KEY>. Alternative key headers are not accepted.
JSON Body CapMaximum request body size is 16 MB; larger media inputs should use POST /v1/uploads/presign.
Enum CoercionString enums in input payloads are normalized case-insensitively before AJV schema validation (for example, "1K" matches "1k").
Batch OutputsEach job request accepts up to 16 generations. Failed partial outputs trigger automatic proportional refunds.