Skip to main content
Generate your first image with the Recraft API in about two minutes.
1

Get an API token

Log in to Recraft, open your profile page, and select Generate. Generating a token needs a positive API units balance; buy units first if you have none. You can create several tokens, and they all share one balance.
2

Save it as an environment variable

Every example in these docs reads the token from RECRAFT_API_TOKEN.
3

Make a request

Without a model, the request uses Recraft V4.1 at $0.035 per image.
4

Get the image

The response lists the generated images:
Download the file from data[0].url: image URLs are temporary and files are kept for about 24 hours. credits is the number of API units the request cost.

Authentication

All requests authenticate with a Bearer token in the Authorization header:
The base URL is https://external.api.recraft.ai/v1. The API follows REST principles, so any HTTP client works. To use the OpenAI Python library instead, see Clients and SDKs.

Next steps

Choose a model

Compare every model by price, output, and best use case.

Fast generation

About 1.3 seconds and $0.007 per image with V4.1 Flash.

Vector output

Get editable SVG with a _vector model.

Generate in a style

Match a style from your own reference images.

Edit images

Image to image, inpainting, vectorizing, upscaling, and more.

Use with AI tools

Give Claude, ChatGPT, or Cursor the docs to write your integration.

All operations

The API also covers: An interactive Swagger reference is also available.