API-Key API Reference

One API for video, image, music and LLM models.

Use a single API key and credit wallet to call OpenAI-compatible chat and embeddings routes, create async media tasks, receive signed callbacks, poll results and serve model capabilities to your own customers.

Authentication

Send a consumer API key with every request.

Authorization: Bearer YOUR_API_KEY
# or
x-api-key: YOUR_API_KEY

Machine-readable entrypoints

ResourceURL
OpenAPI schema/openapi.json
Markdown docs/api-docs/index.md
LLM entrypoint/llms.txt
API catalog/.well-known/api-catalog
Auth.md/auth.md

Core endpoints

GET

/v1/models

List public models, categories and metadata.

POST

/v1/credits/estimate

Estimate credits before starting paid tasks.

POST

/v1/chat/completions

OpenAI-compatible chat completion endpoint for LLM models.

POST

/v1/embeddings

OpenAI-compatible embeddings endpoint.

POST

/v1/images/generations

Create image generation tasks from prompts and references.

POST

/v1/videos

Create text-to-video, image-to-video or video-to-video tasks.

POST

/v1/music/generations

Create music generation tasks.

GET

/v1/tasks/{task_id}

Poll image, video or music task status and output URLs.

Estimate credits before paid tasks

Agents should estimate credits before creating image, video or music tasks. Add max_credits to task request bodies to reject the request before a task is created if the estimate exceeds the user's approved budget.

curl https://api-key.org/v1/credits/estimate \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2-fast",
    "modality": "video",
    "duration": 6,
    "resolution": "720p",
    "input_mode": "text-to-video",
    "max_credits": 250
  }'

Video task example

curl https://api-key.org/v1/videos \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2",
    "prompt": "A cinematic product launch video with smooth camera motion",
    "max_credits": 250,
    "callback_url": "https://your-app.com/webhooks/api-key"
  }'

Task response

{
  "task_id": "task_abc123",
  "id": "task_abc123",
  "object": "gateway.video.task",
  "status": "pending"
}

Poll task status

curl https://api-key.org/v1/tasks/task_abc123 \
  -H "Authorization: Bearer $API_KEY"

Gateway behavior

CapabilityWhat API-Key provides
API keysConsumer keys with profile settings, model limits, IP allowlists and usage tracking.
Model routingPublic models map to delivery paths with priority, weight and retry policy.
BillingCredits can be reserved before a task, settled after completion and refunded when model tasks fail.
Media deliveryGenerated assets are returned as durable result links and tracked by task status.
Task APIsAsync media generation returns task_id, supports polling and can send signed callback events.

Callback signature

When callback_url is provided, terminal task events are sent as HTTPS POST requests.

x-api-key-event: gateway.task.completed
x-api-key-task-id: task_abc123
x-api-key-timestamp: 1780666146
x-api-key-signature: HMAC_SHA256(timestamp + "." + body)

Error format

{
  "error": {
    "message": "Insufficient credits",
    "type": "gateway_error",
    "code": "insufficient_credits"
  }
}