# Zero Data Retention

Zero data retention (ZDR) is available for Vercel AI Gateway. There is an option to enforce zero data retention on a per request level on AI Gateway.

## Vercel

Vercel AI Gateway has a ZDR policy and does not retain prompts or sensitive data. User data is immediately and permanently deleted after requests are completed. No action here is needed on the user side.

## Providers

Vercel AI Gateway has agreements in place with specific providers for ZDR. A provider's default policy may not match with the status that Vercel AI Gateway has in place due to these agreements.

By default, Vercel AI Gateway does not route based on the data retention policy of providers.

## Per request zero data retention (ZDR) enforcement

To restrict requests to only go through providers that state they provide zero data retention, use the `zeroDataRetention` parameter in `providerOptions`. Set `zeroDataRetention` to `true` to ensure requests are only routed to providers that have zero data retention policies. When `zeroDataRetention` is `false` or not specified, there is no enforcement of restricting routing.

If Vercel AI Gateway does not have a clear policy or agreement in place for a provider, we assume that the provider does not have a zero data retention policy and treat it as such.

If there are no providers available that have zero data retention agreements with Vercel AI Gateway, the request will fail with an error that explains there are no ZDR-compliant providers available for the model. In the case there is a provider fallback that utilizes direct AI Gateway, the zero data retention per request enforcement will hold for that fallback provider.

This per request ZDR enforcement only applies for requests routed directly through Vercel AI Gateway (not BYOK). Since BYOK requests will go through your own API key, they fall under your current agreement with the respective provider, not the Vercel AI Gateway agreement.

### Using AI SDK

Set `zeroDataRetention` to `true` in `providerOptions`:

```typescript filename="zdr.ts" {9-13}
import type { GatewayProviderOptions } from '@ai-sdk/gateway';
import { streamText } from 'ai';
import 'dotenv/config';

async function main() {
  const result = streamText({
    model: 'zai/glm-4.6',
    prompt: 'Analyze this sensitive business data and provide insights.',
    providerOptions: {
      gateway: {
        zeroDataRetention: true, // For this request, use only ZDR compliant providers
      } satisfies GatewayProviderOptions,
    },
  });

  for await (const textPart of result.textStream) {
    process.stdout.write(textPart);
  }

  console.log();
  console.log(
    'Provider metadata:',
    JSON.stringify(await result.providerMetadata, null, 2),
  );
  console.log('Token usage:', await result.usage);
  console.log('Finish reason:', await result.finishReason);
}

main().catch(console.error);
```

### Using OpenAI-compatible API

Set `zeroDataRetention` to `true` in `providerOptions`:

```typescript filename="zdr.ts" {19-23}
import OpenAI from 'openai';

const apiKey = process.env.AI_GATEWAY_API_KEY || process.env.VERCEL_OIDC_TOKEN;

const openai = new OpenAI({
  apiKey,
  baseURL: 'https://ai-gateway.vercel.sh/v1',
});

const completion = await openai.chat.completions.create({
  model: 'zai/glm-4.6',
  messages: [
    {
      role: 'user',
      content:
        'Tell me the history of the San Francisco Mission-style burrito in two paragraphs.',
    },
  ],
  providerOptions: {
    gateway: {
      zeroDataRetention: true, // Request only ZDR compliant providers
    },
  },
});
```

## ZDR providers and policies

Only the following providers offer ZDR on Vercel AI Gateway. Please review each provider's ZDR policy carefully. A provider's default policy may not match with the status that Vercel AI Gateway has in place due to negotiated agreements. We are constantly coordinating and revising agreements to be able to enforce stricter retention policies for customers. The full terms of service are available for each provider on the [model pages](/ai-gateway/models).

- Amazon Bedrock
- Anthropic
- Baseten
- Cerebras
- DeepInfra
- Google Vertex


--------------------------------------------------------------------------------
title: "Clawd Bot"
description: "Use Clawd Bot with the AI Gateway."
last_updated: "2026-02-03T02:58:35.481Z"
source: "https://vercel.com/docs/ai-gateway/chat-platforms/clawd-bot"
--------------------------------------------------------------------------------