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])?$| Constraint | Value |
|---|---|
| Format | key:value |
| Key length | 1–64 characters |
| Value length | 1–64 characters |
| Max tags per request | 10 |
| First/last character | Must be alphanumeric (a-z, A-Z, 0-9) |
| Interior characters | Letters, numbers, hyphens (-), underscores (_), dots (.) |
Tag headers
Tags can be sent as comma-separated values via HTTP headers. Two header names are supported:
| Header | Description |
|---|---|
X-Tags | Primary tag header |
X-LiteLLM-Tags | Alternative 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.
| Endpoint | Description |
|---|---|
| SearchTagKeys | Returns tag keys used in your organization, ranked by popularity. Supports filtering by key prefix. |
| SearchTagValues | Returns values for a specific tag key, ranked by popularity. Supports filtering by value prefix. |
| SearchTags | Returns 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.
| Expression | Meaning | Example |
|---|---|---|
tags["key"] == "value" | Match requests with an exact key:value tag | tags["env"] == "prod" |
"key" in tags | Match requests that have any value for the key | "env" in tags |
expr1 && expr2 | Combine multiple conditions with AND | tags["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 tagsSee the linked API reference pages for the full request and response schemas.
See also
Updated 1 day ago
