Skip to main content
Metadata lets you attach arbitrary key/value tags to any gateway request. The gateway stores them on the log entry, so you can filter, debug, and analyze traffic by business dimensions instead of raw model IDs.

How it works

Send a metadata object in the request body. It never reaches the provider — the gateway strips it before forwarding and stores it on the log entry:

Rules

Tracking users

Two separate mechanisms, like the industry-standard gateways:
  • user (body field) — the standard OpenAI field. Forwarded to the provider unchanged, and used as the logged end-user ID when no other value is present.
  • endUserId (token claim or x-gatelit-end-user-id header) — Gatelit-only, never sent to the provider. Wins over user when both are present.
For the full channel inventory and why attributes live where they do, see Conventions.

Filtering logs

The dashboard logs page filters on metadata tags with operators. Multiple conditions can be chained — they are combined with AND: Example chain: environment equals production and feature contains summar — only requests carrying both tags match. Notes:
  • contains treats % and _ as wildcards (SQL ILIKE semantics)
  • Keys with special characters (dots, quotes, spaces) can only be used with equals — the other operators address keys as a single path segment
  • Conditions that are only partially filled in (e.g. equals without a value) are ignored until completed

Common patterns

SDK

The TypeScript SDK exposes metadata and user on ChatOptions:

Security

Metadata is visible to dashboard users with access to the org’s logs. Never put secrets, full PII, or credentials in metadata — use opaque identifiers and classification labels.