Skip to main content
recraft avatar

Recraft V4 API

recraft/v4/text-to-vector

Generate a true scalable vector (SVG) graphic from a text prompt — ideal for logos, icons, and brand illustrations that stay crisp at any size.

0.08

Model Input

Input

The text description of the vector graphic to generate (e.g. a logo, icon, or illustration). Output is a scalable SVG.

The size/aspect of the generated vector graphic. Pick a preset or supply an explicit width/height.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Generated image output
Generated in 16.297 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2Example output 3Example output 4

Recraft V4 API

Recraft V4 is a text-to-image AI model by recraft. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.08 per image.

POST https://queue.modelrunner.run/recraft/v4/text-to-vector

cURL

# Submit a request to the queue
curl -X POST https://queue.modelrunner.run/recraft/v4/text-to-vector \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "a friendly line-art owl mascot icon perched on a branch, single bold outline, flat two-tone vector illustration",
      "image_size": "square"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/recraft/v4/text-to-vector/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/recraft/v4/text-to-vector/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("recraft/v4/text-to-vector", {
  input: {
    "prompt": "a friendly line-art owl mascot icon perched on a branch, single bold outline, flat two-tone vector illustration",
    "image_size": "square"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/recraft/v4/text-to-vector",
    headers=headers,
    json={"input": {
      "prompt": "a friendly line-art owl mascot icon perched on a branch, single bold outline, flat two-tone vector illustration",
      "image_size": "square"
    }},
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
promptstringyesThe text description of the vector graphic to generate (e.g. a logo, icon, or illustration). Output is a scalable SVG.
image_sizeenumnoThe size/aspect of the generated vector graphic. Pick a preset or supply an explicit width/height. Default: "square_hd".

Machine-readable: OpenAPI schema · llms.txt

Use Recraft V4 from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Recraft V4 becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint recraft/v4/text-to-vector.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run recraft/v4/text-to-vector on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

Recraft V4 turns a text prompt into a true vector graphic — a scalable SVG file rather than a raster image. It is a dedicated vector generator built for design work: logos, icons, brand marks, and flat illustrations that stay crisp at any size, from a favicon to a billboard. Because the output is real SVG, you can open it in any vector editor to recolor, resize, or refine paths without quality loss. The vector aesthetic is baked into the model, so you just describe what you want — there is no style or substyle picker to configure.

## Best for - Logos, wordmarks, and app icons that must scale cleanly and stay editable as SVG - Flat-design illustrations, stickers, and spot graphics for brand and marketing assets - Icon sets and pictograms where consistent, geometric vector shapes matter - Print-ready artwork (posters, packaging, signage) that needs infinite scalability - Design elements you plan to recolor or tweak afterward in a vector editor

## Choose another model when - You want a photoreal or painterly raster image rather than flat vector art — use a general text-to-image model - You already have a raster logo or sketch and just need it traced to SVG — use an image vectorizer (`recraft/vectorize`) - You need to edit or restyle an existing image rather than generate from text — use an image-to-image model - You need a large library of named art styles or substyles — use `recraft/v3/text-to-image`, which exposes a style picker

## Tips - Describe the graphic in flat-design terms ("flat vector", "line icon", "minimal geometric", "two-color") to match the SVG output the model is built for - Keep prompts focused on a single clear subject; simple, iconic compositions vectorize best - Set framing with `image_size` (e.g. `square_hd` for icons/logos, `landscape_16_9` for banners) - Open the returned `.svg` in a vector editor to recolor or resize with no quality loss

## Limitations - Returns a single graphic per request; there is no batch or variation count - No seed control, so exact runs are not reproducible - Best suited to clean, iconic vector art — highly detailed or photoreal scenes are outside its design - Fine, precisely spelled in-image text can still be imperfect

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("recraft/v4/text-to-vector", { input: { prompt: "a minimalist geometric fox logo, two colors, flat vector", image_size: "square_hd", }, }); ```