# Generate images

`POST /v1/images/generations`



Base URL: `https://api.simplellm.eu`. Authenticate using `Authorization: Bearer $SIMPLELLM_API_KEY`.

## Request body

Content-Type: `application/json`

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `prompt` | `string` | Yes |  |
| `model` | `string` | No | V1 uses the configured image backend; this field does not select a different model. |
| `n` | `integer` | No | Default: `1`. Minimum: 1. Maximum: 4. |
| `size` | `string` | No | Accepted locally but not forwarded by V1; does not control output dimensions. Default: `"1024x1024"`. |
| `response_format` | `string` | No |  |

Nested required fields are required only when their containing object is supplied. Extra chat parameters may be provider-specific; acceptance does not guarantee model support.

## Example request

~~~bash
curl --fail-with-body https://api.simplellm.eu/v1/images/generations \
  -H "Authorization: Bearer $SIMPLELLM_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "A small lighthouse at dawn, watercolor illustration",
  "n": 1,
  "size": "1024x1024"
}'
~~~

## Responses

### HTTP 200

Successful response

Content-Type: `application/json`

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `created` | `integer` | No |  |
| `data` | `array<object>` | No |  |
| `data[].url` | `string` | No |  |
| `data[].b64_json` | `string` | No |  |

Illustrative response shape only; IDs, timestamps and counters below are synthetic, not live limits or customer data.

~~~json
{
  "created": 1789380000,
  "data": [
    {
      "url": "https://api.simplellm.eu/images/EXAMPLE_IMAGE_ID"
    }
  ]
}
~~~

## Error handling

Errors can occur in authentication, billing, routing or the upstream service; not every status applies to every route.

| Status | Meaning |
| --- | --- |
| 400 | Invalid request |
| 401 | Invalid credentials |
| 402 | Insufficient credits |
| 403 | Access denied |
| 404 | Model or resource not found |
| 429 | Rate or capacity limit |
| 500 | Internal error |
| 502 | Routing or upstream error |
| 503 | Temporarily unavailable |
| 504 | Deployment timeout |

See [Troubleshooting](/docs/errors.html) for response examples and [Rate limits & retries](/docs/limits.html) for retry rules.

## Machine-readable schema

[Download OpenAPI JSON](/openapi.json). Operation ID: `createImage`.
