Recraft V4.1
Text-to-Image • Recraft
recraft/recraftv4-1
- Third-party
- Zero data retention
Recraft V4.1 generates art-directed images tuned for high aesthetics, with strong composition, accurate text rendering, and refined design taste. Fast and cost-efficient at standard resolution.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Zero data retention | Yes |
| Pricing | <ul><li>Per image$0.04</li></ul> |
Usage
const response = await env.AI.run(
'recraft/recraftv4-1',
{ prompt: 'A minimalist logo of a mountain range with a sun rising behind it' },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv4-1",
"input": {
"prompt": "A minimalist logo of a mountain range with a sun rising behind it"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1/simple-generation.png"
},
"state": "Completed"
}
Examples
<details>
<summary>Scene Composition — Generate a complex compositional scene</summary>
const response = await env.AI.run(
'recraft/recraftv4-1',
{
prompt: 'A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney',
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv4-1",
"input": {
"prompt": "A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1/scene-composition.png"
},
"state": "Completed"
}
</details>
<details>
<summary>Custom Size — Specify output dimensions</summary>
const response = await env.AI.run(
'recraft/recraftv4-1',
{
prompt: 'A flat illustration of a workspace with a laptop, coffee cup, and potted plant',
size: '1024x1024',
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv4-1",
"input": {
"prompt": "A flat illustration of a workspace with a laptop, coffee cup, and potted plant",
"size": "1024x1024"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1/custom-size.png"
},
"state": "Completed"
}
</details>
<details>
<summary>With Color Controls — Guide generation with specific brand colors</summary>
const response = await env.AI.run(
'recraft/recraftv4-1',
{
prompt: 'An abstract geometric pattern suitable for a tech company brand identity',
controls: { colors: [{ rgb: [255, 107, 53] }, { rgb: [0, 43, 91] }] },
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv4-1",
"input": {
"prompt": "An abstract geometric pattern suitable for a tech company brand identity",
"controls": {
"colors": [
{
"rgb": [
255,
107,
53
]
},
{
"rgb": [
0,
43,
91
]
}
]
}
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1/with-color-controls.png"
},
"state": "Completed"
}
</details>
<details>
<summary>Background Color — Set a specific background color</summary>
const response = await env.AI.run(
'recraft/recraftv4-1',
{
prompt: 'A clean icon of a lightning bolt',
controls: { background_color: { rgb: [245, 245, 245] } },
size: '1024x1024',
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv4-1",
"input": {
"prompt": "A clean icon of a lightning bolt",
"controls": {
"background_color": {
"rgb": [
245,
245,
245
]
}
},
"size": "1024x1024"
}
}'

{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1/background-color.png"
},
"state": "Completed"
}
</details>
Parameters
prompt
stringrequired
size
string
style
string
substyle
string
▶controls{}
object
image
string
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/recraft/recraftv4-1/#page","headline":"Recraft V4.1","description":"Recraft V4.1 generates art-directed images tuned for high aesthetics, with strong composition, accurate text rendering, and refined design taste. Fast and cost-efficient at standard resolution.","url":"https://developers.cloudflare.com/ai/models/recraft/recraftv4-1/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Recraft V4.1 Flash is Recraft's fastest and lowest-cost image model, generating a 1K raster image in about 1.3 seconds with quality close to Recraft V4.1. Built for high-volume generation and rapid iteration, with strong results for photography, portraits, atmospheric scenes, mixed media, and logo concepts. It outputs raster images only and does not support styles. title: Recraft V4.1 Flash image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

