Skip to content

Recraft 20b

POST/v1/run

Recraft 20b is Recraft's advanced text-to-image AI model. Create photorealistic images, illustrations, and concept art from natural language descriptions with exceptional detail and prompt adherence.

Request body

Submit an async generation request. The model field selects the model; other fields are model-specific input parameters.

stringmodelrequired

Model identifier. Set to recraft/recraft-20b.

Default: recraft/recraft-20b

stringpromptrequired

Text prompt that describes the image or asset to generate.

Optional<string>aspect_ratio

The aspect ratio of the generated image.

Allowed values: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16

Optional<string>style

The style of the generated images. Vector images cost 2X as much.

Allowed values: any, realistic_image, digital_illustration, vector_illustration, realistic_image/b_and_w, realistic_image/enterprise, realistic_image/hard_flash, realistic_image/hdr, realistic_image/motion_blur, realistic_image/natural_light, realistic_image/studio_portrait, digital_illustration/2d_art_poster, digital_illustration/2d_art_poster_2, digital_illustration/3d, digital_illustration/80s, digital_illustration/engraving_color, digital_illustration/glow, digital_illustration/grain, digital_illustration/hand_drawn, digital_illustration/hand_drawn_outline, digital_illustration/handmade_3d, digital_illustration/infantile_sketch, digital_illustration/kawaii, digital_illustration/pixel_art, digital_illustration/psychedelic, digital_illustration/seamless, digital_illustration/voxel, digital_illustration/watercolor, vector_illustration/cartoon, vector_illustration/doodle_line_art, vector_illustration/engraving, vector_illustration/flat_2, vector_illustration/kawaii, vector_illustration/line_art, vector_illustration/line_circuit, vector_illustration/linocut, vector_illustration/seamless

Default: realistic_image

Optional<array<object>>colors

An array of preferable colors

Default:

Optional<string>style_id

The ID of the custom style reference (optional)

Response Schema

The submit endpoint returns an accepted generation task. Poll the result endpoint with the returned id for terminal outputs or errors.

Optional<string>error

Error message if the task failed. Empty on success.

stringidrequired

Unique identifier for the generation task.

Optional<string>model

Model ID used for the prediction.

Optional<array>outputs

Array of generated content. Empty when status is not completed.

stringstatusrequired

Status of the task: pending, running, completed, failed, or timeout.

Allowed values: pending, running, completed, failed, timeout

Model capabilities

array<string>capability_tagsrequired

Capabilities declared by the model registry.

Default: text-to-image

stringexecution_moderequired

Execution mode declared by the model registry.

Default: async