What it does
TheX-Lectr-Task header tells Lectr what kind of work a request is doing.
Without it, Lectr guesses from signals like prompt length and response length — educated guesses, medium confidence. With it, Lectr knows with certainty and generates high-confidence model recommendations.
The five task types
Values outside this list are stored as-is and visible in your dashboard but
don’t influence recommendations.
Adding the header
How Lectr uses it
Model recommendations
Task type is the highest-confidence signal in the recommendation engine — it overrides heuristic signals when present.
The reasoning protection is hardcoded. No signal, no matter how strong, will
produce a downgrade recommendation for a
reasoning task.
Dashboard visibility
Task type appears as a column in your request logs table — you can see exactly which task type was tagged on each request and filter by it.Using with routing rules
Routing rules can use task type to automatically direct requests to the right model. For example:- run simple tasks on cheaper models
- reserve powerful models for complex reasoning
- optimize cost without changing application code
Reference
FAQ
Do I need X-Lectr-Feature to use X-Lectr-Task?
Do I need X-Lectr-Feature to use X-Lectr-Task?
No — they’re independent. But combining them gives Lectr the most context and
produces the most confident recommendations.
What if my feature does multiple task types?
What if my feature does multiple task types?
Override per request. A chat feature might use
reasoning for complex
questions and generation for drafting — tag each request with what it’s
actually doing.Does this affect my prompts or responses?
Does this affect my prompts or responses?
No. Lectr reads the header and stores it as metadata. Your prompt, model
choice, and response are untouched.
Does it add latency?
Does it add latency?
No. The header is read on ingress and stored after the request completes.
Zero hot path impact.