---
title: "Variate Image"
method: POST
path: "/v1/images/variateImage"
tags: ["image"]
---

# Variate Image

`POST /v1/images/variateImage`

## Request

- Base URL: `https://external.api.recraft.ai`
- URL: `https://external.api.recraft.ai/v1/images/variateImage`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/recraft/apis/recraft-ai-external-api/docs/v1/images/variateImage/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- object
  - `image_format` 'webp' | 'png'
  - `model` 'recraftv2' | 'recraftv2_raster' | 'recraftv2_vector' | 'recraftv3' | 'recraftv3_raster' | 'recraftv3_vector' | 'recraftv4' | 'recraftv4_raster' | 'recraftv4_vector' | 'recraftv4_pro' | 'recraftv4_pro_raster' | 'recraftv4_pro_vector' | 'recraftv4_1' | 'recraftv4_1_raster' | 'recraftv4_1_vector' | 'recraftv4_1_pro' | 'recraftv4_1_pro_raster' | 'recraftv4_1_pro_vector' | 'recraftv4_1_utility' | 'recraftv4_1_utility_raster' | 'recraftv4_1_utility_vector' | 'recraftv4_1_utility_pro' | 'recraftv4_1_utility_pro_raster' | 'recraftv4_1_utility_pro_vector' | 'recraftv4_styles' | 'recraftv4_styles_raster' | 'recraftv4_styles_vector' | 'recraftv4_styles_pro' | 'recraftv4_styles_pro_raster' | 'recraftv4_styles_pro_vector' | 'recraftv4_1_flash' | 'recraftv4_1_flash_raster'
  - `n` integer
  - `random_seed` integer
  - `response_format` 'url' | 'b64_json' | 'multipart'
  - `size` '1024x1024' | '1365x1024' | '1024x1365' | '1536x1024' | '1024x1536' | '1820x1024' | '1024x1820' | '1024x2048' | '2048x1024' | '1434x1024' | '1024x1434' | '1024x1280' | '1280x1024' | '1024x1707' | '1707x1024' | '1216x896' | '896x1216' | '1280x832' | '832x1280' | '1152x896' | '896x1152' | '1280x896' | '896x1280' | '832x1344' | '768x1344' | '1344x768' | '768x1536' | '1536x768' | '2048x2048' | '2432x1792' | '1792x2432' | '2560x1664' | '1664x2560' | '2304x1792' | '1792x2304' | '2560x1792' | '1792x2560' | '1664x2688' | '1536x2688' | '2688x1536' | '1536x3072' | '3072x1536' | '1:1' | '2:1' | '1:2' | '3:2' | '2:3' | '4:3' | '3:4' | '5:4' | '4:5' | '6:10' | '14:10' | '10:14' | '16:9' | '9:16', required
  - `zdr` boolean: Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.
  - `image_url` string: URL or data URL of the input image. JSON counterpart of the `image` file.

## Response `200`

OK

- GenerateImageResponse
  - `created` integer, required
  - `credits` integer, required
  - `data` Image[], required
    - `b64_json` string
    - `image_id` string, uuid, required
    - `revised_prompt` string
    - `url` string
  - `style_id` string, uuid

## Other responses

- `4XX`: Request failed. The body is plain text (for example 401 `request unauthorized`) or JSON, so read it as text before parsing.
- `5XX`: Request failed. The body is plain text (for example 401 `request unauthorized`) or JSON, so read it as text before parsing.

---

[API](https://skmtc.dev/recraft/apis/recraft-ai-external-api.md) - [All operations](https://skmtc.dev/recraft/apis/recraft-ai-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/recraft/apis/recraft-ai-external-api/revisions/2180aa45c034?raw)
