- Third-party
- Zero data retention
Generate production-ready SVG vector graphics from text prompts with a general-purpose model suited for a wide range of design and illustration tasks.
| 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-vector',
{ prompt: 'A simple flat icon of a calendar with a date marked' },
)
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-vector",
"input": {
"prompt": "A simple flat icon of a calendar with a date marked"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility-vector/simple-icon.jpg"
},
"state": "Completed"
}Examples
App Icon — Mobile app icon in vector format
const response = await env.AI.run(
'recraft/recraftv4-1-utility-vector',
{ prompt: 'A clean app icon featuring a magnifying glass over a document', 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-vector",
"input": {
"prompt": "A clean app icon featuring a magnifying glass over a document",
"size": "1024x1024"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility-vector/app-icon.jpg"
},
"state": "Completed"
}Illustration — Vector illustration for general use
const response = await env.AI.run(
'recraft/recraftv4-1-utility-vector',
{
prompt:
'A flat vector illustration of a team of people collaborating around a table with laptops',
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-vector",
"input": {
"prompt": "A flat vector illustration of a team of people collaborating around a table with laptops",
"size": "1024x1024"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility-vector/illustration.jpg"
},
"state": "Completed"
}With Brand Colors — Vector with specific color palette
const response = await env.AI.run(
'recraft/recraftv4-1-utility-vector',
{
prompt: 'A simple shield icon representing protection and security',
controls: {
background_color: { rgb: [245, 245, 245] },
colors: [{ rgb: [34, 139, 87] }, { 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-vector",
"input": {
"prompt": "A simple shield icon representing protection and security",
"controls": {
"background_color": {
"rgb": [
245,
245,
245
]
},
"colors": [
{
"rgb": [
34,
139,
87
]
},
{
"rgb": [
255,
255,
255
]
}
]
}
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-1-utility-vector/with-brand-colors.jpg"
},
"state": "Completed"
}Parameters
prompt
stringrequiredsize
stringstyle
stringsubstyle
string▶controls{}
objectimage
string