Introduction

The Pixel Engine API gives you programmatic access to pixel engine. Submit an image and a prompt, poll until the job finishes, and download the result. This page covers everything you need to make your first request.

Base URL

https://api.pixelengine.ai/functions/v1

All requests and responses use application/json. All endpoints support CORS.

Authentication

Every request must include an API key as a Bearer token in the Authorization header:

Request header
Authorization: Bearer pe_sk_...

Creating an API key

API keys are managed in your account under Account → API.

  1. Sign in and go to Account → API.
  2. Click Add key and optionally give it a name.
  3. Copy the full key immediately — it is only shown once.
The plaintext key is never stored on the server. Only a short prefix (e.g. pe_sk_ab12cd34…) is saved for identification. If you lose your key, delete it and create a new one.

You can hold up to 10 keys per account. Keys can be renamed, deactivated (paused without deletion), or permanently deleted. A deactivated key returns 401 unauthorized on every request until it is reactivated.

Credits

Pixel Engine uses a credit system. Your available balance is the sum of two pools:

PoolDescription
Monthly creditsRefreshed on your billing date. Approximately 200 credits = $1.
Purchased creditsBought explicitly. Approximately 100 credits = $1.

Monthly credits are spent first. Purchased credits are only drawn down once your monthly pool is exhausted.

Before a job runs, a hold is placed on the required credits for up to 10 minutes. If the job fails, the hold is released and no credits are consumed. Credits are only deducted on a successful generation.

Endpoint costs

EndpointCost
POST /animate20 credits
GET /balanceFree
GET /jobsFree

Check your current balance at any time with GET /balance.

Errors

All error responses share this shape, regardless of endpoint:

JSON
{
  "error": {
    "code": "string",
    "message": "string"
  }
}

code is a stable, machine-readable string — safe to match in application code. message is human-readable and safe to surface to users.

Common error codes

HTTPCodeWhen
401unauthorizedMissing, malformed, or inactive API key.
402insufficient_creditsNot enough available credits to cover the job.
500internal_errorServer-side failure.

Endpoint-specific errors are documented on the API Reference page.

Polling

POST /animate returns a job ID immediately — generation runs asynchronously in the background. Use GET /jobs to wait for the result.

Recommended pattern

  1. Submit with POST /animate. Save the returned api_job_id.
  2. Call GET /jobs?id=<api_job_id> every 3–5 seconds while status is "queued" or "pending".
  3. Stop polling when status is "success" or "failure". On success, output.url contains a signed download link.

Typical generation time is ~90 seconds.

# 1. Submit a job
curl -X POST https://api.pixelengine.ai/functions/v1/animate \
  -H "Authorization: Bearer pe_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "image": "<base64-encoded PNG>",
    "prompt": "a character walking left"
  }'

# → { "api_job_id": "f47ac10b-...", "status": "queued", "error": null }

# 2. Poll every 3–5 seconds until status is "success" or "failure"
curl "https://api.pixelengine.ai/functions/v1/jobs?id=f47ac10b-..." \
  -H "Authorization: Bearer pe_sk_..."

# → on success: output.url holds a signed download link (valid 1 hour)

See also

The API Reference contains the full specification for every endpoint: request bodies, all accepted fields and their types, response shapes, status values, metadata formats, and the complete list of error codes per endpoint.