---
title: "ImagesGenerations"
method: POST
path: "/v1/images/generations"
tags: ["relay"]
---

# ImagesGenerations

`POST /v1/images/generations`

ImagesGenerations

## Headers

- `Aiproxy-Channel` string

## Request body

- ModelImageRequest
  - `background` string
  - `model` string
  - `moderation` string
  - `n` integer
  - `output_compression` integer
  - `output_format` string — png, jpeg, webp
  - `partial_images` integer
  - `prompt` string
  - `quality` string — auto, high, medium, low, hd, standard
  - `response_format` string — url, b64_json
  - `size` string — 1024x1024, 1536x1024, 1024x1536, auto, 256x256, 512x512, 1792x1024, 1024x1792
  - `stream` boolean
  - `style` string — vivid, natural
  - `user` string

## Response `200`

OK

- ModelImageResponse
  - `created` integer
  - `data` ModelImageData[]
    - `b64_json` string
    - `revised_prompt` string
    - `url` string
  - `usage` ModelImageUsage
    - `input_tokens` integer — The number of tokens (images and text) in the input prompt.
    - `input_tokens_details` ModelImageInputTokensDetails
      - `image_tokens` integer — The number of image tokens in the input prompt.
      - `text_tokens` integer — The number of text tokens in the input prompt.
    - `output_tokens` integer — The number of image tokens in the output image.
    - `output_tokens_details` ModelImageOutputTokensDetails
      - `image_tokens` integer — The number of image output tokens generated by the model.
      - `text_tokens` integer — The number of text output tokens generated by the model.
    - `total_tokens` integer — The total number of tokens (images and text) used for the image generation.

---

[API](https://skmtc.net/labring/apis/ai-proxy-swagger-api.md) · [All operations](https://skmtc.net/labring/apis/ai-proxy-swagger-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labring/ai-proxy-swagger-api/versions/e471487f2a2f/schema)
