Recraft V4 SVG
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 ↗ |
| Pricing | View pricing in the Cloudflare dashboard ↗ |
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){ "state": "Completed", "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-vector/simple-icon.jpg" }, "gatewayMetadata": { "keySource": "Unified" }}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){ "state": "Completed", "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-vector/app-icon.jpg" }, "gatewayMetadata": { "keySource": "Unified" }}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)
{ "state": "Completed", "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-vector/illustration.jpg" }, "gatewayMetadata": { "keySource": "Unified" }}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)
{ "state": "Completed", "result": { "image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4-vector/with-brand-colors.jpg" }, "gatewayMetadata": { "keySource": "Unified" }}Parameters
stringrequiredstringstringstringobjectstring