Documentation Index
Fetch the complete documentation index at: https://www.recraft.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Generate AI images using cURL or Python and create your own styles programmatically.
Generate a raster image using Recraft V4 model
curl https://external.api.recraft.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "two race cars on a track",
"model": "recraftv4"
}'
Generate a vector image using Recraft V4 Vector model
curl https://external.api.recraft.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "cat on a mat",
"model": "recraftv4_vector"
}'
Generate a realistic image by Recraft V3 with specific size
curl https://external.api.recraft.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "red point siamese cat",
"model": "recraftv3",
"style": "Photorealism",
"size": "1280x1024"
}'
Generate a digital illustration by Recraft V3 with specific style
curl https://external.api.recraft.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "a monster with lots of hands",
"style": "Hand-drawn"
}'
Image to image by Recraft V3 with digital illustration style
curl -X POST https://external.api.recraft.ai/v1/images/imageToImage \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "image=@image.png" \
-F "prompt=winter" \
-F "strength=0.2" \
-F "style=Illustration"
Inpaint an image by Recraft V3 with style Enterprise
curl -X POST https://external.api.recraft.ai/v1/images/inpaint \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "prompt=moon" \
-F "style=Enterprise" \
-F "image=@image.png" -F "mask=@mask.png"
Create own Recraft V3 style by uploading reference images and use them for generation
curl -X POST https://external.api.recraft.ai/v1/styles \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "style=digital_illustration" \
-F "file=@image.png"
# response: {"id":"095b9f9d-f06f-4b4e-9bb2-d4f823203427"}
curl https://external.api.recraft.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "wood potato masher",
"style_id": "095b9f9d-f06f-4b4e-9bb2-d4f823203427"
}'
curl -X POST https://external.api.recraft.ai/v1/images/vectorize \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "file=@image.png"
Remove background from a PNG image, get the result in B64 JSON
curl -X POST https://external.api.recraft.ai/v1/images/removeBackground \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "response_format=b64_json" \
-F "file=@image.png"
curl -X POST https://external.api.recraft.ai/v1/images/crispUpscale \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "response_format=b64_json" \
-F "file=@image.png"
curl -X POST https://external.api.recraft.ai/v1/images/creativeUpscale \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "file=@image.png"
curl -X POST https://external.api.recraft.ai/v1/images/variateImage \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-F "response_format=url" \
-F "size=1024x1024" \
-F "n=1" \
-F "seed=13191922" \
-F "image_format=webp" \
-F "file=@image.png"
Explore images
curl https://external.api.recraft.ai/v1/images/explore \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"prompt": "race car on a track",
"model": "recraftv4"
}'
Explore similar images
curl https://external.api.recraft.ai/v1/images/explore/similar \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RECRAFT_API_TOKEN" \
-d '{
"source_image_id": "c18a1988-45e7-4c00-82c4-4ad7d3dbce3a",
"similarity": 3
}'