---
title: "Create image"
method: POST
path: "/v1/images/generations"
tags: ["Images"]
---

# Create image

`POST /v1/images/generations`

This endpoint processes requests to generate images using AI models by forwarding them
to the appropriate AI node. The request metadata and compute units have already been
validated by middleware before reaching this handler.

## Errors
* Returns various status codes based on the underlying `handle_image_generation_response`:
  - `INTERNAL_SERVER_ERROR` - If there's an error communicating with the AI node

## Request body

- CreateImageRequest — Request body for image generation
  - `model` string, required — The model to use for image generation.
  - `n` integer, nullable — The number of images to generate. Defaults to 1.
  - `prompt` string, required — A text description of the desired image(s). The maximum length is 1000 characters.
  - `quality` string, nullable — The quality of the image that will be generated. `hd` creates images with finer details and greater consistency across the image.
  - `response_format` string, nullable — The format in which the generated images are returned.
  - `size` string, nullable — The size of the generated images.
  - `style` string, nullable — The style of the generated images.
  - `user` string, nullable — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

## Response `200`

Image generations

- CreateImageResponse — Response format for image generation
  - `created` integer, required
  - `data` ImageData[], required
    - `revised_prompt` string, nullable
    - `url` string, required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Internal server error

---

[API](https://skmtc.net/atomaai/apis/atoma-proxy.md) · [All operations](https://skmtc.net/atomaai/apis/atoma-proxy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atomaai/atoma-proxy/revisions/07694b7228b0/schema)
