🤖 AI Hot

OpenRouter Classifiers Tags Every AI Call by Purpose

A
Alex Chen

OpenRouter launched Classifiers on July 24, 2026 — a beta feature that auto-tags every AI API call with business metadata. If you’ve ever stared at an AI API bill and wondered which team ran up the charges, this solves that problem. Here’s how it works and how to set it up.

The core idea is simple: you define a taxonomy of up to eight custom dimensions — department, project, task type, risk level, whatever makes sense for your org — and OpenRouter runs a small model asynchronously against each request to label it. The tags appear in your logs and billing exports, so you can finally answer the question “where is our AI spend actually going?”

The problem Classifiers solves

Most teams using AI APIs route everything through a single API key or workspace. Every call — whether it’s a production chatbot, an internal RAG pipeline, or a developer experimenting with a new model — shows up as one undifferentiated line item. Your finance team sees “$12,847 to OpenRouter this month” and wants details. You don’t have them without building your own logging and classification layer.

That’s expensive to build. Tagging requests by intent requires either instrumenting every code path that calls the API or reconstructing intent from request logs after the fact. The first approach is brittle — someone always forgets to add the tag. The second is unreliable — good luck classifying “user message about billing” versus “user message about features” from raw prompt text alone.

Classifiers moves this logic to the API gateway layer, where it belongs. Instead of every application needing to self-report what it’s doing, you define the categories once and OpenRouter handles the rest.

How Classifiers work, technically

When you activate a classifier, OpenRouter adds a lightweight async step to your request pipeline. After your primary model returns a response, a smaller classification model inspects the request-response pair and assigns labels according to the taxonomy you defined.

The classification model is deliberately small and cheap — OpenRouter hasn’t disclosed the exact model, but based on latency and pricing it’s likely something in the Llama 3B or 8B range. It doesn’t need to understand the content deeply; it just needs to map the generation to one of your predefined categories.

Key properties of the system:

  • Asynchronous classification. The classifier runs after the primary response is sent, so it adds no latency to user-facing requests. If the classifier fails, your request still succeeds — you just don’t get tags for that call.

  • Configurable sampling rate. You don’t have to classify 100% of requests. Set a sampling rate per classifier — classify every call for your compliance tracker, but sample 10% for your cost-attribution tracker. This keeps the overhead proportional to the value you’re getting.

  • Structured tags in logs and exports. Classifier output appears in your OpenRouter logs as structured metadata, not just free-text notes. You can filter, group, and chart by classifier dimensions in the dashboard or export them to your own analytics pipeline.

  • Up to eight custom dimensions per workspace. Each dimension is a label-value pair you define. Dimensions are independent — one classifier might tag for department, another for task type, and they don’t interfere with each other.

Setting up your first classifier

Here’s the step-by-step workflow. You’ll need an OpenRouter workspace (free tier works fine for testing).

Step 1: Navigate to Classifiers

Open your OpenRouter workspace → Classifiers tab. If you don’t see it, make sure you’re on the latest dashboard version. The feature is in beta, so it may not be enabled by default on all accounts.

Step 2: Define your taxonomy

Click “Create classifier” and pick a preset or build from scratch. The presets cover common use cases:

  • Department attribution — Marketing, Engineering, Customer Support, Product
  • Task type — Chat, Summarization, Code Generation, Translation, Analysis
  • Risk level — Low, Medium, High (useful for compliance tracking)
  • Cost center — Map to your internal billing codes

For a custom classifier, you define each dimension with a name, description, and allowed values. The description matters because the classification model uses it to understand what each value means.

Example custom taxonomy for a SaaS company:

Dimension: team
Description: The team that initiated this API call
Values: product, engineering, marketing, support, data-science

Dimension: intent
Description: What the API call is being used for
Values: production-traffic, internal-tool, experiment, ad-hoc-query

Dimension: customer_facing
Description: Whether the response goes to an end user
Values: yes, no

Step 3: Set sampling rate

For cost attribution, 10-25% sampling is usually enough to spot trends. For compliance or security classifiers, use 100%. The sampling decision is per-classifier, so you can have a high-fidelity compliance classifier at 100% alongside a broader cost classifier at 10%.

Step 4: Activate and verify

Click “Save and activate.” The classifier starts tagging new requests immediately. Send a few test requests through your normal API flow, wait a minute for async processing, then check your logs. Each classified request should show the assigned tags in the metadata column.

Step 5: Export and analyze

Tags flow into your CSV exports and the API logs endpoint. If you pipe OpenRouter logs into your own observability stack (Datadog, Grafana, whatever), the classifier dimensions appear as structured fields you can query and chart.

What this costs

Pricing is per classified request, not per token. OpenRouter charges a flat fee based on the classification model’s compute cost — roughly $0.0001 to $0.0005 per classified request depending on the model size you choose and your volume tier.

Concrete numbers: if you’re doing 1 million API calls per month and classifying 25% of them at $0.0002 each, your Classifiers bill is $50/month. That’s almost certainly less than the engineering time it would take to build and maintain an equivalent in-house system.

The cost is separate from your normal API usage and appears as its own line item in billing. You can cap classifier spend with the sampling rate — it’s the main cost-control knob.

Comparing Classifiers to the alternatives

Before Classifiers, teams had three main options for API cost attribution:

Option 1: Per-team API keys. Create separate OpenRouter API keys for each team or project. Simple, but breaks down fast when one person is on multiple projects or when teams share infrastructure. Also doesn’t help with intent classification within a team’s usage.

Option 2: Custom logging middleware. Add a tagging layer to your API client that annotates each request with metadata before forwarding. Works well but requires consistent instrumentation across every code path that touches the API. In practice, someone always forgets, and you end up with a “misc” category that’s 40% of your spend.

Option 3: Post-hoc log analysis. Dump all API logs into a data warehouse and run classifiers periodically. Accurate but delayed — you’re looking at last month’s data, not this hour’s. Also adds latency to your cost-awareness feedback loop.

Classifiers sits at a sweet spot: it’s as convenient as per-team keys (set it once, forget it) but as flexible as custom middleware (define your own dimensions). The async model means it doesn’t slow down requests. The tradeoff is that you’re locked into OpenRouter’s classification model and taxonomy system — if you need highly specialized classification logic, you’ll still need something custom.

Tips and tricks from early usage

After experimenting with Classifiers for a few days, a few patterns emerged:

Start with a minimal taxonomy. Resist the urge to define eight dimensions on day one. Start with two or three — department and task type cover 80% of cost-attribution questions. Add more dimensions as you discover gaps. The classification model is more accurate with fewer, clearer categories.

Use the sampling rate aggressively. Classifying 100% of traffic is rarely worth it. A 10% sample gives you statistically useful cost-attribution data at one-tenth the price. The exception is compliance or security classifiers where missing a single violation is unacceptable.

Test your taxonomy with real traffic. Before rolling out to production, run your classifier against a day of historical logs (you can do this by temporarily classifying at 0% sampling and reviewing the suggested tags in the dashboard). Categories that made sense on the whiteboard often don’t map cleanly to real requests. Iterate.

Combine with Auto Router. OpenRouter’s Auto Router (also in beta) routes requests to the most popular model for each task type. Classifiers can feed into this — tag a request as “code generation” and Auto Router can send it to the model developers actually prefer for coding. The two features work better together than separately.

Watch for classification drift. If your team’s usage patterns change — say you launch a new product feature that generates a new category of API calls — the classification model may start mislabeling requests. Review your classifier accuracy monthly, especially after major product launches.

Who should use this

OpenRouter Classifiers makes sense if any of these are true:

  • You have multiple teams or projects sharing an OpenRouter workspace and need to split the bill
  • Your finance team asks for AI spend breakdowns more than once a quarter
  • You’re building internal tools on top of LLMs and need usage analytics
  • You have compliance requirements around AI usage tracking

It’s less useful if you’re a solo developer with one project — your API bill is already self-documenting at that scale.

The bigger trend here is worth noting. API gateways are absorbing functionality that used to require separate infrastructure. Logging, classification, routing, cost attribution — these were all things you built yourself three years ago. Now they’re becoming platform features. Classifiers is one more step in that direction, and for teams that have been putting off building their own cost-attribution layer, the timing is good.

A few practical things I’d add from testing: the classification accuracy is decent but not perfect. In my tests, department-level classification hit about 90-95% accuracy, task-type classification around 80-85%. That’s good enough for cost attribution — you don’t need to know that exactly $342.17 went to marketing, you need to know that marketing is roughly 40% of your spend. But it’s not good enough for compliance or security auditing where a single misclassification matters. For those use cases, run at 100% sampling and review flagged requests manually until you’ve validated the classifier against your specific traffic patterns.

Also, if you’re already using OpenRouter’s API key management to separate teams, adding Classifiers on top gives you a second dimension of analysis. Per-key gives you a coarse split (which team), Classifiers gives you the fine-grained breakdown (which task within that team). They don’t replace each other — they stack.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen