Skip to main content

Overview

Krea allows enterprises to enable Zero Data Retention. Currently Krea 2 Medium, Krea 2 Large and Krea 2 Medium Turbo on the public API are supported. Please contact sales@krea.ai ↗ to turn on for your workspace. Once you have enabled support, make a request like the following:
curl -X POST https://api.krea.ai/generate/image/krea/krea-2/medium \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-Api-Zero-Data-Retention: 1" \
  -d '{
    "prompt": "a serene mountain landscape at sunset",
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }'
Any URL provided, for example a style reference image, must be a base64 data URI. Using an external URL would result in a 422Zero data retention requires external asset inputs to be data URIs.
STYLE_REF_DATA_URI="data:image/png;base64,$(base64 < ./style-reference.png | tr -d '\n')"

curl -X POST https://api.krea.ai/generate/image/krea/krea-2/medium \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-Api-Zero-Data-Retention: 1" \
  -d '{
    "prompt": "a serene mountain landscape at sunset",
    "aspect_ratio": "1:1",
    "resolution": "1K",
    "image_style_references": [
      {
        "url": "'"$STYLE_REF_DATA_URI"'",
        "strength": 0.6
      }
    ]
  }'