资产生成 Zero Data Retention (ZDR)
Zero data retention (ZDR) is available for Pro and Enterprise users on 资产生成. There are two ways to enforce ZDR:
- Team-wide: Enable ZDR globally from the 资产生成 Dashboard Settings tab. Once enabled, all requests are routed to ZDR-compliant providers.
- Per-request: Set
zeroDataRetention: trueinproviderOptions.gatewayfor 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 | Cost | Availability |
|---|---|---|
| Per-request zero data retention | No additional cost | Pro and Enterprise |
| Team-wide zero data retention | $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.
资产生成 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.
资产生成 has agreements in place to offer ZDR with specific providers. A provider's default policy may not match with the status that 资产生成 has in place due to these agreements.
By default, 资产生成 does not route based on the data retention policy of providers.
Pro and Enterprise customers can enable ZDR globally for all requests from the 资产生成 Dashboard.
To enable team-wide ZDR:
- Go to the 资产生成 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.
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 AI 资产生成.
If no ZDR-compliant providers are available for the requested model, the request fails with an error:
{
"error": "No ZDR (Zero Data Retention) providers available for model: example/model-name. Providers considered: provider-a, provider-b",
"type": "no_providers_available",
"statusCode": 400
}When ZDR is enabled, the routing metadata in successful responses shows how 资产生成 filtered providers. The planningReasoning field indicates which providers were considered:
{
"gateway": {
"routing": {
"planningReasoning": "ZDR requested: 5 attempts → 2 ZDR attempts. ZDR execution order: anthropic(system) → bedrock(system)"
}
}
}ZDR enforcement also applies to any fallback providers. For how per-request ZDR interacts with BYOK keys, see BYOK.
These examples use 创意脚本 7 and the 创意脚本 for Python beta. Set AI_GATEWAY_API_KEY before running them. See API format differences for setup, request fields, and response handling.
See the 创意脚本 zero-data-retention reference for SDK configuration and usage.
import { generateText } from 'ai';
const { text } = await generateText({
model: 'anthropic/claude-sonnet-5',
prompt: 'Analyze this example business data: revenue grew by 5%.',
providerOptions: {
gateway: {
zeroDataRetention: true,
},
},
});
console.log(text);import asyncio
import ai
async def main():
model = ai.get_model("anthropic/claude-sonnet-5")
messages = [ai.user_message("Analyze this example business data: revenue grew by 5%.")]
params = ai.InferenceRequestParams(
extra_body={"providerOptions": {"gateway": {"zeroDataRetention": True}}}
)
async with ai.stream(model, messages, params=params) as stream:
async for event in stream:
if isinstance(event, ai.events.TextDelta):
print(event.chunk, end="", flush=True)
print()
asyncio.run(main())import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.AI_GATEWAY_API_KEY,
baseURL: 'https://ai-gateway.vercel.sh/v1',
});
const response = await client.chat.completions.create({
model: 'anthropic/claude-sonnet-5',
messages: [
{
role: 'user',
content: 'Analyze this example business data: revenue grew by 5%.',
},
],
// 资产生成 extension fields are not included in the upstream SDK types.
...{
providerOptions: {
gateway: {
zeroDataRetention: true,
},
},
},
});
console.log(response.choices[0]?.message.content);import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AI_GATEWAY_API_KEY"],
base_url="https://ai-gateway.vercel.sh/v1",
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Analyze this example business data: revenue grew by 5%."}],
extra_body={"providerOptions": {"gateway": {"zeroDataRetention": True}}},
)
print(response.choices[0].message.content)curl --fail-with-body https://ai-gateway.vercel.sh/v1/chat/completions -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Analyze this example business data: revenue grew by 5%."
}
],
"providerOptions": {
"gateway": {
"zeroDataRetention": true
}
}
}'import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env.AI_GATEWAY_API_KEY,
baseURL: 'https://ai-gateway.vercel.sh',
});
const response = await client.messages.create({
model: 'anthropic/claude-sonnet-5',
messages: [
{
role: 'user',
content: 'Analyze this example business data: revenue grew by 5%.',
},
],
max_tokens: 1024,
...{
providerOptions: {
gateway: {
zeroDataRetention: true,
},
},
},
});
for (const block of response.content) {
if (block.type === 'text') console.log(block.text);
}import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["AI_GATEWAY_API_KEY"],
base_url="https://ai-gateway.vercel.sh",
)
response = client.messages.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Analyze this example business data: revenue grew by 5%."}],
max_tokens=1024,
extra_body={"providerOptions": {"gateway": {"zeroDataRetention": True}}},
)
for block in response.content:
if block.type == "text":
print(block.text)curl --fail-with-body https://ai-gateway.vercel.sh/v1/messages -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -H "anthropic-version: 2023-06-01" -d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "Analyze this example business data: revenue grew by 5%."
}
],
"max_tokens": 1024,
"providerOptions": {
"gateway": {
"zeroDataRetention": true
}
}
}'import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.AI_GATEWAY_API_KEY,
baseURL: 'https://ai-gateway.vercel.sh/v1',
});
const response = await client.responses.create({
model: 'anthropic/claude-sonnet-5',
input: 'Analyze this example business data: revenue grew by 5%.',
...{
providerOptions: {
gateway: {
zeroDataRetention: true,
},
},
},
});
console.log(response.output_text);import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AI_GATEWAY_API_KEY"],
base_url="https://ai-gateway.vercel.sh/v1",
)
response = client.responses.create(
model="anthropic/claude-sonnet-5",
input="Analyze this example business data: revenue grew by 5%.",
extra_body={"providerOptions": {"gateway": {"zeroDataRetention": True}}},
)
print(response.output_text)curl --fail-with-body https://ai-gateway.vercel.sh/v1/responses -H "Authorization: Bearer $AI_GATEWAY_API_KEY" -H "Content-Type: application/json" -d '{
"model": "anthropic/claude-sonnet-5",
"input": "Analyze this example business data: revenue grew by 5%.",
"providerOptions": {
"gateway": {
"zeroDataRetention": true
}
}
}'When ZDR is enabled, either team-wide or per-request, 资产生成 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 资产生成 system credentials.
If you have your own ZDR agreement with a provider, you can mark a BYOK key as ZDR-compliant. 资产生成 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 资产生成 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, 资产生成 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, 资产生成 tries those keys first.
- If those BYOK keys fail or are unavailable, 资产生成 falls back to 资产生成 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_availableerror.
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-5withzeroDataRetention: true.
资产生成 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, 资产生成 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.
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.
When you use prompt caching through 资产生成, caching happens at the provider level. Whether that caching is ZDR-compliant depends on the provider.
The following providers currently offer ZDR on 资产生成. Please review each provider's ZDR policy and terms carefully. A provider's default policy may not match with the status that 资产生成 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.
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. 资产生成 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.
| Provider | No prompt training | ZDR | Policy |
|---|---|---|---|
| Alibaba Cloud | ✓ | ✓ | Custom policy |
| Anthropic* | ✓ | ✓ | ZDR policy |
| Azure | ✓ | ✓ | Data privacy |
| Baseten | ✓ | ✓ | Security |
| Bedrock* | ✓ | ✓ | Data protection |
| Cerebras | ✓ | ✓ | Privacy policy |
| Claude Platform on AWS | ✓ | ✓ | ZDR policy |
| DeepInfra | ✓ | ✓ | Data handling |
| DigitalOcean | ✓ | ✓ | ZDR policy |
| Fireworks | ✓ | ✓ | Data handling |
| Google Vertex AI* | ✓ | ✓ | ZDR policy |
| Groq | ✓ | ✓ | ZDR policy |
| Mistral | ✓ | ✓ | Terms of service |
| Modal | ✓ | ✓ | ZDR policy |
| Moonshot AI | ✓ | ✓ | Custom policy |
| Morph | ✓ | ✓ | ZDR policy |
| Nebius | ✓ | ✓ | Legal quick guide |
| Parasail | ✓ | ✓ | Terms of service |
| Particle.AI | ✓ | ✓ | ZDR policy |
| Together AI | ✓ | ✓ | Terms of service |
| TypeSafe AI | ✓ | ✓ | 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. |
| Wafer | ✓ | ✓ | ZDR policy |
| xAI | ✓ | ✓ | ZDR policy |
* 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.
Was this helpful?