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

# Zero Data Retention

> Restrict a request to providers that do not retain prompt or completion content, and list the models that support it.

Zero data retention (ZDR) means the upstream provider that serves your request does not keep the
prompt or the completion after returning it. Use it when a prompt carries data you cannot leave on a
third party's disk.

Two surfaces implement it:

* [`GET /v1/models?zdr=true`](/api-reference/models#query-parameters) lists the models a ZDR request
  can reach.
* `provider: {"zdr": true}` in a request body restricts routing for that request.

The two agree by construction. A model listed under `?zdr=true` is one that
`provider: {"zdr": true}` can route.

## Route a request under zero data retention

Add the `provider` block to the request. Every inference endpoint accepts it:
`/v1/chat/completions`, `/v1/messages`, `/v1/responses`, `/v1/embeddings`, and
`/v1/completions`.

```bash theme={null}
curl https://api.redpill.ai/v1/chat/completions \
  -H "Authorization: Bearer $REDPILL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-3-27b-it",
    "messages": [{"role": "user", "content": "Summarize this contract clause."}],
    "provider": {"zdr": true}
  }'
```

If no provider for that model operates under zero data retention, the request fails before the
prompt is sent:

```json theme={null}
{
  "error": {
    "message": "No zero-data-retention providers are available for the selected model.",
    "type": "not_found_error"
  }
}
```

The status is `404`. This is a fail-closed check: the gateway does not fall back to a
non-ZDR provider, and failover retries stay inside the ZDR set.

Setting `"zdr": false`, or omitting the field, applies no retention constraint and behaves exactly
as a request with no `provider` block.

## List the models you can use

```bash theme={null}
curl -s "https://api.redpill.ai/v1/models?zdr=true" \
  -H "Authorization: Bearer $REDPILL_API_KEY" \
  | jq -r '.data[].id'
```

Embedding models have their own catalog, which takes the same parameter:

```bash theme={null}
curl -s "https://api.redpill.ai/v1/embeddings/models?zdr=true" \
  -H "Authorization: Bearer $REDPILL_API_KEY" \
  | jq -r '.data[].id'
```

`true` is the only accepted value. Any other value, including `false`, returns `400`. Omit the
parameter for the full catalog. Rejecting other values is deliberate: a typo cannot silently return
an unfiltered list that looks filtered.

A model object has no `zdr` field. The filter is how you read this property, so query the filtered
catalog rather than inspecting individual model objects.

## How zero data retention differs from confidential inference

These are different properties and you may need either, or both.

|                                   | What it constrains                                                                                                     | How to select it                       | How to verify it                                                                       |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- |
| Confidential inference (`is_tee`) | Who can read memory while the model runs. The upstream is attested and the channel is bound before the prompt is sent. | `is_tee: true` on a model object       | The per-response [receipt](/api-reference/receipts) records `upstream.verified.result` |
| Zero data retention (`zdr`)       | Whether the upstream stores prompt and completion content after serving.                                               | `?zdr=true`, `provider: {"zdr": true}` | Provider contract and published policy                                                 |

The distinction matters because a TEE constrains execution, not storage. A provider could run a
model inside an enclave and still write request logs to disk. RedPill tracks the two properties
separately for that reason.

<Warning>
  Today the two filters happen to select the same models, because every confidential provider RedPill
  routes to also operates under zero data retention, and the routed third-party providers do not. Do
  not depend on that. Filter with `?zdr=true` when you need the retention property, rather than
  inferring it from `is_tee`.
</Warning>

Zero data retention is a property of the upstream provider, backed by its contract or published
policy. It is not proven by the attestation report or the receipt, which cover workload identity
and response integrity. Confidential inference is the property the receipt does prove. See
[Verify a response](/guides/verify-a-response).

## The gateway's own retention

The gateway does not store request or response bodies at any point, for ZDR and non-ZDR requests
alike. Receipts hold hashes, not content. See
[Trust boundary](/confidential-ai/trust-boundary).

Setting `zdr` changes which upstream serves the request. It does not change gateway behavior.

## Related

<CardGroup cols={2}>
  <Card title="List Models" icon="list" href="/api-reference/models">
    The `zdr` query parameter and model object fields.
  </Card>

  <Card title="Chat Completions" icon="message" href="/api-reference/chat-completions">
    The `provider` routing block.
  </Card>

  <Card title="Providers" icon="server" href="/confidential-ai/providers">
    What each upstream provider attests.
  </Card>

  <Card title="Compliance" icon="scale-balanced" href="/confidential-ai/compliance">
    How retention maps to GDPR and HIPAA obligations.
  </Card>
</CardGroup>
