Pixola / Docs / REST API

REST API

Programmatic access to 40+ AI image generation models via HTTP.

OpenAPI Spec

The full machine-readable spec is available at /api/v1/openapi.json. Import it into Postman, Insomnia, or any OpenAPI-compatible tool.

curl https://www.pixola.ai/api/v1/openapi.json

Authentication

All API requests require a Bearer token. Create an API key from your Settings page.

curl https://www.pixola.ai/api/v1/models \
  -H "Authorization: Bearer pxk_YOUR_API_KEY"

Quick Start

Generation is async: submit a request and get a batchId, then poll for results.

# 1. Submit (returns batchId immediately)
curl -X POST https://www.pixola.ai/api/v1/generate \
  -H "Authorization: Bearer pxk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A serene mountain lake at golden hour",
    "model": "flux-2",
    "style": "watercolor",
    "shape": "landscape-wide",
    "quality": "hd"
  }'

# 2. Poll for results (replace BATCH_ID)
curl https://www.pixola.ai/api/v1/batches/BATCH_ID \
  -H "Authorization: Bearer pxk_YOUR_API_KEY"

Endpoints

Base URL: https://www.pixola.ai/api/v1

Try It

Playground

GET

Rate Limits

30 requests per minute per API key

1,000 requests per day per API key

When rate limited you'll receive a 429 response with a Retry-After header.

Error Codes

StatusCodeDescription
400bad_requestInvalid parameters
401unauthorizedMissing or invalid API key
404not_foundResource not found
409content_flaggedPrompt flagged by moderation
409insufficient_creditsNot enough credits
429rate_limitedToo many requests
500internal_errorServer error