Recraft V4 Vector
Text-to-Image • Recraft • ProxiedGenerate production-ready SVG vector graphics from text prompts with clean geometry, structured layers, and editable paths.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
Usage
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)Examples
App Icon — Mobile app icon in vector format
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)Illustration — Vector illustration for web use
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)With Brand Colors — Vector with specific color palette
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)Parameters
stringrequiredstringstringstringobjectstringformat: uricontentMediaType: image/svg+xmlAPI 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}{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "image": { "type": "string", "format": "uri", "contentMediaType": "image/svg+xml" } }, "required": [ "image" ], "additionalProperties": false}