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.
Feature tagging is the foundation for several Lectr capabilities — including
cost breakdowns, anomaly detection, model recommendations, and routing rules.
Lectr reads this header when the request enters the proxy and associates the value with the request metadata it captures — including cost, latency, tokens, and errors.This value then appears throughout the dashboard in feature-level charts, tables, and filters.The header is optional. Requests without it are grouped under untagged in the dashboard. You will not be warned or blocked for missing it — but you will get significantly less useful data.
Feature names are freeform strings. A few conventions that make your dashboard more useful:Use names that match how you talk about the feature internally
Be consistent across your codebaseLectr treats each unique string as a separate feature.
If one service sends summariser and another sends summary, they appear as two features.
Keep your feature names in a constants file to avoid typos.
// lib/features.tsexport const Features = { CHAT: "chat", SUMMARISER: "summariser", CLASSIFIER: "classifier", ONBOARDING: "onboarding-assistant",} as const;
Latency analysisAverage and p95 latency per feature. If one feature slows down, you can see it immediately.Error ratesUnderstand which features are experiencing reliability issues.Model recommendationsLectr analyses usage patterns per feature and suggests cheaper models when quality is unlikely to change.Routing rulesFeature-based routing rules use feature tags to decide which model handles each request. This feature is in work and will be available in the future learn more.
Requests without X-Lectr-Feature are grouped under untagged in the dashboard.If a large share of your traffic is untagged, the dashboard will prompt you:
💡 38% of your requests have no feature tag. Add X-Lectr-Feature to unlock per-feature cost and latency breakdowns.
There is no penalty for untagged traffic. But the more of your traffic is tagged, the more useful your dashboard becomes.
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:
X-Lectr-Feature: classifierX-Lectr-Task: classification→ Strong recommendation: gpt-4o-mini handles classification at a fraction of gpt-4o cost
See Task Types for how to add task tagging alongside feature tagging.
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?
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?
No hard limit. In practice, most teams have between 3 and 15 features. Very
large numbers of feature tags (50+) can make the dashboard harder to read —
consider grouping related features if you find yourself with many.
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?
Yes. Feature tagging works the same for streaming and non-streaming requests.