Documentation Index
Fetch the complete documentation index at: https://docs.lectr.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
By default, Lectr tracks every request your application makes. But without context, all you see is an aggregate — total cost, total requests, average latency across everything. Feature tagging tells Lectr which part of your product made each request. Once tagged, the dashboard breaks down cost, latency, errors, and token usage by feature.| Scope | Cost |
|---|---|
| All requests (aggregate) | $142.00 |
| Feature | Cost | Share |
|---|---|---|
| chat | $89.00 | 63% |
| summariser | $38.00 | 27% |
| classifier | $8.00 | 6% |
| onboarding | $7.00 | 4% |
How it works
Add one header to your requests:untagged in the dashboard. You will not be warned or blocked for missing it — but you will get significantly less useful data.
Adding the header
The simplest approach is creating a dedicated client instance per feature.Per-request override
If you share a single client across your application, override the header per request instead:Framework patterns
If your application uses a wrapper or service layer around your AI client, pass the feature tag at the call site:Naming your features
Feature names are freeform strings. A few conventions that make your dashboard more useful: Use names that match how you talk about the feature internallysummariser and another sends summary, they appear as two features.
What you unlock in the dashboard
Once requests are tagged, Lectr surfaces feature-level insights across every metric. Cost breakdown See exactly which features drive your AI spend.Untagged traffic
Requests withoutX-Lectr-Feature are grouped under untagged in the dashboard.
If a large share of your traffic is untagged, the dashboard will prompt you:
Combining with task types
Feature tagging tells Lectr which feature made a request. Task type tagging tells Lectr what kind of work the request performs. Used together, they give Lectr enough context to make confident model recommendations:Reference
| Header | Value | Required |
|---|---|---|
X-Lectr-Feature | Any short string identifying the feature | No |
FAQ
What happens if I send different feature names for the same logical feature?
What happens if I send different feature names for the same logical feature?
Lectr treats each unique string as a separate feature. If you send
summariser from one service and summary from another, the dashboard shows two separate features. Use a constants file to keep names consistent across your codebase.Can I change a feature name after I've been using it?
Can I change a feature name after I've been using it?
Yes. Update the header value in your code. Historical requests keep the
original tag.
Is there a limit to how many feature tags I can use?
Is there a limit to how many feature tags I can use?
Does feature tagging add latency?
Does feature tagging add latency?
No. The header is read once when the request enters the proxy and stored as
metadata after the request completes.
Can I use feature tagging with streaming requests?
Can I use feature tagging with streaming requests?
Yes. Feature tagging works the same for streaming and non-streaming requests.