Identify your API consumer
LLM Gateway supports the ability to identify and segment requests based on the x-lunar-consumer-tag header. This feature allows you to add a custom header to their HTTP requests, enabling better visibility and control in LLM Gateway Control Plane.
When a request is sent with the x-lunar-consumer-tag header, LLM Gateway captures this header and uses it for segmentation and filtering:
- Segmentation: In the discovery command, LLM Gateway segments results by different consumer tags, providing a detailed view of traffic per consumer. For example, requests tagged with
x-lunar-consumer-tag: example-appwill be grouped under theexample-appconsumer segment. - Filtering: In the control plane dashboards, you can filter views according to specific consumer tags. This allows for more focused monitoring and troubleshooting based on the origin of requests. Implementation
To use this feature, add the x-lunar-consumer-tag header to your outgoing HTTP requests. The header value should be a short, informative string indicating the name of the application, service, or job from which the request originated.
The x-lunar-consumer-tag header (as with any other header prefixed with x-lunar-) will be removed from the request before it is sent to a third-party provider. This ensures that the header is used solely for internal purposes within the LLM Gateway ecosystem and does not affect the behavior of external APIs.