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.
{
"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
Quickstart
Generate an API key, run your first image generation job, and read results in cURL, TypeScript, Python, or Go.
Authentication
Use Bearer API keys (e2x_live_*), restrict operations and models per key, configure exact IP whitelists, and rotate keys.
Jobs & Lifecycle
Estimate pricing, submit jobs, poll status or list history with cursors, cancel pending jobs, and upload media via presigned URLs.
Webhooks
Receive signed terminal callbacks, verify X-E2X-Timestamp and X-E2X-Signature headers, and handle 5-attempt exponential retries.
Errors & Codes
Inspect the JSON error envelope, trace requests with X-Request-ID, and handle every documented HTTP status and error code.
Rate Limits
Understand per-key limits, account tiers (free, pro, enterprise), active job concurrency caps, and Retry-After handling.
Models & Catalog
Query public unauthenticated catalog endpoints, inspect version pricing factors, and discover 3-part model slugs.
Official SDKs
Install zero-drift TypeScript (@e2x/sdk), Python (e2x), and Go (github.com/e2xai/e2x-go) libraries from GitHub and registries.
Core Endpoints at a Glance
/healthReturns gateway readiness ({ status: 'ok', timestamp, service: 'e2x-api-gateway' }) without authentication.
/v1/jobs/estimateCalculates dynamic pricing in micro-cents before balance deduction (check_status permission).
/v1/jobs/submitValidates input schema, reserves cost atomically, and queues an asynchronous generation job (submit_job permission).
/v1/jobs/:jobIdFetches current job status (pending, processing, completed, failed, cancelled), progress percentage, outputs, and billing.
/v1/uploads/presignIssues a 15-minute signed PUT upload URL for temporary image or video inputs hosted on assets.e2x.ai.
/v1/catalog/modelsLists active catalog models, 3-part slugs, schemas, and pricing without requiring an API key.
Request & Payload Conventions
| Property | Behavior |
|---|---|
Authorization | All authenticated routes expect Authorization: Bearer <API_KEY>. Alternative key headers are not accepted. |
JSON Body Cap | Maximum request body size is 16 MB; larger media inputs should use POST /v1/uploads/presign. |
Enum Coercion | String enums in input payloads are normalized case-insensitively before AJV schema validation (for example, "1K" matches "1k"). |
Batch Outputs | Each job request accepts up to 16 generations. Failed partial outputs trigger automatic proportional refunds. |