- Third-party
- Zero data retention
Recraft V4.1 Utility is a general-purpose text-to-image model balancing quality and flexibility for a wide range of everyday use cases at standard resolution.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Zero data retention | Yes |
| Pricing | View pricing in the Cloudflare dashboard ↗ |
Usage
const response = await env.AI.run(
'recraft/recraftv4-1-utility',
{ prompt: 'A friendly cartoon robot waving hello against a white background' },
)
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-utility",
"input": {
"prompt": "A friendly cartoon robot waving hello against a white background"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility/simple-generation.png"
},
"state": "Completed"
}Examples
Product Mockup — Generate a product concept image
const response = await env.AI.run(
'recraft/recraftv4-1-utility',
{ prompt: 'A clean product photo of a white ceramic coffee mug on a wooden table' },
)
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-utility",
"input": {
"prompt": "A clean product photo of a white ceramic coffee mug on a wooden table"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility/product-mockup.png"
},
"state": "Completed"
}Custom Size — Specify output dimensions
const response = await env.AI.run(
'recraft/recraftv4-1-utility',
{
prompt: 'A simple banner illustration with abstract shapes and warm colors',
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-utility",
"input": {
"prompt": "A simple banner illustration with abstract shapes and warm colors",
"size": "1024x1024"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility/custom-size.png"
},
"state": "Completed"
}With Color Controls — Guide generation with specific colors
const response = await env.AI.run(
'recraft/recraftv4-1-utility',
{
prompt: 'A flat illustration of a globe with network connections',
controls: { colors: [{ rgb: [30, 90, 200] }, { rgb: [255, 255, 255] }] },
},
)
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-utility",
"input": {
"prompt": "A flat illustration of a globe with network connections",
"controls": {
"colors": [
{
"rgb": [
30,
90,
200
]
},
{
"rgb": [
255,
255,
255
]
}
]
}
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility/with-color-controls.png"
},
"state": "Completed"
}Background Color — Set a specific background color
const response = await env.AI.run(
'recraft/recraftv4-1-utility',
{
prompt: 'A simple icon of a checkmark inside a circle',
controls: { background_color: { rgb: [240, 248, 255] } },
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-utility",
"input": {
"prompt": "A simple icon of a checkmark inside a circle",
"controls": {
"background_color": {
"rgb": [
240,
248,
255
]
}
},
"size": "1024x1024"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility/background-color.png"
},
"state": "Completed"
}Parameters
prompt
stringrequiredsize
stringstyle
stringsubstyle
string▶controls{}
objectimage
string