Zero data retention (ZDR) is available for Pro and Enterprise users on AI Gateway. There are two ways to enforce ZDR:
- Team-wide: Enable ZDR globally from the AI Gateway Dashboard Settings tab. Once enabled, all requests are routed to ZDR-compliant providers.
- Per-request: Set zeroDataRetention: true in providerOptions.gateway for individual requests. This gives you fine-grained control over which requests require ZDR.
These two methods work as an OR: if either is enabled, ZDR is enforced for that request.
ZDR is a superset of disallowing prompt training. All ZDR-compliant providers also disallow prompt training, but not all providers that disallow prompt training offer full zero data retention.
Option
Per-request zero data retention
Cost
BYOK (Bring Your Own
Key) keys by default when ZDR
is enabled, since BYOK keys operate under your own agreements with providers.
You can mark individual BYOK keys as ZDR-compliant to include them in the ZDR
routing set. See
BYOK for details.
Availability
Pro and Enterprise
Team-wide zero data retention
No additional cost
$0.10 per 1,000 requests
Pro and Enterprise
Team-wide ZDR is only charged on successful responses that return usage data. Requests that fail or return errors are not charged.
AI Gateway has a ZDR policy and does not retain prompts, outputs, or sensitive data. User data is immediately and permanently deleted after requests are completed. No action is needed on the user side.
Providers
AI Gateway has agreements in place to offer ZDR with specific providers. A provider's default policy may not match with the status that AI Gateway has in place due to these agreements.
By default, AI Gateway does not route based on the data retention policy of providers.
Team-wide zero data retention
Pro and Enterprise customers can enable ZDR globally for all requests from the AI Gateway Dashboard.
To enable team-wide ZDR:
- Go to the AI Gateway Dashboard
- Navigate to the Settings tab
- Toggle on the Zero Data Retention option
Once enabled, team-wide ZDR applies to all requests through the Vercel team you configured it for. For how team-wide ZDR interacts with BYOK keys, see BYOK.
Per-request zero data retention
You can enforce ZDR on individual requests using the zeroDataRetention parameter in providerOptions.gateway. Set zeroDataRetention to true to route the request only through providers that have zero data retention agreements with Vercel AI Gateway.
If no ZDR-compliant providers are available for the requested model, the request fails with an error:
{
ZDR enforcement also applies to any fallback providers. For how per-request ZDR interacts with BYOK keys, see BYOK.
}
{
"statusCode":400
"gateway": {
}
"planningReasoning":"ZDR requested: 5 attempts → 2 ZDR attempts. ZDR execution order: anthropic(system) → bedrock(system)"
}
}
"routing": {
"error":"No ZDR (Zero Data Retention) providers available for model: example/model-name. Providers considered: provider-a, provider-b"
"type":"no_providers_available",
When ZDR is enabled, the routing metadata in successful responses shows how AI Gateway filtered providers. The planningReasoning field indicates which providers were considered:
AI SDK
See the AI SDK zero-data-retention reference for SDK configuration and usage.
Brand & Design
prompt:'Analyze this example business data: revenue grew by 5%.',
import { generateText } from'ai';
const { text } =awaitgenerateText({
gateway: {
model:'anthropic/claude-sonnet-5',
},
},
});
providerOptions: {
zeroDataRetention:true,
console.log(text);
BYOK
When ZDR is enabled, either team-wide or per-request, AI Gateway skips your BYOK keys by default. BYOK keys operate under your own agreements and permissions with providers, which can differ from the ZDR agreements Vercel has negotiated for AI Gateway system credentials.
If you have your own ZDR agreement with a provider, you can mark a BYOK key as ZDR-compliant. AI Gateway then includes that key in the ZDR routing set. This option applies to both team-wide and request-level ZDR.
To mark a BYOK key as ZDR:
- Go to the AI Gateway Bring Your Own Key (BYOK) page in your Vercel dashboard.
- Add a new key or edit an existing one.
- Toggle on Zero Data Retention.
When ZDR is enabled, AI Gateway filters the routing set for each model to ZDR-compliant providers only:
- If you have BYOK keys for a ZDR-compliant provider that you marked as ZDR, AI Gateway tries those keys first.
- If those BYOK keys fail or are unavailable, AI Gateway falls back to AI Gateway system credentials for the ZDR-compliant providers in the routing set.
- If no ZDR-compliant providers are available for the model, the request fails with a no_providers_available error.
Consider the following setup:
- You have a BYOK key for Anthropic, marked as ZDR, because you have a direct ZDR agreement with Anthropic.
- You have a BYOK key for Google Vertex, not marked as ZDR.
- You have a BYOK key for OpenAI, not marked as ZDR.
- You send a request to anthropic/claude-sonnet-5 with zeroDataRetention: true.
AI Gateway builds the ZDR routing set in two parts.
BYOK routing set:
- Your BYOK keys: Anthropic, Google Vertex, OpenAI
- Filter to ZDR-marked keys: Anthropic
- Filter to keys for providers serving anthropic/claude-sonnet-5: Anthropic
System credentials routing set:
- System providers serving anthropic/claude-sonnet-5: Anthropic, Google Vertex, Amazon Bedrock
- Filter to providers Vercel has ZDR agreements with: Anthropic, Google Vertex, Amazon Bedrock
Final routing order:
- Anthropic BYOK (ZDR-marked) is tried first.
- If that fails, AI Gateway falls back to system credentials for Anthropic, Google Vertex, or Amazon Bedrock.
Your Google Vertex BYOK is filtered out because you didn't mark it as ZDR, but Google Vertex is still reachable through system credentials. Your OpenAI BYOK is filtered out because OpenAI doesn't serve anthropic/claude-sonnet-5.
Using both account and request-level ZDR
Team-wide ZDR toggled to enabled overrides request-level zeroDataRetention: false since these options work together as an OR. If either option is enabled, ZDR is enforced on the request.
Caching and zero data retention
When you use prompt caching through AI Gateway, caching happens at the provider level. Whether that caching is ZDR-compliant depends on the provider.
No prompt training
ZDR providers and policies
Alibaba Cloud
✓
✓
All ZDR-compliant providers also disallow prompt training, since ZDR is a superset of disallowing prompt training. In some cases, certain models or functionalities may be excluded from a provider's ZDR policy. AI Gateway will not fail these requests if zero data retention is enabled, so review the provider's policy in the table below to understand the nuances of specific tools and how they affect data retention.
Custom policy
The following providers currently offer ZDR on AI Gateway. Please review each provider's ZDR policy and terms carefully. A provider's default policy may not match with the status that 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.
Anthropic*
✓
Azure
✓
✓
Bedrock*
✓
DeepInfra
Baseten
Claude Platform on AWS
✓
✓
ZDR policy
✓
Fireworks
✓
Cerebras
DigitalOcean
✓
✓
Moonshot AI
Groq
Google Vertex AI*
✓
Custom policy
Mistral
✓
Modal
Morph
✓
✓
✓
✓
✓
Nebius
✓
Parasail
✓
Together AI
Particle.AI
TypeSafe AI
✓
Wafer
✓
✓
✓
xAI
* anthropic/claude-fable-5 does not support ZDR on any provider, including Anthropic, Google Vertex, and Amazon Bedrock. Anthropic has determined this is required because some misuse patterns only become visible across cumulative requests. Prompts and completions are retained for 30 days and are not used to train Claude.
✓
A virtual model can restrict its traffic to zero-data-retention providers. The setting only tightens: either side can turn it on, and neither side can turn it off.
ZDR policy
Except as necessary to comply with its legal obligations, TypeSafe shall not retain (a) prompts that are Customer Data for any longer than is necessary to generate Output for Customer and (b) Output for any longer than necessary to enable TypeSafe to fulfil its obligations to Customer under the Agreement.
Last updated September 10, 2026
Cross-link map: AI Gateway Zero Data Retention \(ZDR\) (/docs/ai-gateway/security-and-compliance/zdr)From the Vercel docs graph (built 2026-09-21T05:26:59.511Z), spanning vercel.com docs + KB, nextjs.org, ai-sdk.dev, and other Vercel documentation sites. Full graph as JSON: https://vercel.com/docs/graph.jsonSemantically closest pagesAI Gateway Disallow Prompt Training — Learn how to prevent AI providers from using your prompts and responses for model training through AI Gateway.Zero Data Retention on AI GatewayAI Gateway Security and Compliance — AI Gateway data privacy and governance controls: zero data retention, prompt training policies, and provider allowlists.Team-wide Zero Data Retention and prompt training controls now on AI GatewayAI Gateway Regional Inference — Route AI Gateway inference to the region you choose and control where providers store data, for data residency and complThis page links to (5)AI GatewayBring Your Own Key \(BYOK\) to AI Gateway — Learn how to configure your own provider keys with AI Gateway.AI Gateway Automatic Prompt Caching — Enable automatic prompt caching and provider-side cache affinity with AI Gateway to reduce costs and latency.AI Gateway SDKs and APIs — Connect to AI Gateway with the AI SDK, Python, REST, or compatible OpenAI, Anthropic Messages, OpenResponses, and CohereAI Gateway Disallow Prompt Training — Learn how to prevent AI providers from using your prompts and responses for model training through AI Gateway.Pages that link here (19)By site: vercel-changelog (6) · vercel-kb (3) · vercel-docs (10)From vercel-changelog Routing rules now available on AI GatewayInkling Small from Thinking Machines is now available on AI GatewayKimi K3 and Kimi K3 Fast with ZDR and US-based providers now on AI GatewaySet up coding agents in one command with AI GatewayTypeSafe AI's Jev now available on AI GatewayWebSocket support for OpenAI Responses API live on AI GatewayFrom vercel-kbHow to architect an AI evaluation dashboard on Vercel — Map eval orchestration, traces, and run storage to AI Gateway, Observability, and Marketplace Postgres, and learn when sHow to build your own AI model router — Build an AI model router with Vercel AI Gateway. Keep routing, key, and retention decisions in your code while the gatewHow to classify, route, and score with Jev and AI SDK — Use Jev from TypeSafe AI with AI SDK's experimental \evaluate\\ API to classify, route, score, and verify inside your aFrom vercel-docsAI Gateway FAQ — Answers to common questions about AI Gateway, including request errors, pricing and markup, SDK and API compatibility, mGPT-Live — Connect GPT-Live through AI Gateway to stream voice, handle client delegation, and track session duration.AI Gateway Trace Drains — Forward an OpenTelemetry trace of every AI Gateway request to your own observability tool, and understand trace drain biAI Gateway Pricing — Understand AI Gateway token pricing, free and paid credits, BYOK costs, add-on charges, and payment fees. Manage creditOpenAI Responses Compaction with AI Gateway — Compress long conversations into a single compaction item with the OpenAI Responses API through AI Gateway.OpenAI Responses API WebSocket Mode with AI Gateway — Keep a persistent connection open across turns with the OpenAI Responses API over WebSocket through AI Gateway.AI Gateway Security and Compliance — AI Gateway data privacy and governance controls: zero data retention, prompt training policies, and provider allowlists.AI Gateway Disallow Prompt Training — Learn how to prevent AI providers from using your prompts and responses for model training through AI Gateway.AI Gateway Regional Inference — Route AI Gateway inference to the region you choose and control where providers store data, for data residency and complvercel ai-gateway — Manage AI Gateway resources from the Vercel CLI: API keys, budgets, routing rules, virtual models, models, leaderboards,