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
A user may create multiple API tokens; however, all tokens share the same API units balance.
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: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.Realistic
Realistic
Images of style “realistic” are expected to look like just ordinary photographs made with a digital camera or a smartphone or a film camera.%201.png)

%201.png)

Digital illustration
Digital illustration
Images of style “digital illustration” are pictures drawn by hand or using computers - virtually everything except photos and vector illustrations. The most crucial difference from “realistic images” is that illustrations possess simplified textures (like in 3D-rendered or manually drawn images) - or they are stylized in a certain creative way. The difference from “vector illustration” is that “digital illustrations” allow for more complex color transitions, shades, fine textures..png)

.png)

Vector illustration
Vector illustration
Images of style “vector illustration” are expected to look like those drawn using vector graphics (see Wikipedia). Usually, they use only a few different colors at once, shapes are filled with flat colors or simple color gradients. Shapes of objects can be arbitrarily complex.%202.png)

%202.png)

Icon
Icon
Images of style “icon” are small digital images or symbols used in the graphical user interface. They are designed to be simple and recognizable at small sizes, often visually summarizing the action or object they stand for, or they can act as the visual identity for an app or a website and are crucial in branding.


