# Zero data retention

Send a request only to providers that keep no prompts or answers, and know what the router itself stores.

**Zero data retention (ZDR)** means the provider that runs the model does not store your prompts and answers after it has answered, and does not train on them.

By default a request in the Global region may go to any provider of the model, including providers that log requests for a while or may use them to improve their models. To exclude them, ask for ZDR in the request.

## Request ZDR

Add `"provider": {"zdr": true}`:

```bash
curl https://router.nodul.ru/api/v1/chat/completions \
  -H "Authorization: Bearer $NODUL_ROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-3-4b-it",
    "provider": {"zdr": true},
    "messages": [{"role": "user", "content": "Summarize this contract: …"}]
  }'
```

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://router.nodul.ru/api/v1", api_key=os.environ["NODUL_ROUTER_API_KEY"])
completion = client.chat.completions.create(
    model="google/gemma-3-4b-it",
    messages=[{"role": "user", "content": "Summarize this contract: …"}],
    extra_body={"provider": {"zdr": True}},
)
print(completion.choices[0].message.content)
```

```js
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://router.nodul.ru/api/v1", apiKey: process.env.NODUL_ROUTER_API_KEY });
const completion = await client.chat.completions.create({
  model: "google/gemma-3-4b-it",
  messages: [{ role: "user", content: "Summarize this contract: …" }],
  // @ts-expect-error: router field, not part of the OpenAI types
  provider: { zdr: true },
});
console.log(completion.choices[0].message.content);
```

What the router does with it:

1. Before any provider is called, it keeps only models that have at least one ZDR endpoint. A model without one is a `400`, so a request never falls back to a model that keeps data, even through a `models` list.
2. The flag goes to the Global region, which runs the request only on the model's ZDR endpoints.
3. The Russia region is never used for ZDR requests: its providers' retention policies are not confirmed, and the router treats an unknown policy as one that keeps data.

## Find ZDR models

- In the [catalog](/models), turn on the **Zero data retention** filter; such models carry a badge.
- In `GET /api/v1/models`, look at `routes[].zdr`:

```bash
curl -s https://router.nodul.ru/api/v1/models | jq -r '.data[] | select(any(.routes[]; .zdr)) | .id'
```

The list is refreshed from the providers regularly: a model may gain or lose ZDR.

## ZDR or no data collection

| Field                       | Excludes                                                                                                                                                               |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `"zdr": true`               | Every provider that stores prompts or answers for any time. The strictest option.                                                                                      |
| `"data_collection": "deny"` | Providers that may store data for training or sell it; a provider may still keep logs for a short time, for example for abuse checks. Also excludes the Russia region. |

Both can be combined. `"zdr": false` and `"data_collection": "allow"` change nothing.

## What the router itself stores

ZDR is about the provider. The router keeps:

- **request metadata** for billing and logs: time, model, key, tokens, cost, status. Never the content;
- **the content of requests and answers only when content logging is on** for the Router space. It is off by default; the owner or an admin of the space turns it on in its settings and chooses how long to keep it (1 to 30 days).

> **Important:** `"zdr": true` does not turn off content logging of your Router space. If the space stores content, the router keeps the request and the answer for the chosen number of days. For ZDR end to end, turn content logging off in the space settings, or use a separate space without it.

The router never sends your headers, your key or the name of your application to providers.

## Errors

| Status       | Message                                                         | Why                                                                                                         |
| ------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `400`        | `no route of <model> offers zero data retention (provider.zdr)` | The model has no ZDR endpoint. Pick a model with the badge.                                                 |
| `400`        | `no route of <model> satisfies provider.data_collection "deny"` | The model is only in the Russia region.                                                                     |
| `400`        | `provider.zdr must be a boolean`                                | Send `true` or `false`, not a string.                                                                       |
| `404`, `503` | Provider message                                                | The model's ZDR endpoints are temporarily unavailable. Retry later or add a fallback ZDR model in `models`. |

## Price

A model's ZDR endpoint may cost more than the price shown in the catalog, which is the model's lowest price. You pay the actual cost: `usage.cost` of the response is exact.

Prompt caching inside a provider's memory is not storage: models with ZDR may still give cache discounts.
