> ## Documentation Index
> Fetch the complete documentation index at: https://docs.one-api.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate images

> Create an image from a prompt with z-image-turbo.

`POST /v1/images/generations` starts an image task.

```bash theme={null}
curl -sS 'https://one-api.ai/v1/images/generations?wait=30' \
  -H "Authorization: Bearer $ONE_API_TOKEN" \
  -d '{
    "model": "z-image-turbo",
    "prompt": "a rainy night street, a neon sign that reads OPEN LATE",
    "size": "16:9",
    "resolution": "2K",
    "output_format": "png"
  }'
```

## Fields for `z-image-turbo`

| Field | Type | Default | Notes |
| - | - | - | - |
| `model` | string | required | `z-image-turbo` |
| `prompt` | string | required | Up to 2,000 characters. English and Chinese text both render well. |
| `size` | string | `1:1` | Aspect ratio: `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2` or `2:3` |
| `resolution` | string | `1K` | `1K` or `2K` |
| `seed` | integer | random | Use the same seed and prompt to reproduce an image |
| `output_format` | string | `jpg` | `jpg`, `png` or `webp` |
| `n` | integer | `1` | Only `1` is accepted |

A field that is not in this table returns HTTP 400, so a typo or an unsupported option never passes silently.

## Output sizes

| `size` | `1K` | `2K` |
| - | - | - |
| `1:1` | 1024×1024 | 2048×2048 |
| `4:3` | 1152×864 | 2048×1536 |
| `3:4` | 864×1152 | 1536×2048 |
| `16:9` | 1280×720 | 2048×1152 |
| `9:16` | 720×1280 | 1152×2048 |
| `3:2` | 1248×832 | 2048×1360 |
| `2:3` | 832×1248 | 1360×2048 |

## Price

$0.005 per image at list, the same at every size. A customer key pays 5.473684 credits ($0.005474). See [Billing](https://docs.one-api.ai/guides/billing.md).

## Content rules

The model's safety filter is always on. A prompt it rejects ends as a failed task and is not charged.

## Timing

An image usually finishes in 10 to 30 seconds, so `?wait=30` returns most results in one call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.