Skip to main content
Tags are key/value labels you put on a call, such as client=acme or project=invoices. OmniRelay stores them with the request, so the console can split usage and cost per customer, project or environment. There is nothing to set up: tag a call and it appears on the Usage page.

Adding tags to a call

With the X-Gateway-Tags header

Write key=value pairs separated by commas. Spaces around a pair are ignored. If a proxy repeats the header, every copy’s pairs are kept.

With a tags field in the body

The field is removed before the request reaches a provider. A tags field that is not an object, such as the list some SDKs send, is ignored rather than refused.

As default tags on an API key

Tags set on a key are added to every call made with it, so a key that serves one customer or one environment needs nothing in its requests. Set them under Default tags when you create a key or open Key settings on the API Keys page.

From the OpenAI SDK

Combining sources

When a call gets tags from more than one place, they are merged by key and the call’s own tags win: the header over the key’s defaults, the body over both.

Rules

A call that breaks a rule fails with 400 invalid_tags, is not charged, and still appears on the Usage page as a failed request.
Every distinct value is a separate line in your usage breakdown. Use a small set of stable values, such as a customer, project, environment or feature name. Do not put personal data, request IDs or timestamps in tags.

Reading tagged usage

On the Usage page:
  • The Tag filter keeps calls carrying a tag key, or, with a value, only that value. It combines with the model, provider, key and status filters.
  • Explore → Group by → Tag splits spend, requests, tokens or errors by one tag key. Calls without that tag form their own row, so the rows add up to the total.
  • When the per-request list is enabled for your account, the Requests log shows each call’s tags and the CSV export has a tags column.
To see which tags were recorded for one call, ask for Request metadata.

Compatibility

The header and field names used to carry the OmniRelay name. The old names stay accepted and returned, with no end date, so nothing you already ship needs to change: