---
title: "Create image variation"
method: POST
path: "/images/variations"
tags: ["Images"]
---

# Create image variation

`POST /images/variations`

Creates a variation of a given image. This endpoint only supports `dall-e-2`.

## Response `200`

OK

- ImagesResponse — The response from the image generation endpoint.
  - `created` integer, required — The Unix timestamp (in seconds) of when the image was created.
  - `data` Image[] — The list of generated images.
    - `b64_json` string — The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.
    - `url` string, uri — When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models.
    - `revised_prompt` string — For `dall-e-3` only, the revised prompt that was used to generate the image.
  - `background` 'transparent' | 'opaque' — The background parameter used for the image generation. Either `transparent` or `opaque`.
  - `output_format` 'png' | 'webp' | 'jpeg' — The output format of the image generation. Either `png`, `webp`, or `jpeg`.
  - `size` '1024x1024' | '1024x1536' | '1536x1024' — The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`.
  - `quality` 'low' | 'medium' | 'high' — The quality of the image generated. Either `low`, `medium`, or `high`.
  - `usage` ImageGenUsage — For `gpt-image-1` only, the token usage information for the image generation.
    - `input_tokens` integer, required — The number of tokens (images and text) in the input prompt.
    - `total_tokens` integer, required — The total number of tokens (images and text) used for the image generation.
    - `output_tokens` integer, required — The number of output tokens generated by the model.
    - `output_tokens_details` ImageGenOutputTokensDetails — The output token details for the image generation.
      - `image_tokens` integer, required — The number of image output tokens generated by the model.
      - `text_tokens` integer, required — The number of text output tokens generated by the model.
    - `input_tokens_details` ImageGenInputUsageDetails, required — The input tokens detailed information for the image generation.
      - `text_tokens` integer, required — The number of text tokens in the input prompt.
      - `image_tokens` integer, required — The number of image tokens in the input prompt.

---

[API](https://skmtc.net/openai/apis/openai-api.md) · [All operations](https://skmtc.net/openai/apis/openai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openai/openai-api/revisions/dcd35773a322/schema)
