> ## Documentation Index
> Fetch the complete documentation index at: https://www.krea.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Zero Data Retention

> Включите Zero Data Retention в Krea API, чтобы запросы и эталонные изображения не сохранялись.

## Обзор

Krea позволяет предприятиям включать Zero Data Retention. В настоящее время в API поддерживаются Krea 2 Medium, Krea 2 Large и Krea 2 Medium Turbo. Чтобы включить эту функцию для вашего workspace, обратитесь в [sales@krea.ai ↗](mailto:sales@krea.ai). После того как поддержка будет включена, отправьте запрос примерно так:

```bash theme={null}
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"
  }'
```

<Note>
  Любой передаваемый URL, например изображение для стилевого референса, должен быть data URI в формате base64. Использование внешнего URL приведёт к ошибке `422` — `Zero data retention requires external asset inputs to be data URIs.`
</Note>

```bash theme={null}
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
      }
    ]
  }'
```
