Krea V2 Medium Text To Image API Documentation

Krea V2 Medium Text To Image API Documentation

Playground

Try it on WaveSpeedAI!

Krea 2 Medium Text to Image is a fast AI image generation model that creates high-quality images from text prompts with aspect ratio, creativity, and optional style reference controls. Ready-to-use REST inference API for creative design, marketing visuals, product mockups, brand assets, social media content, rapid ideation, and professional text-to-image workflows with simple integration, no coldstarts, and affordable pricing.

Features

WaveSpeed AI Krea V2 Medium Text-to-Image generates high-quality images from natural-language prompts, with optional reference images for stronger style guidance. It is designed for prompt-based image generation workflows where you want flexible aspect ratios, controllable creativity, and the option to steer the final look with one or more visual references.


Why Choose This?

  • High-quality text-to-image generation
    Create polished images from detailed natural-language prompts.

  • Flexible aspect ratios
    Choose from multiple preset aspect ratios for square, portrait, landscape, or cinematic compositions.

  • Production-ready workflow
    Suitable for concept art, marketing visuals, brand creatives, editorial imagery, and visual ideation.


Parameters

ParameterRequiredDescription
promptYesText description of the image to generate. Supports 1–5000 characters.
sizeNoOutput aspect ratio. Supported values: 1:1, 4:3, 3:2, 16:9, 2.35:1, 4:5, 2:3, 9:16. Default: 1:1.

How to Use

  1. Write your prompt — describe the subject, style, lighting, composition, and mood you want.
  2. Choose aspect ratio (optional) — select the format that best fits your target use case.
  3. Submit — run the model and download the generated image.

Example Prompt

A premium editorial portrait of a woman in soft window light, natural skin texture, elegant neutral wardrobe, cinematic depth of field, refined luxury-magazine styling


Pricing

Just $0.03 per image.


Best Use Cases

  • Prompt-based concept generation — Explore visual directions from text prompts alone.
  • Style-guided image creation — Use reference images to steer the output toward a desired aesthetic.
  • Editorial and fashion visuals — Build polished, art-directed imagery with better style control.
  • Brand creative development — Keep generated visuals closer to an existing visual language.
  • Marketing and campaign ideation — Generate premium-looking assets for pitches, mockups, and content planning.

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",
  "output_format": "png"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/krea-v2-medium/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-Text prompt describing the image to generate.
aspect_ratiostringNo1:11:1, 4:3, 3:4, 16:9, 9:16Output aspect ratio.
output_formatstringNopngpng, jpegOutput image format.

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.