# Quickstart

> Make your first image in about two minutes: create a key, submit a task, read the result.

## Create an API key

Sign in to the [Console](/console/api-keys) with the 6-digit code we email you (your first sign-in creates the account), top up your balance, and create a key under **API → API keys**. Store it in an environment variable: the full key is shown only once, when you create it.

```bash
export KEROX_API_KEY="kx_live_your_api_key_here"
```

## Submit a task

Send a `POST` request to `https://api.kerox.ai/v1/tasks`. Passing `wait_seconds: 30` lets short image tasks finish in a single HTTP request; if the task takes longer, the response returns the current `queued` or `running` task object so you can poll or wait for a webhook.

```bash
curl -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bytedance/seedream-5.5",
    "input": {
      "prompt": "editorial portrait of a ceramicist in morning sunlight, 35mm film",
      "size": "2K"
    },
    "wait_seconds": 30
  }'
```
```python
import os
import requests

resp = requests.post(
    "https://api.kerox.ai/v1/tasks",
    headers={
        "Authorization": f"Bearer {os.environ['KEROX_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "bytedance/seedream-5.5",
        "input": {
            "prompt": "editorial portrait of a ceramicist in morning sunlight, 35mm film",
            "size": "2K",
        },
        "wait_seconds": 30,
    },
    timeout=60,
)
resp.raise_for_status()
task = resp.json()
print(task["id"], task["status"], task["output"])
```
```javascript
const res = await fetch('https://api.kerox.ai/v1/tasks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.KEROX_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'bytedance/seedream-5.5',
    input: {
      prompt: 'editorial portrait of a ceramicist in morning sunlight, 35mm film',
      size: '2K',
    },
    wait_seconds: 30,
  }),
});

const task = await res.json();
console.log(task.id, task.status, task.output);
```

> **Save the output within 7 days**
>
> Generated image and video URLs expire 7 days after completion (see `expires_at`). Download and store anything you want to keep in your own object storage.

## Read the result

When `status` is `"succeeded"`, outputs appear under `output.images` or `output.videos`, and `cost` shows the settled USD amount (the price of the image; see the [model's page](/docs/models) for current prices). If `status` is still `"queued"` or `"running"`, poll `GET /v1/tasks/{id}` or configure a webhook.

```json
{
  "id": "task_01JD8X9B4Q2M7T8N3K5P6R1S0V",
  "object": "task",
  "model": "bytedance/seedream-5.5",
  "status": "succeeded",
  "source": "api",
  "format": "native",
  "input": {
    "prompt": "editorial portrait of a ceramicist in morning sunlight, 35mm film",
    "size": "2K"
  },
  "output": {
    "images": [
      {
        "url": "https://cdn.kerox.ai/t/task_01JD8X9B4Q2M7T8N3K5P6R1S0V/5f2b8c1e9d3a4f6b8a7c0d1e2f3a4b5c/0.png",
        "content_type": "image/png",
        "width": 2048,
        "height": 2048
      }
    ]
  },
  "error": null,
  "cost": {
    "amount": "0.0280",
    "currency": "USD",
    "status": "settled"
  },
  "metadata": null,
  "warnings": [],
  "created_at": "2026-11-20T08:01:02Z",
  "started_at": "2026-11-20T08:01:02Z",
  "completed_at": "2026-11-20T08:01:10Z",
  "expires_at": "2026-11-27T08:01:10Z"
}
```

## Next steps

- [Webhooks](https://kerox.ai/docs/webhooks): Get notified when video tasks finish.
- [Files & inputs](https://kerox.ai/docs/files): Send reference images and first frames.
- [MCP server](https://kerox.ai/docs/mcp): Let Claude Code or Cursor call Kerox.
