Recraft V4.1 API
recraft/v4.1/text-to-imageThe Recraft V4.1 API runs Recraft's main V4.1 model for design-ready text to image: posters, editorial illustrations, product shots and in-image text, with five aspect ratios, an optional palette of up to 10 RGB colors and a background color. Each image on the Recraft V4.1 API costs a flat 7 credits ($0.035).
Get API KeyEstimated cost: 7 credits · $0.0350
A flat 7 credits per image, charged at submission and refunded in full if the task fails.
REST API
Quick Start
This flow submits one valid Recraft V4.1 Text to Image request, captures its task_id, and reads result file URLs after the asynchronous task ends.
Connect to the Vidgo API
Create an API key, keep it on the server, and send it as Authorization: Bearer VIDGO_API_KEY.
- Endpoint
- POST
https://api.vidgo.ai/api/generate/submit - Authentication
- Authorization: Bearer VIDGO_API_KEY
Submit one task
Send the current model ID and an input object to the unified submit endpoint. input may only contain the fields listed for this endpoint; any other field returns 400.
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/v4.1/text-to-image",
"input": {
"prompt": "Screen-printed concert poster for an outdoor jazz night on a lagoon in Lagos. The bold headline reads exactly \"LAGOON JAZZ\" and a smaller line below reads exactly \"Saturday 14 March · Tarkwa Bay\". A saxophonist stands in a wooden canoe at sunset, rippling water drawn as stacked wavy lines, a large geometric sun behind him. Mid-century modern layout, generous margins, slight ink texture.",
"size": "3:4",
"colors": [
{
"r": 242,
"g": 140,
"b": 40
},
{
"r": 20,
"g": 60,
"b": 90
},
{
"r": 214,
"g": 64,
"b": 52
}
],
"background_color": {
"r": 240,
"g": 226,
"b": 200
}
}
}'Wait for the result
Read data.task_id and poll only while status is not_started or running. Stop on both finished and failed.
Track status
GET https://api.vidgo.ai/api/generate/status/{task_id}Poll every 2–5 seconds and back off on 429/5xx. Or provide top-level callback_url to receive a terminal-state callback.
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-11-03T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"created_time": "2026-11-03T08:00:00",
"progress": 100,
"files": [
{
"file_url": "https://example.com/result.webp",
"file_type": "image"
}
]
}
}Complete runnable polling example
Expand for the same payload end to end, including business-code, missing-task-ID, failed-state, unexpected-state, and network-error handling.
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "recraft/v4.1/text-to-image",
"input": {
"prompt": "Screen-printed concert poster for an outdoor jazz night on a lagoon in Lagos. The bold headline reads exactly \"LAGOON JAZZ\" and a smaller line below reads exactly \"Saturday 14 March · Tarkwa Bay\". A saxophonist stands in a wooden canoe at sunset, rippling water drawn as stacked wavy lines, a large geometric sun behind him. Mid-century modern layout, generous margins, slight ink texture.",
"size": "3:4",
"colors": [
{
"r": 242,
"g": 140,
"b": 40
},
{
"r": 20,
"g": 60,
"b": 90
},
{
"r": 214,
"g": 64,
"b": 52
}
],
"background_color": {
"r": 240,
"g": 226,
"b": 200
}
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
doneRequest Parameters
This table lists only public fields inside input. See Quick Start for top-level model and optional callback_url usage.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| input.prompt | string | Yes | – | Non-blank text, up to 10,000 characters. Put any words that should appear in the image in straight double quotes. |
| input.size | string | No | 1:1 | Aspect ratio of the image: 1:1, 4:3, 3:4, 16:9 or 9:16. |
| input.colors | object[] | No | – | Preferred palette: an array of up to 10 objects, each with integer r, g and b from 0 to 255, for example {"r": 242, "g": 140, "b": 40}. |
| input.background_color | object | No | – | Background color as one object with integer r, g and b from 0 to 255. |
Response Fields
The submit response identifies the task. The status response supplies result files or failure details at a terminal state.
| Field | Type | Description |
|---|---|---|
| code | integer | Business response code; 0 or 200 indicates success. |
| message | string | Optional human-readable response message. |
| data.task_id | string | Unique task ID used for status queries after submission. |
| data.status | string | not_started, running, finished, or failed. |
| data.created_time | string | Task creation timestamp. |
| data.progress | integer | Progress from 0–100 in status responses. |
| data.files[] | array | Generated files in returned order when finished. |
| data.files[].file_url | string | Direct URL of the generated file (.webp). |
| data.files[].file_type | string | Result files are identified as image. |
| data.error_message | string | null | Readable failure reason for failed tasks. |
Task Lifecycle
Only the first two states may be polled again. finished and failed are terminal.
not_startedAccepted and queued; wait before checking again.
runningGeneration is in progress; continue polling.
finishedSuccessful terminal state; validate files and read file URLs.
failedFailure terminal state; read error_message and stop. Reserved credits are refunded in full.
Polling and Errors
- AuthenticationKeep a valid VIDGO_API_KEY on the server and send requests with Bearer authentication.
- Validation400 indicates an invalid model ID, field, enum, length, count or size for this endpoint, including fields that belong to another endpoint.
- Polling intervalStart at 2–5 seconds, use exponential backoff for 429/5xx, and enforce an overall timeout.
- Terminal statesRead file URLs from files after finished, or error_message after failed. Both states end polling.
- Callback optionProvide a public top-level callback_url to receive the task object after finished or failed.
- Network errorsDistinguish request timeout, network failure, and task failure. Retry the same query only when safe.
Model Specifications
| Specification | Value | Details |
|---|---|---|
| Model | recraft/v4.1/text-to-image | Recraft V4.1 Text to Image |
| Input | prompt | Text up to 10,000 characters, plus optional colors and background_color |
| Output | 1 raster image per request | Image URL in files[0].file_url |
| size | 1:1 / 4:3 / 3:4 / 16:9 / 9:16 | Default 1:1 |
| colors | Up to 10 RGB objects | Integers r, g, b from 0 to 255 |
| Price | 7 credits ($0.035) | Flat per image |
Related Models
Recraft V4.1 API FAQ
What is the Recraft V4.1 API?
The Recraft V4.1 API gives developers Recraft V4.1, the image model Recraft released on May 14, 2026 and describes as its main and most expressive V4.1 model. On Vidgo the text-to-image endpoint returns one raster image per request in five aspect ratios, with optional RGB palette and background color control. You can call it programmatically or try it from the playground above.
How much does the Recraft V4.1 API cost?
Text to image costs 7 credits ($0.035) per image and text to vector costs 16 credits ($0.08) per SVG. The price is flat per request, and failed tasks are refunded in full.
What is the difference between Recraft V4.1, V4.1 Pro and V4.1 Flash?
Recraft V4.1 is the main, most expressive model. Recraft says the Pro models deliver higher resolution and finer detail for print-ready visuals, at 42 credits per image on Vidgo. Flash is the fast, low-cost tier with quality close to V4.1, at 1.4 credits per image. All three accept the same prompt, size, colors and background_color fields.
Can the Recraft V4.1 API use my brand colors?
Yes. Send up to 10 colors in colors as objects with integer r, g and b values from 0 to 255, and optionally one background_color. The Lagoon Jazz example uses orange, navy and red on a cream background.
Does the Recraft V4.1 API render text in images?
Yes. Put the words in straight double quotes in the prompt, as in the poster example with "LAGOON JAZZ" and its date line, and check small print before publishing.
Can the Recraft V4.1 API create SVG files?
Use the Recraft V4.1 Text to Vector endpoint, recraft/v4.1/text-to-vector, which takes the same fields and returns one editable SVG for 16 credits.



