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

# Create image

> POST /v1/images/generations

Generate one or more images. Synchronous: the response contains image URLs.

```
POST https://api.heyaskr.ai/v1/images/generations
```

<ParamField body="model" type="string" required>Image model id.</ParamField>
<ParamField body="prompt" type="string" required>Text description.</ParamField>
<ParamField body="size" type="string">e.g. `1024x1024`.</ParamField>
<ParamField body="n" type="integer" default="1">Number of images.</ParamField>
<ParamField body="negative_prompt" type="string">What to avoid.</ParamField>

## Response

<ResponseField name="data" type="array">Objects each with a `url`.</ResponseField>
<ResponseField name="cost" type="number">Cost of the generation in USD.</ResponseField>

```json theme={null}
{ "data": [{ "url": "https://cdn.heyaskr.ai/images/...png" }], "cost": 0.04 }
```

<Warning>Image URLs expire after 24 hours.</Warning>
