Zero Data Retention
Zero data retention (ZDR) means a call leaves nothing behind at the provider once it is answered: no stored prompts or outputs, no abuse-monitoring logs, no training.
Requiring ZDR
A call requires ZDR when its metadata says zdr: true (per call, or in the AI's defaultMetadata) or when its provider's config says privacy.requireZDR:
// Every call through this AI
const ai = AI.with()
.providers({ openai, openrouter })
.create({ defaultMetadata: { zdr: true } });
// One call
const response = await ai.chat.get(
{ messages: [{ role: 'user', content: 'Summarize this contract: ...' }] },
{ metadata: { zdr: true } },
);Once set, by the defaults or the call, it stays set. Then:
- Selection only picks models whose provider can call them with ZDR.
- A model named outright that can't be called with ZDR is refused with a
ZDRError(provider,model,reason) before anything is sent. - The provider sends what holds ZDR on its API (OpenRouter
provider.zdr: trueanddata_collection: 'deny', OpenAIstore: false) and refuses what can't keep it (batches, file uploads, server tools, …).
A provider that doesn't say how it holds ZDR is never called when ZDR is required.
How each provider holds it
| Provider | How | Config |
|---|---|---|
| OpenRouter | Per request: routed only to ZDR endpoints | defaultParams.providers.zdr: true requires it for every call |
| OpenAI | Per account: an organization or project with a ZDR arrangement | privacy: { zdrAccount: true } |
| Anthropic | Per account, by agreement | privacy: { zdrAccount: true } |
| AWS Bedrock | Per account: data retention mode none | privacy: { zdrAccount: true } |
| Ollama | The host keeps nothing (local, or Ollama's cloud) | — |
| Gemini API: none, every call is refused when ZDR is required. Vertex AI: per project, set up for ZDR | Vertex AI: privacy: { zdrAccount: true } | |
| Replicate | No ZDR: never called when ZDR is required | — |
const openai = new OpenAIProvider({
apiKey: process.env.OPENAI_API_KEY!,
privacy: {
zdrAccount: true, // this organization has a ZDR arrangement with OpenAI
requireZDR: true, // and every call through this provider requires it
},
});Without zdrAccount, account-based providers refuse calls that require ZDR.
For Bedrock, zdrStatus() reads the account's logging and data retention settings and says whether zdrAccount is warranted.
Per-model data
ModelInfo.privacy says what a provider keeps of a call to a model, and the zdr capability agrees with it:
interface ModelPrivacy {
zdr?: boolean; // can be called with nothing kept (unset: unknown)
zdrBy?: 'request' | 'account' | 'host';
reason?: string; // why not, when zdr is false
zdrEndpoints?: string[]; // OpenRouter: the upstream endpoints that serve it with ZDR
safetyRetention?: string[]; // of those, the ones that may keep content flagged for safety review
}@aeye/models fills it from OpenRouter's ZDR endpoint list and the providers' documentation (for example, Claude models that need 30-day retention are refused to ZDR organizations). A custom provider implements zdrRefusal(model, config) (returning why a model can't be called with ZDR, or undefined) with the zdrRefusal helper from @aeye/ai, and requiresZDR(config).