Core API
Authentication & API Keys
Authenticate requests to api.e2x.ai using Bearer API keys (e2x_live_*). Configure operation permissions, model allowlists, exact IP whitelists, expiration, rotation, and revocation.
Bearer Token Authentication
Every authenticated endpoint under /v1/* (except public catalog routes under /v1/catalog/* and /v1/deposit-packages) authenticates requests solely via the standard HTTP Authorization header:
curl "https://api.e2x.ai/v1/models" \
-H "Authorization: Bearer e2x_live_a1b2c3d4..."Supported Headers Only
E2X strictly requires Authorization: Bearer <API_KEY>. Custom headers such as X-API-Key or query string credentials are ignored and fail with 401 UNAUTHORIZED. Never expose live keys in client-side browser bundles or public repositories.
Key Format & Verification Lifecycle
API keys generated from the dashboard carry the e2x_live_ prefix followed by 64 hexadecimal characters. Raw keys are displayed once at creation or rotation time and stored on the server as SHA-256 hashes.
Validated keys are cached in Redis with a 5-minute TTL (300s). When a key is updated, rotated, or revoked in the dashboard, the backend immediately invalidates its cache entry.
Operation Scopes, Model Allowlists & IP Restrictions
| Control | Behavior & Defaults | Failure Code |
|---|---|---|
allowedOperations | Permits submit_job, check_status, and list_models. Leaving the list empty grants all operations. Newly created keys default to all three. | 403 OPERATION_NOT_ALLOWED |
modelIds | Optional allowlist restricting which models a key can submit jobs against. Empty list allows all active models. | 403 MODEL_NOT_ALLOWED |
ipWhitelist | Up to 20 exact client IPv4 or IPv6 addresses matched against the request IP. Empty list disables IP filtering. | 403 IP_NOT_WHITELISTED |
expiresAt | Optional expiration timestamp checked on each validation. | 401 API_KEY_EXPIRED |
isActive / status | Inactive or revoked keys are rejected immediately across gateway nodes. | 401 API_KEY_INACTIVE |
Key Rotation & Revocation
Rotate compromised or aging credentials from Dashboard API Keys. Rotating a key generates a new e2x_live_ secret, updates the stored SHA-256 digest while preserving key metadata, and clears the cached old key hash immediately so stale credentials stop working without waiting for TTL expiry.