Quickstart

Create an API key, submit your first image or video generation task, and fetch the result in a few minutes.

genkiln is a REST API for AI image and video generation. You send a task, we run it asynchronously, and you get the result either by polling or through a signed webhook. Every request uses the same shape, whichever model you pick.

All endpoints live under one base URL:

Text
https://genkiln.com/v1

1. Get an API key

  1. Sign up and add credits on the pricing page. 1 credit = US$0.001.
  2. Open Console → API Keys and create a key. It starts with sk_ and is shown only once, so store it somewhere safe.
cURL
export GENKILN_API_KEY="sk_..."

Keep the key on your server. Never ship it in browser or mobile app code. See Authentication.

2. Create a task

Send a POST /v1/tasks with a model and its input. This example generates one 1K image with Nano Banana 2:

curl https://genkiln.com/v1/tasks \
  -H "Authorization: Bearer $GENKILN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "input": {
      "prompt": "A red fox running through fresh snow, golden hour, 35mm photo",
      "aspect_ratio": "16:9",
      "resolution": "1K"
    }
  }'

The API answers right away with 202 Accepted and a task object. The credits are reserved at this point:

JSON
{
  "id": "task_01JC8ZK3Q4XG7T2M9V5R6N8W1B",
  "object": "task",
  "model": "nano-banana-2",
  "status": "queued",
  "cost_credits": 52,
  "refunded": false,
  "output": null,
  "error": null,
  "created_at": "2026-11-03T08:00:00.000Z",
  "started_at": null,
  "completed_at": null,
  "expires_at": null,
  "metadata": {}
}

3. Get the result

Poll GET /v1/tasks/{id} every few seconds until status is succeeded, failed or canceled:

curl https://genkiln.com/v1/tasks/task_01JC8ZK3Q4XG7T2M9V5R6N8W1B \
  -H "Authorization: Bearer $GENKILN_API_KEY"

A finished task carries URLs on our CDN:

JSON
{
  "id": "task_01JC8ZK3Q4XG7T2M9V5R6N8W1B",
  "object": "task",
  "model": "nano-banana-2",
  "status": "succeeded",
  "cost_credits": 52,
  "refunded": false,
  "output": {
    "images": [{ "url": "https://cdn.genkiln.com/results/.../0.png" }],
    "videos": []
  },
  "error": null,
  "created_at": "2026-11-03T08:00:00.000Z",
  "started_at": "2026-11-03T08:00:04.000Z",
  "completed_at": "2026-11-03T08:00:21.000Z",
  "expires_at": "2026-12-03T08:00:21.000Z",
  "metadata": {}
}

Result files are kept for 30 days after the task completes (see expires_at) and are then deleted. Download anything you want to keep.

Instead of polling, you can pass a callback_url and we will POST the finished task to you. See Webhooks.

What you pay

  • Each model has a fixed, public price per image, per video or per second of video. See Models.
  • The cost is calculated from your input and returned as cost_credits when the task is created.
  • If a task fails, times out or is canceled, the credits go back to your balance automatically and the task shows "refunded": true.
  • Purchased credits never expire.

Next steps

  • Create task: every request field, idempotency and validation rules.
  • Webhooks: get notified instead of polling, and verify signatures.
  • Errors: every error code and what to do about it.