---
title: "Create image"
method: POST
path: "/v1/images/generations"
---

# Create image

`POST /v1/images/generations`

Generate images from a text prompt using image generation models

## Request body

- ImageGenerationRequest
  - `model` string, required — The model to use for image generation
  - `prompt` string, required — A text description of the desired image
  - `n` integer — The number of images to generate
  - `size` '1024x1024' | '1536x1024' | '1024x1536' — The size of the generated images
  - `quality` 'auto' | 'high' | 'medium' | 'low' — The quality of the generated image
  - `response_format` 'url' | 'b64_json' — The format in which the generated images are returned
  - `background` 'auto' | 'transparent' | 'opaque' — The background type for the generated image
  - `output_format` 'png' | 'jpeg' | 'webp' — The file format of the generated image

## Response `200`

Image generation response

- ImageGenerationResponse
  - `created` integer, required — The Unix timestamp of when the image was created
  - `data` ImageData[], required — The list of generated images
    - `url` string — The URL of the generated image (when response_format is url)
    - `b64_json` string — The base64-encoded JSON of the generated image (when response_format is b64_json)

## Other responses

- `400` — Bad request - malformed payload or invalid parameters.
- `401` — Unauthorized - missing or empty Authorization header.
- `402` — Payment required - organization balance exhausted.
- `403` — Forbidden - invalid token or model not in access list.
- `404` — Not found - provider/model not supported.
- `429` — Rate limit exceeded. Retry after the Retry-After header value.
- `500` — Internal server error.
- `502` — Bad gateway - upstream provider returned an invalid response.

---

[API](https://skmtc.dev/requesty/apis/requesty-api.md) · [All operations](https://skmtc.dev/requesty/apis/requesty-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/requesty/requesty-api/revisions/63bc7d99ccde/schema)
