---
title: "Create image from text - Recraft V4"
method: POST
path: "/v1/ai/text-to-image/recraft-v4"
tags: ["text-to-image"]
---

# Create image from text - Recraft V4

`POST /v1/ai/text-to-image/recraft-v4`

## Request

- Base URL: `https://api.magnific.com`
- URL: `https://api.magnific.com/v1/ai/text-to-image/recraft-v4`
- Auth: API key in header `x-magnific-api-key`

Generate an image from a text prompt using Recraft V4.

**Key Features:**
- Best-in-class rendering of legible text inside the image
- Design-oriented output: posters, signage, packaging, editorial layouts
- Eleven fixed aspect ratios, from 768x1344 to 1536x768

**Best for:**
- Designs whose wording must be readable and correctly spelled
- Brand and marketing assets with typographic weight

**Output:** one image per request, delivered as a URL in the task's
`generated` array. Exact sizes are listed under `aspect_ratio`.

**Credits:** a flat price per image. Recraft V4 Pro renders the same
sizes at twice the linear dimensions for a higher price.

The request is processed asynchronously: the endpoint returns a task id
immediately. Retrieve the result by polling the task endpoint or by
providing an optional `webhook_url`.

## Request body

- TtirecraftV4RequestContent
  - `prompt` string, required: Text description of the image you want to generate. **Tips:** - Recraft's strength is rendering legible text inside the image, so spell out any wording the design must contain - Describe layout, palette and typography, not just the subject **Examples:** - Simple: "A storefront sign that reads OPEN DAILY 9AM" - Detailed: "A storefront sign that reads OPEN DAILY 9AM, flat vector poster style, cream and navy palette, bold rounded display type"
  - `aspect_ratio` 'square_1_1' | 'horizontal_2_1' | 'vertical_1_2' | 'standard_3_2' | 'portrait_2_3' | 'classic_4_3' | 'traditional_3_4' | 'social_5_4' | 'social_post_4_5' | 'widescreen_16_9' | 'social_story_9_16': Aspect ratio of the generated image, expressed as *_width_height. Recraft renders from a fixed set of sizes, so the output dimensions are the ones listed below and are **not always the exact mathematical ratio the name suggests** — `widescreen_16_9` renders 1344x768, which is 7:4. | `aspect_ratio` | V4 / V4.1 `mid` | V4 Pro / V4.1 `pro` | |---|---|---| | `square_1_1` | 1024x1024 | 2048x2048 | | `horizontal_2_1` | 1536x768 | 3072x1536 | | `vertical_1_2` | 768x1536 | 1536x3072 | | `standard_3_2` | 1280x832 | 2560x1664 | | `portrait_2_3` | 832x1280 | 1664x2560 | | `classic_4_3` | 1216x896 | 2432x1792 | | `traditional_3_4` | 896x1216 | 1792x2432 | | `social_5_4` | 1152x896 | 2304x1792 | | `social_post_4_5` | 896x1152 | 1792x2304 | | `widescreen_16_9` | 1344x768 | 2688x1536 | | `social_story_9_16` | 768x1344 | 1536x2688 |
  - `enhance_prompt` boolean: Rewrite the prompt with an LLM before generating, which generally produces a richer design. Any text the image must render is preserved verbatim. Set it to `false` to send the prompt exactly as written, which is what you want when you need a deterministic input.
  - `webhook_url` string, uri: Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

## Response `200`

OK - The request has succeeded and the Recraft V4 process has started.

- GetStyleTransferTaskStatus200Response
  - `data` TaskDetail, required
    - `task_id` string, uuid, required: Task identifier
    - `status` 'CREATED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED', required: Task status
    - `generated` string[], required

## Other responses

- `400`: Bad Request - The server could not understand the request due to invalid syntax.
- `401`: Unauthorized - The client must authenticate itself to get the requested response.
- `500`: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
- `503`: Service Unavailable

---

[API](https://skmtc.dev/magnific/apis/magnific-api.md) · [All operations](https://skmtc.dev/magnific/apis/magnific-api/llms.txt) · [OpenAPI document](https://skmtc.dev/magnific/apis/magnific-api/revisions/60711fb082c7?raw)
