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 Last updated November 13, 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 is the whole pitch, and it puts Recraft in a different category from pixel-only models like Flux or Stable Diffusion. Our AI image API guide covers the pixel side of the landscape if you want the broader picture before diving into Recraft specifically.

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 well-known pixel-only 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 pixel image traced into SVG after the fact. Our Flux API guide and Stable Diffusion API guide are good points of comparison if you want to see how pixel-only models handle the same kind of request.

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 are generating assets that all need to look like they came from the same brand. Our guide on using reference images in AI image generation covers this technique in more general terms.

There is a dedicated model for this. V4 Styles matches a look from 1 to 10 reference images, and it is cheaper for vector work than the flagship line, at $0.05 per vector image against $0.08. One billing detail to watch: generating with style references also creates a saved style, which adds $0.005 per request. That is small on its own, but it is charged every time unless you create the style once and reuse its ID.

Recraft V4.1 capabilities

V4.1 is Recraft's current default model, with sharper output, better object understanding, and parameters like rgb_colors and background_rgb_color for direct palette control. It ships in two lines, V4.1 and V4.1 Utility, each with a standard tier and a 2K Pro tier. There is also V4.1 Flash, a raster-only model that runs in roughly 1.3 seconds at $0.007 per image, which is by far the cheapest way to generate on the platform when you do not need vector output.

The older V3 and V2 lines are still available, but only V2 is actually cheaper than the current flagship, at $0.022 per raster image and $0.044 per vector. V3 costs $0.04 per raster image, which is more than V4.1's $0.035, so there is no price reason to reach for it. V3 is still worth knowing about for a different reason: it is the only model that supports the editing operations, covered below.

Editing operations are V3 only

Image-to-image, inpainting (regenerating a masked area), outpainting (extending beyond the original edges), and background replacement all run through V3, not the newer models. Each costs $0.04 per raster image or $0.08 per vector image. If your pipeline depends on editing rather than fresh generation, plan around that constraint. Our AI image editing API guide covers how other providers handle the same operations.

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 do not expire, but purchases are non-refundable, so it is worth estimating your usage before topping up a large amount. Every response includes a credits field showing exactly what that request cost, which makes per-feature tracking straightforward.

Here is what generation costs per image. Multiply by 1,000 for API units, so $0.035 is 35 units.

ModelRasterVectorPro raster (2K)Pro vector
V4.1 Flash$0.007not availablenot availablenot available
V4.1 and V4.1 Utility$0.035$0.08$0.21$0.30
V4 Styles$0.035$0.05$0.10$0.12
V4$0.04$0.08$0.25$0.30
V3$0.04$0.08not availablenot available
V2$0.022$0.044not availablenot available

The utility endpoints are billed per request, and several are cheap enough to use freely in a pipeline.

OperationPriceAPI units
Erase region$0.0022
Crisp upscale$0.0044
Create style$0.0055
Vectorize image$0.0110
Remove background$0.0110
Enhance prompt$0.0110
Vectorize image (v1_pro)$0.0440
Remix image$0.0440
Enhance details (V4.1 Pro)$0.21210
Creative upscale$0.25250

On the standard tiers, vector output costs about twice its raster equivalent. That gap narrows on V4 Styles and the Pro tiers, where vector is closer to 1.4 times the raster price. Note too that vectorizing an existing PNG costs only $0.01, so if you already have a raster image you like, converting it is far cheaper than regenerating in vector. Our breakdown of AI image API pricing puts these numbers next to other providers, and it is always worth checking the official Recraft pricing page before budgeting, since rates change.

Authentication and API Access

Recraft uses a bearer token for authentication. Log into your Recraft account, open the API tokens page, and create a token. You can create several tokens for different environments, but they all draw on the same account balance, so a runaway script on a staging key spends the same units as production. Keep tokens on your server, never in client-side code, as our guide to AI media API security best practices explains. Every request needs the token in the Authorization header.

bash
export RECRAFT_API_TOKEN=your_token

# Then in every request:
Authorization: Bearer $RECRAFT_API_TOKEN

It is a standard REST API, and it is compatible with the OpenAI Python library's image generation interface, so if you already have that library installed, you can point it at Recraft's base URL and use it directly.

python
import os

from openai import OpenAI

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

Working Code Example

Here is a plain HTTP example generating a vector icon with Python's requests library, no OpenAI client needed. Generation is synchronous, so there is no job to poll.

python
import os
import requests

token = os.environ["RECRAFT_API_TOKEN"]

response = requests.post(
    "https://external.api.recraft.ai/v1/images/generations",
    headers={
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
    },
    json={
        "prompt": "a minimalist coffee cup icon, single color, clean geometric lines",
        "model": "recraftv4_1_vector",
        "size": "1024x1024",
        "response_format": "url",
    },
    timeout=(10, 120),
)
if not response.ok:
    raise SystemExit(f"{response.status_code}: {response.text}")

result = response.json()
print("Units used:", result["credits"])

# The URL expires after about 24 hours, so download the file now
svg_url = result["data"][0]["url"]
with open("coffee-cup.svg", "wb") as f:
    f.write(requests.get(svg_url, timeout=(10, 60)).content)

That download step matters. Recraft returns a hosted link that stays valid for roughly 24 hours, so anything you want to keep has to be saved to your own storage. Set response_format to return encoded image data instead if you would rather skip the second request. Swap model to recraftv4_1 for a standard raster image, or add a style value such as vector_illustration/line_art to steer the look more specifically.

If your project also needs photorealistic raster generation from models like Flux or Nano Banana alongside Recraft's vector work, a unified API such as Apiframe can cover that side of the pipeline under one key, which is worth knowing if you are stitching together multiple image APIs for a single product. Our roundup of AI image generation APIs covers how several of these compare side by side.

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 pixel image you would have to trace by hand afterward. If the output is going on a product or a storefront, our guide to copyright and commercial rights for AI-generated art is worth reading first.

Brand asset libraries. Lock a color palette and style, then batch-generate icon sets, illustrations, or marketing graphics that all match without manual cleanup. Our guide on keeping AI-generated characters consistent across images covers the same problem for figures and mascots.

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 a vector model such as recraftv4_1_vector or the vector_illustration style), Recraft returns actual vector files with editable paths, not a pixel image with an SVG wrapper.

Is there a free tier?

Not really, on the API side. Units must be purchased upfront and do not 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. Our guide to free AI image generation APIs rounds up providers that do offer meaningful trial credits, if that matters for your evaluation process.

What is the cheapest way to generate with Recraft?

For raster, V4.1 Flash at $0.007 per image, which is roughly a fifth of the standard V4.1 price and fast enough for high-volume work. For vector, V2 at $0.044 per image, though quality is lower than the current models. A middle path is generating raster on a cheap model and running the $0.01 vectorize endpoint on the results.

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

Ideogram is generally stronger at rendering legible text inside a pixel image. Recraft's strength is structural: clean vector geometry and brand consistency, rather than typography accuracy inside the image itself. If your priority is a poster with perfect lettering, see our Ideogram API guide, or our comparison of GPT Image 2 providers for strong general-purpose options. 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 model and style you specify in the request, not a separate endpoint.

If vector output is not the deciding factor for your project, our roundup of the best AI image generator APIs compares the wider field, or you can get an Apiframe API key and start with free credits.

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.