Recraft V4.1 Flash Text to Image API
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
- 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
Posters, social images and banners straight from a size preset.
promptimage_sizeLock brand colors with colors and background_color.
colorsbackground_colorTry styles and layouts quickly before refining one direction.
promptRequest parameters
model string required Fixed value 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.
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.
when enum optional Callback trigger timing. Use final.
Example requests
colors sets navy, orange and wheat and background_color sets cream, so the whole image stays within that palette.
{
"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
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, download the image from output[].url.
- 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.