Recraft V4 Pro · OpenAI-compatible images
POST /images/generations accepts the OpenAI images API, so the OpenAI SDKs, LobeChat, Cherry Studio, Dify and n8n can use every image model here. size maps to the closest aspect_ratio, n to num_images, and any model parameter can be passed as an extra field. It waits up to ~110s; a slower task returns 504 with its id to poll.
/api/v1/images/generationsBearer API keyEndpoints for this model
/generationsCreate a generationPOST/images/generationsOpenAI-compatible imagesGET/generations/{id}Get the resultPOST/generations/{id}/cancelCancel a taskPOST/quoteQuoteGET/models/{slug}Get one modelSelect a provider to see its effective parameter limits. Automatic routing chooses a provider that supports your input. Examples include defaults and required inputs; replace example media URLs with accessible files.
Input parameters
JSON bodymodelstringRequiredModel slug from the catalog. Project keys may use a project-specific model slug.
Allowed values:"recraft-v4-pro"promptstringRequiredText describing the requested image. Required and non-empty.
providerstringOptionalOptional provider slug. Omit for automatic routing; project settings may pin the provider.
projectstringOptionalOptional project ID. Use its published model catalog and routing configuration.
sizestringOptionalWidth x height, such as 1024x1024, or auto. Maps to the nearest supported aspect ratio when needed.
nintegerOptionalPositive integer, default 1. Multiple images require the model to support num_images.
Default:1Minimum:1response_formatstringOptionalurl (default) or b64_json. If base64 conversion fails or exceeds the size limit, that item falls back to a URL.
Default:"url"Allowed values:"url""b64_json"aspect_ratioenumOptional- Default:
"1:1"Allowed values:"1:1""16:9""9:16""4:3""3:4""3:2""2:3"
Response fields
createdintegerUnix timestamp in seconds.
dataarrayEach item has url or b64_json depending on response_format and conversion availability.
idstringGeneration ID returned by the create request.
modelstringModel slug from the catalog. Project keys may use a project-specific model slug.
creditsnumberCredits charged for this generation; zero after a refund.
Usage notes
- Poll at intervals of at least 3 seconds. A 504 from the synchronous image endpoint means the task may still be running: poll its error.id instead of submitting it again.
- For /generations and /quote, put these parameters inside input. For /images/generations, put them at the top level. Chat parameters go at the top level of /chat/completions.
Request
curl 'https://01router.com/api/v1/images/generations' \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "recraft-v4-pro",
"prompt": "A cinematic landscape at sunrise.",
"aspect_ratio": "1:1"
}'Response example
{
"created": 1792915200,
"data": [
{
"url": "https://example.com/result.png"
}
],
"id": "gen_example",
"model": "recraft-v4-pro",
"credits": 10
}Responses are illustrative. IDs, usage, prices and results depend on the actual request.
Use with AI
Give your coding assistant the documentation index or the full API reference, including live model parameters.