---
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

## Changes

- **2025-01-25** `d714acb641bd` — 4 breaking, 12 info
  - added the new required request property `model`
  - added the new required request property `prompt`
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `200`
  - …12 more
- **2024-12-12** `444230182e5e` — 1 info
  - api tag `Image Generations` added
- **2024-12-06** `45e3254839bd` — 4 breaking, 8 warning, 3 info
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `created` from the response with the `200` status
  - removed the required property `data` from the response with the `200` status
  - …11 more

[Change history](https://skmtc.dev/atomaai/apis/atoma-proxy/changes/v1/images/generations/post.md)

---

[API](https://skmtc.dev/atomaai/apis/atoma-proxy.md) · [All operations](https://skmtc.dev/atomaai/apis/atoma-proxy/llms.txt) · [OpenAPI document](https://skmtc.dev/atomaai/apis/atoma-proxy/revisions/07694b7228b0?raw)
