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

# Create an image variation

`POST /images/variations`

Creates a variation of a given image using the OpenAI-compatible Images
API. The request is sent as `multipart/form-data` with the image file
as a binary upload.

Not every provider implements the Images API. Requests routed to a
provider that does not support it return `400 Bad Request` with an
explanatory error message; use `/chat/completions` for those providers.

## Query parameters

- `provider` 'ollama' | 'ollama_cloud' | 'groq' | 'llamacpp' | 'openai' | 'cloudflare' | 'cohere' | 'anthropic' | 'deepseek' | 'google' | 'mistral' | 'minimax' | 'moonshot' | 'nvidia' | 'zai'

## Response `200`

Successful response

- ImagesResponse — Represents the result of an image generation request.
  - `created` integer, required — The Unix timestamp (in seconds) of when the image was created.
  - `data` Image[], required — The generated images.
    - `b64_json` string — The base64-encoded JSON of the generated image, if `response_format` is `b64_json`.
    - `url` string — The URL of the generated image, if `response_format` is `url` (default).
    - `revised_prompt` string — The prompt that was used to generate the image, if there was any revision to the prompt.
  - `usage` object — Usage statistics for the image generation request.
    - `total_tokens` integer — Total number of tokens used.
    - `input_tokens` integer — Number of input tokens.
    - `output_tokens` integer — Number of output tokens.
    - `input_tokens_details` object — A detailed breakdown of the input tokens.
      - `cached_tokens` integer — The number of tokens retrieved from the cache.

## Other responses

- `400` — The selected provider does not implement the Images API. The gateway returns this when a request is routed to a provider without Images support.
- `401` — Unauthorized
- `500` — Internal server error

## Changes

- **2026-08-01** `f4890e8c05a3` — 1 breaking, 8 info
  - request property `size` was restricted to a list of enum values
  - added the new `1024x1024` enum value to the request property `size`
  - added the new `1024x1536` enum value to the request property `size`
  - added the new `1024x1792` enum value to the request property `size`
  - …5 more
- **2026-08-01** `251747b97ca9` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/inference-gateway/apis/inference-gateway-api/changes/images/variations/post.md)

---

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