Seedance 2.5 from ByteDance is officially available on Apiframe.

Recraft API Guide: Vector Graphics & Brand Assets by Code (2026)

How the Recraft API generates true vector graphics and brand assets: pricing, authentication, and a working code example for 2026.

Renaud Published August 12, 2026 August 12, 2026 · 6 min read Beginner
Recraft API Guide: Vector Graphics & Brand Assets by Code (2026)

Most AI image APIs give you pixels. Recraft is one of the few that will hand you an actual SVG file you can open in Figma or Illustrator and edit like a normal vector graphic. That's the whole pitch, and it's a genuinely different category of tool from pixel-based (raster)-only models like Flux or Stable Diffusion.

This guide covers what the Recraft API does, what makes it different, real pricing, and a working code example for generating a vector image.

What Is the Recraft API

Recraft is an image generation platform built specifically around design work: vector graphics, icon sets, logos, and brand-consistent output. Rather than treating "generate an image" as one generic task, Recraft is built to produce assets that behave like design files, not just pictures.

The API gives you programmatic access to the same generation engine behind Recraft's web app, so you can plug vector and raster generation into your own product, design tool, or content pipeline instead of generating images by hand.

What Makes Recraft Different From Other Image APIs

Vector (SVG) output alongside raster

This is the headline feature. Most image generation APIs, including the big standard pixel-based image file (like PNG or JPG) models like Flux, Stable Diffusion, and Ideogram, only ever output PNG or JPG files. Recraft can generate true vector output: clean paths, editable points and shapes, the kind of file a designer can actually open and modify, not a raster image traced into SVG after the fact.

Brand style and color palette controls

Recraft lets you lock in a visual language, a specific color palette, illustration style, or line weight, and apply it consistently across a batch of generations. You can also create a custom style from reference images and reuse it across future requests, which matters a lot if you're generating assets that all need to look like they came from the same brand.

Recraft V4.1 capabilities

Recraft's current flagship is V4.1, released in mid-2026, which sharpened output quality, improved object understanding, and added parameters like rgb_colors and background_rgb_color for direct palette control. It ships in two lines, V4.1 and V4.1 Utility, each available in a standard tier and a higher-resolution Pro tier. The older V3 line is still available through the API at a lower price point if you don't need the latest quality bump.

Recraft API Pricing in 2026

Recraft's API is billed on a prepaid credit system: you buy API units in advance ($1 buys 1,000 units), and each generation deducts units based on the operation and model. Units don't expire, but purchases are non-refundable, so it's worth estimating your usage before topping up a large amount.

Here's what the main operations cost as of this writing:

OperationCost per imageAPI units
Raster generation (V3 / V4)$0.0440
Raster generation (V4.1 / V4.1 Utility)$0.03535
Raster generation (V4.1 Pro / V4.1 Utility Pro)$0.21210
Raster generation (V4 Pro)$0.25250
Vector generation (V3 Vector)$0.0880
Vector generation (V4.1 Vector / V4.1 Utility Vector)$0.0880
Vector generation (V4.1 Pro Vector / V4 Pro Vector)$0.30300
Background removal$0.0110
Image vectorization$0.0110
Crisp upscale$0.0044
Creative upscale$0.25250

Vector generation costs roughly double raster at the same tier, which makes sense given it's the feature nobody else offers. Always check the official Recraft pricing page before budgeting, since these rates can change.

Authentication and API Access

Recraft uses a token for authentication (a Bearer token). Log into your Recraft account, open your profile's API settings, and generate a token (this requires your API unit balance to be above zero). Every request needs that token in the Authorization header:

bash
Authorization: Bearer RECRAFT_API_TOKEN

It's a standard web API, and it uses the same format as OpenAI's API for image generation, so if you already have the OpenAI Python library installed, you can point it at Recraft's web address and use it directly:

python
from openai import OpenAI

client = OpenAI(
    base_url="https://external.api.recraft.ai/v1",
    api_key="RECRAFT_API_TOKEN",
)

Working Code Example

Here's a plain HTTP example generating a vector icon set with Python's requests library, no OpenAI client needed:

python
import requests

RECRAFT_API_TOKEN = "your_recraft_api_token"

response = requests.post(
    "https://external.api.recraft.ai/v1/images/generations",
    headers={
        "Authorization": f"Bearer {RECRAFT_API_TOKEN}",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a minimalist coffee cup icon, single color, clean geometric lines",
        "style": "vector_illustration",
        "model": "recraftv3",
        "size": "1024x1024",
        "response_format": "url",
    },
)

result = response.json()
print(result["data"][0]["url"])

Swap style to a style variation like vector_illustration/line_art or vector_illustration/engraving for a more specific look, and drop "style": "vector_illustration" entirely if you just want a standard raster image instead. Generations return either a hosted URL or the image returned as encoded text data, depending on response_format.

If your project also needs photorealistic raster generation from models like Flux or Nano Banana alongside Recraft's vector work, an aggregator like Apiframe can cover that side of the pipeline under one key, which is worth knowing if you're stitching together multiple image APIs for a single product.

Best Use Cases for the Recraft API

Logo and icon generation. True vector output means logos come out as editable shapes (the building blocks of a vector graphic) instead of a raster image you'd have to trace by hand afterward.

Brand asset libraries. Lock a color palette and style, then batch-generate icon sets, illustrations, or marketing graphics that all match without manual cleanup.

Marketing templates. Generate background art, banners, and social graphics that stay on-brand across a campaign by reusing the same style reference.

UI illustration work. Vector output scales cleanly to any size, which matters for interface illustrations that need to look sharp at both small and large sizes.

FAQ

Does Recraft output true SVG files?

Yes, when you request vector generation (using the vector_illustration style or a vector-specific model variant), Recraft returns actual vector files with editable paths, not a raster image with an SVG wrapper.

Is there a free tier?

Not really, on the API side. Units must be purchased upfront and don't come with a rolling free allowance. Recraft's web app has a limited free plan for testing generations manually, but production API access requires a prepaid balance.

How does it compare to Ideogram for text-in-image needs?

Ideogram is generally stronger at rendering legible text inside a raster image. Recraft's strength is structural: clean vector geometry and brand consistency, not necessarily typography accuracy inside the image itself. If your priority is a poster with perfect lettering, Ideogram or Nano Banana Pro are usually the better fit; if your priority is an editable logo or icon file, Recraft is built for that specifically.

Can vector and raster outputs be requested from the same endpoint?

Yes. Both go through the same /v1/images/generations endpoint. Whether you get raster or vector output depends on which style and model variant you specify in the request, not a separate endpoint.

Power your next AI product with Apiframe.

Instant access to 70+ media models through a single API. Start free and scale when you're ready.