---
title: "How to Judge AI API Data Privacy: 5 Policy Clauses to Check"
description: "Will an AI API see your code and chats? Five data policy clauses to check (storage, retention, training, access, deletion), plus redaction and key practices."
url: https://cdnping.org/en/blog/ai-api-data-privacy-policy
language: en
published: 2026-10-19
category: "IP & privacy"
tags: ["data privacy","API security","data policy","API relay","key management"]
source: cdnping.org
license: Free to quote and summarize with a link to the url above.
---
# How to Judge AI API Data Privacy: 5 Policy Clauses to Check

Yes, at least at the moment of transmission and processing, the code and conversations you send will be "seen" by the provider's systems. That is a precondition of calling an API at all. The real questions are: is it written to disk, for how long, is it used for training, who can look at it, and can you ask for deletion? Judging AI API data privacy means matching those five questions against the provider's actual policy text, then redacting data and isolating keys on your own side so the worst case stays contained.

Below: first the path a request takes, then a clause table you can use directly for checking, and finally some self-protection practices that don't depend on the provider's promises.

## Where does your data go during an API request?

Take the case of changing the endpoint in Claude Code or Codex (setup is covered in [Custom API endpoints for Claude Code, Codex and OpenCode](/en/blog/configure-custom-api-endpoint-claude-code-codex)). A request roughly passes through:

1. Your machine: the tool assembles the current file, terminal output and conversation history into the request body. Agent-style tools put the contents of files they have read into the context, so if one has read a config file such as `.env`, that content may be sent too.
2. The network path: HTTPS encrypts the traffic. A man in the middle can't see the body, but can see the domain you connect to.
3. The access layer: an official API, a cloud-hosted service, or an aggregation gateway. It has to decrypt the request to forward it, which makes it the first place logs might be kept.
4. The inference provider: whoever actually runs the model. If the access layer is an aggregation gateway, there may be more than one behind it.
5. The return path: the output travels back through the same hops.

Each extra hop is one more data policy to read. The differences between the three access modes are compared in more depth in [Official API, cloud-hosted, or aggregation gateway: how to choose](/en/blog/official-api-vs-cloud-vs-gateway); here we only care about where the data flows.

### How many inference providers are there, really?

This is more concrete than you might think. Take a snapshot of the public OpenRouter catalog captured by cdnping's [model monitoring](/en/models) on 2026-10-17: one popular open-weight model was listed with 36 inference provider endpoints, of which 17 were labeled fp8 quantization, 3 fp4, 1 mxfp4, and 15 did not disclose their quantization precision. In the same snapshot, a model from a closed-source vendor was listed with cloud-hosted endpoints in addition to the vendor's own, and another vendor listed its regular endpoints separately from endpoints carrying a `zdr` tag (zdr generally means zero data retention; the exact meaning is defined in that vendor's official documentation).

Two things follow. Behind a routing layer there can be many providers, and their data handling is not uniform. And some platforms expose the retention policy as a selectable endpoint attribute. For how routing and quantization affect quality, see [Did the model get dumber, or did the provider change?](/en/blog/llm-quantization-fp8-fp4-providers); for how uptime differs across providers for the same model, see [How much can uptime differ between OpenRouter providers for the same model?](/en/blog/same-model-different-providers-uptime)

## Which five clauses should you look for in a data policy?

Don't read a policy front to back. Search for the terms below, find the matching passages, and record them one by one.

| Clause | What to search for | What a good answer looks like | What to follow up on |
|---|---|---|---|
| Stored to disk? | "store", "log", "retain" | Distinguishes request bodies from metadata and says whether bodies are written to persistent storage | Only says "we value your privacy" without separating body and metadata |
| Retention period | "retention", "days" | A specific number of days, or an explicit "not retained" | "Retained for as long as necessary" |
| Used for training? | "train", "improve our services" | Explicitly not used for training, or off by default with a way to confirm the setting | "May be used to improve our products" |
| Who can access it | "employees", "third parties", "subprocessors" | Lists the roles that can access it and the triggers (such as abuse review), and names downstream providers | No mention of downstream providers, or only "partners" |
| Deletion process | "delete", "close account" | States the request channel, the turnaround time, and whether backups are included | No deletion clause |

A few things that are easy to misread:

- **"Doesn't train" is not "doesn't store."** A service can promise not to train on your data while keeping request logs for some days to investigate abuse. Confirm the two separately.
- **Metadata is usually kept.** Timestamps, token counts, model, IP and key ID are needed for billing and risk control, and a policy that says "we don't record content" generally doesn't cover them. Billing reconciliation also depends on this metadata; for the counting differences, see [AI API bills don't match: token counting and how to reconcile](/en/blog/relay-billing-token-mismatch).
- **A gateway's promise only covers the gateway.** When a gateway says "not written to disk," it means its own layer. Once the request is forwarded to a downstream inference provider, that provider's policy applies. A good policy says who the downstream providers are and where to find their terms.
- **Policies change.** Note the date of the version you read. cdnping's [site updates](/en/changes) records additions and removals line by line across many official changelogs, pricing pages and news pages, and offers RSS, so you can see changes on monitored pages quickly. For other services' policy pages, you need to recheck them yourself on a regular basis.

## Once you have a policy, how do you check it clause by clause?

You can follow these steps:

1. Open the provider's privacy policy, terms of service and API data usage notes (these are often separate pages). Save the pages and note the date.
2. Using the five rows above, copy the original sentences into your own spreadsheet. Don't paraphrase.
3. Look for downstream providers: search for "subprocessors", "suppliers", "upstream". Where there is no disclosure, mark the "who can access" row as "unknown."
4. Look for options: settings to disable logging, zero retention, region pinning and so on; where the switch is in the console, and whether the default is on or off.
5. Email or open a ticket to resolve every "unknown" in the table. Archive the reply verbatim as well.
6. Based on the results, set a maximum data level for that service, for example "public code and test data only."

Step 6 matters most. However well a policy is written, you can't verify from outside that it is being followed, so the thing you can ultimately control is what you send. Other checks for relay-type services (uptime, billing, model consistency) are covered in [How to choose an AI API relay: 8 checks for uptime, billing and data policy](/en/blog/api-relay-how-to-evaluate) and [Is a Claude API relay reliable? Main risks and self-checks](/en/blog/is-claude-api-relay-safe).

## What can you do without relying on the provider's promises?

### Redact before sending

Many leaks don't come from the provider at all, but from things that should never have been in the request: keys, internal addresses, customer phone numbers. The Python snippet below can go into your own call wrapper and replace common sensitive strings before the request goes out. The rules are examples; extend them for your project. (The phone pattern matches mainland China mobile numbers.)

```python
import re

PATTERNS = [
    (re.compile(r"sk-[A-Za-z0-9_\-]{16,}"), "<API_KEY>"),
    (re.compile(r"AKIA[0-9A-Z]{16}"), "<AWS_KEY>"),
    (re.compile(r"-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]+?-----END [A-Z ]*PRIVATE KEY-----"), "<PRIVATE_KEY>"),
    (re.compile(r"\b1[3-9]\d{9}\b"), "<PHONE>"),
    (re.compile(r"\b(?:10(?:\.\d{1,3}){3}|172\.(?:1[6-9]|2\d|3[01])(?:\.\d{1,3}){2}|192\.168(?:\.\d{1,3}){2})\b"), "<PRIVATE_IP>"),
    (re.compile(r"[\w.+-]+@[\w-]+\.[\w.]+"), "<EMAIL>"),
]

def redact(text: str) -> str:
    for pat, repl in PATTERNS:
        text = pat.sub(repl, text)
    return text
```

For agent-style tools, the tool builds the request body itself, so a wrapper can't intercept it. What works better there is controlling what it can read: add `.env`, certificates and database exports to the tool's ignore list, and run it in a working directory that contains only the code it needs. Before committing, a single command gives a rough check for plaintext keys in the repo:

```bash
grep -rEn "sk-[A-Za-z0-9_-]{16,}|AKIA[0-9A-Z]{16}|PRIVATE KEY-----" \
  --exclude-dir={.git,node_modules,dist} .
```

### Split keys by environment and purpose

- One key per purpose. Local development, CI and production each get their own, so a leak means revoking only one, and the bill shows who was using what.
- Least privilege. If the platform lets you restrict usable models, set a spending cap or use an IP allowlist, set them all. A cap on production keys makes abnormal consumption show up early.
- Keep them out of the repo. Inject them through environment variables or a secrets manager, and mask output in CI logs.
- Rotate regularly. At a minimum, rotate after staff changes and after switching providers.

### Route by data level

Sort data into three rough tiers, and send each tier only to services whose policies have been checked and found adequate:

| Data level | Examples | Recommendation |
|---|---|---|
| Public | Open-source code, public docs, sample data | Any service whose basic clauses you have checked |
| Internal | Business code, internal design docs | Only services that explicitly don't train, have a clear retention period, and have known downstream providers |
| Restricted | Users' personal information, keys, contracts | Don't send to external APIs; if you must, redact first or substitute synthetic data |

If you use multi-model routing (see [Multi-model routing: cut LLM costs by splitting traffic by task](/en/blog/multi-model-routing-save-cost)), you can write this table directly into your routing rules: restricted data is handled locally, and internal data goes only to allowlisted access providers.

## How detailed should an aggregation gateway's data policy be?

Using the operator as an example, so you can compare against the table above: AGI Plan is a commercial partner of cdnping. The data handling [AGI Plan](https://agiplan.dev) states publicly is that request bodies are not written to disk by default, and content is not used for training or resold. It also states on its site that it is not an officially authorized channel. Against the checklist above, those statements cover the "stored to disk" and "used for training" rows; the scope of retained metadata, downstream providers and the deletion process should still be asked about clause by clause, with it and with any other service, rather than relying on one line on the homepage.

Separately, AGI Plan publishes its uptime based on real requests, and you can see the mirrored data on cdnping's [AGI Plan status page](/en/status/agiplan). Uptime and data policy are different things, but which verifiable numbers a service is willing to publish is one useful signal of how transparent it is.

## Pre-launch checklist

- [ ] All five clauses have recorded original text and a date, and "unknown" items have been raised with the provider
- [ ] You know which downstream providers your requests will be forwarded to
- [ ] Every environment and purpose has its own key, and production keys have a spending cap
- [ ] The agent tool's ignore list includes `.env`, certificates and data exports
- [ ] Restricted data does not appear in any external API request
- [ ] You recheck the provider's policy page regularly and record the version date each time

Even if some provider's promise turns out not to be honored, a request made by this checklist exposes only the data you had already decided could leave your side.
