Welcome to Recraft image generation and editing API. Learn the basics of the Recraft API, including raster and vector image generation, style creation, image generation in your brand style and colors, image vectorization, and background removal. Authenticate and interact with our API in a matter of minutes.

Authentication

We use Bearer API tokens for authentication. To access your API key, log in to Recraft, enter your profile and hit ‘Generate’ (available only if your API units balance is above zero). All requests should include your API key in an Authorization HTTP header as follows:

Authorization: Bearer RECRAFT_API_TOKEN

REST / Python Library

The Recraft API adheres to REST principles, allowing you to interact using any utilities (e.g., curl), programming languages, or libraries of your choice. One of the easiest of available alternatives is OpenAI Python library which is also compatible with Recraft API, but it’s important to remember that not all parameters/options are supported or implemented. Additionally, some parameters may have different meanings, or they may be quietly ignored if they are not applicable to the Recraft API. Future examples will be shown using that library, for example, once installed, you can use the following code to be authenticated:
from openai import OpenAI

client = OpenAI(
    base_url='https://external.api.recraft.ai/v1',
    api_key=<TOKEN>,
)

Features

Styles

A style is a descriptor that defines the visual appearance and feel of generated images. This includes a wide array of elements such as textures and visual effects, shapes and colors, composition and lines, etc. There are four classes of base styles: realistic image, digital illustration, vector illustration and icon.
A style can be refined by adding a substyle for more precise definition. Below, you will find a list of supported styles and corresponding substyles. Please note that the available styles and substyles may vary depending on the model. Additionally, you have an option to create your own style by combining a base style (e.g. realistic image, digital illustration, vector illustration or icon) with a collection of reference images.\

Models

Recraft developed two powerful models: Recraft V2 (also known as Recraft 20B) and Recraft V3. The Recraft V2 model was released in February 2024 and was the first AI model built specifically for designers. It allowed them to create both vector and raster images that are anatomically perfect, maintain consistent brand style and also iterate with ultimate control and precision. In October 2024 the new model was introduced - Recraft V3. Our team trained a new SOTA model from scratch and set a new standard for excellence in image generation. Recraft V3 participated in the Hugging Face’s industry-leading Text-to-Image Model Leaderboard by Artificial Analysis. It secured #1 place with ELO rating of 1172. Now both models are available through the Recraft API.