Tag Support

Tag format specification, query API endpoints, and CEL filter syntax for AI Enabler request tags.

This page provides the full specification for AI Enabler request tags, including the tag format, CEL filter syntax for analytics queries, and links to the tag query API endpoints.

For an introduction to tags and instructions on attaching them to requests, see Tags.

Tag format specification

Tags follow a key:value format validated against the following pattern:

^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?:[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$
ConstraintValue
Formatkey:value
Key length1–64 characters
Value length1–64 characters
Max tags per request10
First/last characterMust be alphanumeric (a-z, A-Z, 0-9)
Interior charactersLetters, numbers, hyphens (-), underscores (_), dots (.)

Tag headers

Tags can be sent as comma-separated values via HTTP headers. Two header names are supported:

HeaderDescription
X-TagsPrimary tag header
X-LiteLLM-TagsAlternative header for LiteLLM compatibility

When tags are provided in both headers and the request body, AI Enabler merges and deduplicates them.

Tag query API

Three endpoints let you look up tags used across your organization. All endpoints require authentication via the X-API-Key header and return at most 50 results.

EndpointDescription
SearchTagKeysReturns tag keys used in your organization, ranked by popularity. Supports filtering by key prefix.
SearchTagValuesReturns values for a specific tag key, ranked by popularity. Supports filtering by value prefix.
SearchTagsReturns full key:value tag combinations, ranked by popularity. Supports filtering by key prefix.

See the linked API reference pages for request parameters, example requests, and response schemas.

Filtering analytics by tags

The GenerateAnalytics and GenerateLatestInferenceSummaries endpoints accept a filter field that uses CEL (Common Expression Language) syntax to narrow results by tag. Pass a CEL expression to restrict results to requests matching specific tags.

ExpressionMeaningExample
tags["key"] == "value"Match requests with an exact key:value tagtags["env"] == "prod"
"key" in tagsMatch requests that have any value for the key"env" in tags
expr1 && expr2Combine multiple conditions with ANDtags["env"] == "prod" && tags["team"] == "ml"

Expressions can be combined freely. For example, to match production requests that have any experiment tag:

tags["env"] == "prod" && "experiment" in tags

See the linked API reference pages for the full request and response schemas.

See also