Skip to content
English

Recraft V4.1 Flash Text to Image API

POST Base URL: https://api.hiapi.ai /v1/tasks

Image, video, and audio models are called through theUnified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name recraft-v4.1-flash/text-to-image
Type Image generation (text-to-image)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

Recraft V4.1 Flash: Describe an image and get photography, illustration or mixed-media results fast, with optional palette and background colors.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Result URLs expire — copy the output to your own storage once the task succeeds.

Best suited for

Marketing visuals

Posters, social images and banners straight from a size preset.

promptimage_size
Brand illustration

Lock brand colors with colors and background_color.

colorsbackground_color
Concept sketches

Try styles and layouts quickly before refining one direction.

prompt

Request parameters

model string required

Fixed value recraft-v4.1-flash/text-to-image.

example recraft-v4.1-flash/text-to-image
input object required

Business parameters.

prompt string required

Image description, 1–10000 characters.

image_size enum optional

Output size preset.

default square_hd enum: square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
colors array optional

Optional preferred palette: an array of RGB objects, each with r, g and b from 0 to 255.

r integer required

0–255, red

g integer required

0–255, green

b integer required

0–255, blue

background_color object optional

Optional preferred background color: an RGB object with r, g and b from 0 to 255.

callback object optional

Optional callback configuration. When set, HiAPI notifies your service when the task reaches a terminal state.

url string required

Required when callback is set; HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final.

default final enum: final

Example requests

Flat illustration with a set palette

colors sets navy, orange and wheat and background_color sets cream, so the whole image stays within that palette.

Request body
{
  "model": "recraft-v4.1-flash/text-to-image",
  "input": {
    "prompt": "Flat vector illustration of a cozy reading nook with an armchair, a tall plant and a round window showing a city skyline at dusk, clean geometric shapes, gentle grain",
    "image_size": "landscape_4_3",
    "colors": [
      {
        "r": 28,
        "g": 61,
        "b": 90
      },
      {
        "r": 240,
        "g": 128,
        "b": 60
      },
      {
        "r": 245,
        "g": 222,
        "b": 179
      }
    ],
    "background_color": {
      "r": 250,
      "g": 246,
      "b": 238
    }
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the image from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

FAQ

What is Recraft V4.1 Flash good for?

Fast photos, illustrations, posters and mixed-media images, such as marketing visuals, brand illustration and concept sketches.

Which sizes are supported?

image_size accepts square_hd (default), square, portrait_4_3, portrait_16_9, landscape_4_3 and landscape_16_9.

How do I set colors?

Pass colors (an array of RGB objects) and background_color (one RGB object) through the API, each channel 0–255. The online Playground does not show these two fields yet.

How many images per request?

One image per request. Submit several tasks for more.

What is the output format?

One WEBP image, downloaded from output[].url in the task result.

How accurate is in-image text?

Short headlines usually come out right. Put the words in quotes and describe placement and type style for steadier results.

Do I need a reference image?

No. It is a text-to-image model and only needs a description.

Next steps