create-agent-tui
Scaffolds a complete agent TUI in TypeScript using @openrouter/agent — like create-react-app for terminal agents. Generates a…
Construct and execute analytics queries against the OpenRouter API — full parameter reference for metrics, dimensions, filters, time ranges, ordering, and pagination. Use when building or debugging an analytics query, understanding the request/response shape, or handling query
$ npx -y skills add openrouterteam/skills --skill openrouter-analytics-query --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/openrouter-analytics-queryContext preview
The summary Claude sees to decide when to auto-load this skill.
Construct and execute analytics queries against the OpenRouter API — full parameter reference for metrics, dimensions, filters, time ranges, ordering, and pagination. Use when building or debugging an analytics query, understanding the request/response shape, or handling query
name: openrouter-analytics-query description: Construct and execute analytics queries against the OpenRouter API — full parameter reference for metrics, dimensions, filters, time ranges, ordering, and pagination. Use when building or debugging an analytics query, understanding the request/response shape, or handling query errors. version: 0.1.0
Full reference for constructing and executing analytics queries against the OpenRouter API.
POST https://openrouter.ai/api/v1/analytics/query Authorization: Bearer sk-or-v1-... Content-Type: application/json
Or via the `openrouter-analytics` skill scripts:
cd <openrouter-analytics-skill-path>/scripts && npx tsx query-analytics.ts --metrics request_count
> **Source of truth (avoid drift):** the metric/dimension names and the request schema below are illustrative. The live, authoritative list comes from the **meta endpoint** — call `GET /api/v1/analytics/meta` (or `discover-schema.ts`) and treat its response as canonical. For agent-readable docs, OpenRouter publishes [`llms.txt`](https://openrouter.ai/docs/llms.txt). Prefer those over the inline examples in this file if they ever disagree.
{
"metrics": ["request_count", "total_usage"],
"dimensions": ["model"],
"granularity": "day",
"time_range": {
"start": "2026-05-01T00:00:00Z",
"end": "2026-05-20T00:00:00Z"
},
"filters": [
{ "field": "model", "operator": "eq", "value": "anthropic/claude-sonnet-4" }
],
"order_by": { "field": "total_usage", "direction": "desc" },
"limit": 100,
"group_limit": 20,
"classifier_dimensions": {
"classifier_id": "<uuid>",
"dimension_names": ["category"],
"include_nulls": false
},
"classifier_filters": {
"classifier_id": "<uuid>",
"filters": [
{ "field": "sentiment", "operator": "eq", "value": "positive" }
]
}
}| Field | Type | Description | |---|---|---| | `metrics` | `string[]` | At least one metric to compute. Call the meta endpoint to see available metrics. |
| Field | Type | Default | Description | |---|---|---|---| | `dimensions` | `string[]` | `[]` | Up to 2 dimensions to group by | | `granularity` | `string` | none | Time bucketing: `minute`, `hour`, `day`, `week`, `month` | | `time_range` | `object` | last 7 days | `{ start, end }` as ISO 8601 UTC datetime strings. Seconds are required (`YYYY-MM-DDTHH:MM:SSZ`; fractional seconds allowed) — minute-precision values such as `2026-05-01T00:00Z` are rejected with 400. | | `filters` | `object[]` | `[]` | Up to 20 filter conditions | | `order_by` | `object` | time desc (if granularity set) | `{ field, direction }` where field is a metric, dimension, or `"date"` (short-form alias — maps to `date__day`, `date__hour`, etc. based on granularity) | | `limit` | `integer` | 1000 | Maximum total rows to return (1–10,000). On time-series queries with dimensions and no explicit `group_limit`, the server may raise this to accommodate the expected number of time-bucket/dimension combinations. | | `group_limit` | `integer` | auto-computed | Maximum rows per distinct dimension combination (ClickHouse LIMIT n BY). When omitted on time-series queries (granularity + dimensions), auto-computed from the time range to guarantee full time-window coverage per group. Explicit values override the default. Ignored when no dimensions are specified. | | `classifier_dimensions` | `object` | none | Group by dynamic classifier-produced dimensions. See [Classifier Dimensions](#classifier-dimensions) below. | | `classifier_filters` | `object` | none | Filter on classifier-produced dimension values. See [Classifier Filters](#classifier-filters) below. |
{ "field": "<dimension_name>", "operator": "<op>", "value": "<value>" }{ "field": "<metric_or_dimension_or_date>", "direction": "asc" | "desc" }When `granularity` is set and no `order_by` is specified, results are ordered by time descending.
Classifier dimensions allow grouping by dynamic, user-defined classification labels (e.g., topic, sentiment, category) produced by a classifier attached to your account.
{
"classifier_dimensions": {
"classifier_id": "550e8400-e29b-41d4-a716-446655440000",
"dimension_names": ["category"],
"include_nulls": false
}
}| Field | Type | Required | Description | |---|---|---|---| | `classifier_id` | `string` (UUID) | Yes | ID of the classifier (must belong to the caller's acco
A collection of Agent Skills for building with OpenRouter — a unified API for 600+ AI models.
Scaffolds a complete agent TUI in TypeScript using @openrouter/agent — like create-react-app for terminal agents. Generates a…
Scaffolds a headless agent in TypeScript using @openrouter/agent and Bun — for CLI tools, API servers, queue workers, and…
Install Ori and run the user's existing coding agent CLI through Ori on OpenRouter, with OAuth sign-in, model selection,…
Migration guide from @openrouter/sdk to @openrouter/agent for callModel, tool(), stop conditions, and agent features. This skill…
Discover the OpenRouter analytics schema — available metrics, dimensions, filter operators, and granularities. Use when you need…
Answer natural-language questions about a user's OpenRouter usage data — spend, request volume, model breakdown, latency, token…