Recraft AI Recraft V4 Style Text To Image API Documentation

Recraft AI Recraft V4 Style Text To Image API Documentation

Playground

Try it on WaveSpeedAI!

Recraft V4 Style Text-to-Image generates styled images from text prompts using either a reusable style ID or reference images, enabling consistent visual direction for brand assets, design systems, marketing visuals, social content, and creative production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Recraft V4 Style Text-to-Image generates images from text prompts using either a reusable style_id or temporary style reference images. Use it to create visually consistent image assets with controllable aspect ratio and style matching.


Why Choose This?

  • Text-to-image generation
    Generate images directly from natural-language prompts.

  • Reusable style support
    Use a style_id created by the matching Create Style model to keep a consistent visual style.

  • Reference-image style input
    Provide reference images to create a style for the current request when no style_id is supplied.

  • Style match control
    Choose precise for closer style matching or flexible for broader interpretation.

  • Multiple aspect ratios
    Generate square, portrait, landscape, and vertical image outputs.


Parameters

ParameterRequiredDescription
promptYesDescribe the image to generate.
imagesNoStyle reference images used to create a style for this request when no style_id is supplied. Supports up to 10 image URLs.
aspect_ratioNoOutput aspect ratio: 1:1, 4:3, 3:4, 16:9, or 9:16. Default: 1:1.
style_idNoReusable style ID created by the matching Create Style model.
style_matchNoControls how closely the result follows the supplied style: precise or flexible. Default: precise.

How to Use

  1. Write your prompt — Describe the subject, scene, composition, and visual direction.
  2. Add style input — Provide a matching style_id, or upload reference images to create a temporary style for this request.
  3. Choose aspect ratio — Select 1:1, 4:3, 3:4, 16:9, or 9:16.
  4. Set style match optional — Use precise for closer matching or flexible for broader style interpretation.
  5. Submit — Generate the styled image output.

Pricing

Pricing starts at $0.0385 per request. If style reference images are provided, an additional $0.0055 is added.

ConfigurationCost
Text-to-image with style_id or no reference images$0.0385
Text-to-image with reference images$0.044

aspect_ratio, style_id, and style_match do not add separate charges.


Best Use Cases

  • Styled image generation — Generate images with reusable or request-specific style guidance.
  • Brand asset creation — Create consistent visuals for campaigns, social media, and marketing materials.
  • Reusable style workflows — Use a saved style_id to keep a consistent look across multiple generations.
  • Style exploration — Upload reference images to test a style without creating a permanent style first.
  • Creative production — Generate polished visuals for design, advertising, and content workflows.

Pro Tips

  • Use a matching style_id when you need consistent output across multiple generations.
  • Use reference images when you want to create a style for the current request only.
  • Use precise when style consistency is more important.
  • Use flexible when you want more creative variation.
  • Keep prompts focused on the subject, composition, and visual style.
  • Use 16:9 for wide layouts and 9:16 for vertical designs.

Notes

  • The style_id must be used with the matching model version.
  • Use a standard Recraft V4 style_id only with recraft-v4-style models.
  • Use a Recraft V4 Style Pro style_id only with recraft-v4-style-pro models.
  • Do not mix standard and Pro style IDs across model versions.
  • Either images or style_id must be provided. Use style_id for a reusable saved style, or images to create a temporary style for the current request.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "prompt": "A cinematic ocean wave at sunrise, highly detailed",
  "aspect_ratio": "1:1",
  "style_match": "precise"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/recraft-ai/recraft-v4-style/text-to-image" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    *) sleep 2 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
promptstringYes-Describe the image or vector graphic to generate.
imagesarray<string>No-0 ~ 10 itemsUsed to create a style for this request when no style_id is supplied.
aspect_ratiostringNo1:11:1, 4:3, 3:4, 16:9, 9:16-
style_idstringNo--A reusable style ID created by the matching Create Style model.
style_matchstringNopreciseprecise, flexibleOptionally control how closely the result follows the supplied style.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.