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

# POST /v1/images/generations

`POST /v1/images/generations`

## Request body

- object
  - `model` 'openai/gpt-image-1-mini', required
  - `prompt` string, required — The text prompt describing the content, style, or composition of the image to be generated.
  - `size` '1024x1024' | '1024x1536' | '1536x1024' — The size of the generated image.
  - `quality` 'low' | 'high' | 'medium' — The quality of the image that will be generated.
  - `output_format` 'png' | 'jpeg' | 'webp' — The format of the generated image.
  - `background` 'transparent' | 'opaque' | 'auto' — Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image. If transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp.
  - `moderation` 'low' | 'auto' — Control the content-moderation level for images.
  - `n` 1 — The number of images to generate.
  - `output_compression` integer — Compression level (0-100%), applies to JPEG and WebP only.
  - `response_format` 'url' | 'b64_json' — The format in which the generated images are returned.

## Response `200`

- object
  - `data` object[], nullable — The list of generated images.
    - `url` string, nullable — The URL where the file can be downloaded from.
    - `b64_json` string, nullable — The base64-encoded JSON of the generated image.
  - `meta` object, nullable — Additional details about the generation.
    - `usage` object, nullable
      - `credits_used` number, required — The number of tokens consumed during generation.
      - `usd_spent` number, required — The total amount of money spent by the user in USD.

---

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