Skip to content
mentoor

Topic 3 of 5 · 5 min read

Provider data controls for API calls

Goal: Configure an LLM API integration so prompts are not kept longer than needed and stay in the required region.

Read what your provider keeps by default, then change the settings you control: turn off stored responses, set the shortest retention you are allowed, and pick the processing region before the first real user data goes in. Defaults are built for the provider's convenience, not your data policy.

Check yourself · 1 of 3

A provider says it does not train on your API data. What can you still conclude?

Choose one answer

Why it matters

An API call is a transfer of data to another company. Even when the provider does not train on API data, it may keep requests for abuse monitoring, keep stored responses so you can fetch them later, or keep uploaded files until you delete them. Rules differ between providers (OpenAI, Anthropic, Google, Azure, Amazon Bedrock, and hosted open-weight models) and change over time, so the official page, not memory, is the source. OpenAI's data controls guide is a good example of what to look for.

How to do it

  1. List the provider's stores. For each: request logs for abuse monitoring, stored responses or conversations, uploaded files, fine-tuning data, caches, and the dashboard's own logs.
  2. Turn off what you do not need. Where the API offers a storage flag, set it off on every call. If you never fetch a response again, there is no reason for it to be kept.
  3. Ask for zero data retention if you qualify. Some providers offer it on request or by contract, usually with limits (some features stop working). Check the exact scope in writing.
  4. Pin the region. If law or contract needs EU processing, use a regional endpoint or regional deployment and check that logs and backups stay there too. A model call to the right region still fails the rule if your gateway forwards the text elsewhere.
  5. Sign the agreement. Business use of personal data normally needs a data processing agreement with the provider.
  6. Make it config, not habit. Put the flags in one client wrapper so no developer can forget them.
// llm-client.ts: the only place that talks to the provider
export async function ask(input: string) {
  return client.responses.create({
    model: process.env.LLM_MODEL!,
    input,
    store: false, // do not keep the response on the provider side
  });
}

Before and after

Before: three services create their own clients, one with stored responses on by default, and uploaded files are never deleted. After: one wrapper sets store: false, a nightly job deletes files older than a day, and the region comes from environment config checked at startup.

What goes wrong

  • Assuming "no training" means "no storage". They are separate promises.
  • Region on the model, not on the rest. Logs, files and vector stores may live elsewhere.
  • A dashboard or playground left on. Staff testing with real data in a consumer chat app sits under different terms than the API.
  • Settings drift. A provider changes defaults and nobody rereads the page.

Examples

One wrapper, safe defaults

The team creates llm-client.ts with store: false, a fixed regional base URL and a startup check that refuses to boot if either value is missing. Feature code imports ask() and cannot bypass it.

A forgotten file store

A contract-review tool uploaded PDFs to the provider's file API and never deleted them. A cleanup job now deletes each file after the call returns, and a weekly report lists any file older than one day.

Key points

  • Read the provider's data-controls page: what is stored, for how long, and which flags you can change.
  • No training on API data is a different promise from no retention, so check both.
  • Set storage flags and region in one shared client wrapper so every call gets them.
  • Zero data retention usually needs a request or contract and can disable some features.
  • Check that logs, files and gateways stay in the required region, not only the model endpoint.

Common mistakes

  • Reading a marketing page instead of the data-controls documentation.
  • Assuming that because the provider does not train on the data, it does not keep it.
  • Setting the region on the model call but not on logs, files or the vector store.
  • Letting each service build its own client with its own defaults.

Check yourself · 2 of 3

Where is the safest place to set store: false and the regional base URL for every LLM call?

Choose one answer

Check yourself · 3 of 3

You pinned the model call to an EU endpoint, but your logging gateway sits in another region and records prompts. What is the problem?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic