Skip to contentSkip to page list

Docs

Retention

What the LangWatch AI Gateway stores for each request, and which setting governs how long each record lives.

On this page

What the gateway stores

The gateway has no retention setting of its own. Each record it produces lives in a platform store, and that store's rule applies.

RecordWhat it holdsWhere it livesGoverned by
TracesOne trace per request, with the model, the tokens, the cost and the request and response content, in the project the virtual key is scoped to. A successful /v1/chat/completions or /v1/messages request that returns no output, no completion tokens and no cost is dropped before export and stores no traceTrace storeThe data retention policy of the project, its team or the organization
Spend recordsOne spend event per request: cost, tokens, model, virtual key, end userSpend storeA fixed 13 months. Exempt from the data retention policy. See Billing and spend events
Budget ledgerThe debits each budget enforces againstBudget ledgerNo expiry
Audit logWho created, rotated, revoked or changed a virtual key, budget, provider, cache rule or guardrailPostgres audit logNot subject to the data retention policy. See Audit log
OCSF eventsOne OCSF row per trace that arrives through an ingestion sourceOCSF event storeNo expiry. See OCSF export

Traces follow the data retention policy

Set the policy under Settings > Data Retention. A policy applies to an organization, a team or a project, and the most specific one wins. Periods are whole weeks. You can apply a new policy to data that is already stored.

Retention is scoped per organization, team, and project, never per ingestion source. Compliance notes that describe a per-source retention class map onto these scoped policies instead.

Trace retention and spend retention are independent. When a trace ages out before its spend record, the spend record still reconciles, and only the link from the record to the trace is gone.

Also check: Data retention for the plan limits, the presets and how deletion works.

Documentation