Skip to content
Recraft logo

Recraft V4 Vector

Text-to-ImageRecraftProxied

Generate production-ready SVG vector graphics from text prompts with clean geometry, structured layers, and editable paths.

Model Info
Terms and Licenselink
More informationlink

Usage

TypeScript
const response = await env.AI.run(
'recraft/recraftv4-vector',
{
prompt: 'A simple flat icon of a coffee cup with steam rising',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Simple Icon

Examples

App Icon — Mobile app icon in vector format
TypeScript
const response = await env.AI.run(
'recraft/recraftv4-vector',
{
prompt:
'A colorful gradient app icon featuring a chat bubble with a sparkle effect',
size: '1024x1024',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 App Icon
Illustration — Vector illustration for web use
TypeScript
const response = await env.AI.run(
'recraft/recraftv4-vector',
{
prompt:
'A flat vector illustration of a person working at a desk with a computer, plants, and a window showing a city view',
size: '1024x1024',
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 Illustration
With Brand Colors — Vector with specific color palette
TypeScript
const response = await env.AI.run(
'recraft/recraftv4-vector',
{
prompt:
'A badge or seal design with a star in the center, suitable for a certification mark',
controls: {
colors: [
{
rgb: [0, 119, 182],
},
{
rgb: [255, 209, 102],
},
],
background_color: {
rgb: [255, 255, 255],
},
},
},
{
gateway: { id: 'default' },
}
)
console.log(response)
Response 200 With Brand Colors

Parameters

prompt
stringrequired
size
string
style
string
substyle
string

API Schemas

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"prompt": {
"type": "string"
},
"size": {
"type": "string"
},
"style": {
"type": "string"
},
"substyle": {
"type": "string"
},
"controls": {
"type": "object",
"properties": {
"colors": {
"maxItems": 5,
"type": "array",
"items": {
"type": "object",
"properties": {
"rgb": {
"minItems": 3,
"maxItems": 3,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
"required": [
"rgb"
],
"additionalProperties": false
}
},
"background_color": {
"type": "object",
"properties": {
"rgb": {
"minItems": 3,
"maxItems": 3,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
}
}
},
"required": [
"rgb"
],
"additionalProperties": false
}
},
"additionalProperties": false
}
},
"required": [
"prompt"
],
"additionalProperties": false
}