Skip to main content
Tagging is how Cloudidr LLM Ops cost attributes every API request to the right part of your organization. Three optional HTTP headers added to your request unlock full cost visibility by department, project, and agent — across every model and provider.

How Tagging Works

Tags are passed as standard HTTP headers on each request through the Cloudidr proxy, alongside your X-Cloudidr-Key authentication header. Cloudidr logs each tag value alongside the request’s token count, cost, model, and timestamp. The result is a fully attributed cost record — queryable by any tag dimension in your LLM Ops dashboard.

The Three Tag Dimensions

X-Department can represent a department or a team — whichever fits your org structure. Some organizations tag by formal department (Engineering, Marketing). Others use it as a team label (Backend, DevOps, Content). Both are valid. If you only have one level of group hierarchy, use X-Department for it.

Flexibility — Use What You Need

All three tags are completely optional. Use none, one, two, or all three — any combination works. Start with just X-Agent and add more dimensions as your observability needs grow.

Code Examples

Python — Anthropic

Python — OpenAI

JavaScript / Node.js — Anthropic

JavaScript / Node.js — OpenAI

cURL — Anthropic

cURL — OpenAI


Real-World Tagging Patterns

Pattern 1 — Agent Only

Suitable for single-team setups or early-stage cost tracking. Immediately surfaces per-agent cost breakdown in Agent Explorer.
Dashboard result: Total cost and tokens broken down per agent. Budget Guard limits can be set immediately.

Pattern 2 — Department as Team Label

Use X-Department to represent a team when your org doesn’t distinguish department from team hierarchy.
Dashboard result: Team-level cost rollup (Backend) with per-agent detail (API Service).
Full three-tag setup gives the complete org cost picture — department → project → agent — in a single dashboard view.
Dashboard result:
  • Department: Marketing → $900/month
  • Project: SEO-Pipeline → $900/month
  • Agent: SEO → $900/month, 91.2% savings rate

Pattern 4 — Multi-Agent Project

Tag each agent call with the same project so the dashboard rolls them up into a single project cost view.
Dashboard result: Outbound-Pipeline total cost shown in one view, split across Lead Research, Email Drafter, and Lead Qualifier.

What You See in the Dashboard

Once tags are flowing, the LLM Ops dashboard lets you:
  • Slice by any tag dimension — filter spend by X-Department, X-Project, or X-Agent
  • Compare across departments/teams — see which group drives the most spend and at what savings rate
  • Set Budget Guard limits per agent — Budget Guard uses the X-Agent value to enforce per-agent monthly budgets
  • Track project-level ROI — tie token spend directly to a business initiative using X-Project
  • Identify runaway agents — an agent with unexpectedly high token consumption shows up immediately in Agent Explorer

Tag Naming Conventions

⚠️ Tag values are case-sensitive and matched by exact string. Engineering and engineering are stored as two separate groups in the dashboard. A single inconsistency across your codebase will split what should be one group into two. Establish your convention once and enforce it everywhere.
Recommended: use Title Case for all tag values.
  • X-DepartmentEngineering, Marketing, Inside Sales, Data Science
  • X-AgentLead Gen, Monitoring, SEO, API Service, Content Writer
  • X-ProjectCustomer-Search, SEO-Pipeline, Lead-Gen-V2 (hyphenated Title Case works well for programmatic names)
Title Case reads cleanly as display labels in the dashboard, matches how agents appear in Agent Explorer, and reduces the most common mistake — one service using marketing and another using Marketing creating two separate cost groups. Other conventions to follow:
  • Use hyphens for multi-word project namesCustomer-Search not Customer Search (spaces can cause issues in some header parsers)
  • Keep values short and stable — these become filter labels and budget group identifiers; changing them mid-deployment splits your historical data
  • Never mix conventions — if you start with Engineering, don’t switch to engineering or ENGINEERING mid-project

Summary

Use none, one, or all three optional tags — tagging is additive. Every tag unlocks a new dimension of cost visibility in your LLM Ops dashboard without any other configuration required.
For questions or integration help → support@cloudidr.com · llm-ops.cloudidr.com