Skip to content
Skills Library
AI & agents · Tool integration

openrouter

/openrouter

Choose OpenRouter models and routers, query live catalog data, use structured outputs and batch inference, and debug routing with metadata. Use when working with OpenRouter APIs, openrouter/auto, openrouter/free, model discovery, pricing, providers, batch jobs, or structured JSON responses.

Repository
skills ↗
Licence
MIT
Last repository change
29.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
14
Scripts
6
HTML comments
0
URLs in SKILL.md
10
Deprecation

No signals detected. Repository changed on 29.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 6 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/compare-models.ts, scripts/get-endpoints.ts, scripts/lib.ts, scripts/list-models.ts, scripts/resolve-model.ts, scripts/search-models.ts

What it does and when to use it

Choose OpenRouter models and routers, query live catalog data, use structured outputs and batch inference, and debug routing with metadata. Use when working with OpenRouter APIs, openrouter/auto, openrouter/free, model discovery, pricing, providers, batch jobs, or structured JSON responses.

Original author description

Choose OpenRouter models and routers, query live catalog data, use structured outputs and batch inference, and debug routing with metadata. Use when working with OpenRouter APIs, openrouter/auto, openrouter/free, model discovery, pricing, providers, batch jobs, or structured JSON responses.

How it works

  1. Core Principles
  2. When to Use
  3. When NOT to Use
  4. Implementation Guide
  5. Review Checklist
  6. References
Original SKILL.md headings · 76 lines, 561 words
SKILL.md preview
---
name: openrouter
description: >-
  Choose OpenRouter models and routers, query live catalog data, use structured
  outputs and batch inference, and debug routing with metadata. Use when working
  with OpenRouter APIs, openrouter/auto, openrouter/free, model discovery,
  pricing, providers, batch jobs, or structured JSON responses.
---

# openrouter

One API for hundreds of models. Prefer live catalog data over memory; model IDs and prices change.

## Core Principles

- Resolve informal names with `scripts/resolve-model.ts` before coding against a slug.
- Prefer a concrete model when quality, cost, or providers must be fixed. Use `openrouter/auto` when the task type varies. Use `openrouter/free` only for zero-cost experiments.
- Singular `model` picks one slug (or router). Plural `models: [...]` is the fallback chain — different field, different behavior.
- Pay the selected model's rate for routers — no router surcharge. Default auto cost band is roughly `low` if unset.
- Send `HTTP-Referer` and `X-Title` on app requests (OpenRouter app attribution). Opt in to routing visibility with `X-OpenRouter-Metadata: enabled`. Cache hits omit metadata.
- Filter for capabilities (`tools`, `structured_outputs`, modalities) before picking a model; pin with `provider.require_parameters` when the feature is mandatory.
- Batch is for async bulk work (24h window, ~50% token pricing). Sync API for streaming, multimodal base64, and OpenRouter-orchestrated web search.

## When to Use

- Pick, compare, or price models on OpenRouter
- Wire `openrouter/auto`, `openrouter/free`, fallbacks, or provider prefs
- Structured JSON (`response_format` / `json_schema`)
- Submit or poll Batch API jobs
- Debug which model/provider actually served a request

## When NOT to Use

- Non-OpenRouter providers or local-only inference
- Model vibe-checks / launch-day evals → `model-bench`
- Deep product research unrelated to OpenRouter APIs

## Implementation Guide

1. **Auth:** `OPENROUTER_API_KEY` from https://openrouter.ai/keys — required for chat/batch; optional for most model list scripts; required for `get-endpoints.ts`.
2. **Discover models:** from **this skill’s** `scripts/` directory, run `npm install` once, then follow [references/models-scripts.md](references/models-scripts.md). Or `GET https://openrouter.ai/api/v1/models` with filters (`sort`, `supported_parameters`, `output_modalities`).
3. **Route the request:**
   - Fixed slug: resolve live, then set `model`
   - Auto: `model: "openrouter/auto"` + optional `plugins: [{ id: "auto-router", cost_tier, allowed_models, excluded_models }]`
   - Free pool: `model: "openrouter/free"` (or `slug:free` for a specific free variant)
   - Fallbacks: `models: ["primary", "backup", ...]` — not the `model` field
   - Multi-turn auto: pass `session_id` (or rely on message fingerprint) for model/provider stickiness
4. **Structured outputs:** `response_format: { type: "json_schema", json_schema: { name, strict: true, schema } }`. Confirm `structured_outputs` on the model; use `require_parameters: true` to avoid unsupported endpoints. Non-streaming can use response-healing plugin.
5. **Observe:** header `X-OpenRouter-Metadata: enabled` → `openrouter_metadata` (strategy, endpoints, attempts, pipeline). Auto task type lives at `pipeline` stage data `task_type`.
6. **Batch:** see [references/batch.md](references/batch.md). JSON key order: `endpoint`, `model`, `provider?`, then `requests`.

Minimal auto + metadata pattern (agents get this wrong without the header + plugin id):

```bash
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "HTTP-Referer: https://your-app.example" \
  -H "X-Title: Your App" \
  -H "Content-Type: application/json" \
  -H "X-OpenRouter-Metadata: enabled" \
  -d '{
    "model": "openrouter/auto",
    "session_id": "conv-1",
    "plugins": [{"id": "auto-router", "cost_tier": "medium"}],
    "messages": [{"role": "user", "content": "Refactor this function for clarity"}]
  }'
```

## Review Checklist

- [ ] Model ID resolved from live catalog, not memorized
- [ ] Required params present in `supported_parameters` (or `require_parameters`)
- [ ] Router choice matches constraint needs (fixed vs auto vs free)
- [ ] `model` vs `models` (fallback array) used correctly
- [ ] Metadata enabled when debugging routing
- [ ] Batch vs sync chosen for latency/modalities correctly

## References

- [references/models-scripts.md](references/models-scripts.md) — official discovery scripts
- [references/routing.md](references/routing.md) — auto, free, fallbacks, metadata
- [references/batch.md](references/batch.md) — Batch API gotchas
- Docs: [Models](https://openrouter.ai/docs/guides/overview/models), [Auto](https://openrouter.ai/docs/guides/routing/routers/auto-router), [Free](https://openrouter.ai/docs/guides/routing/routers/free-router), [Structured outputs](https://openrouter.ai/docs/guides/features/structured-outputs), [Router metadata](https://openrouter.ai/docs/guides/features/router-metadata), [Batch](https://openrouter.ai/docs/batch-quickstart)
Files in this package (14)
  • SKILL.md 5 KB
  • references/SOURCE.md 1 KB
  • references/batch.md 2 KB
  • references/models-scripts.md 2 KB
  • references/routing.md 3 KB
  • scripts/.gitignore 1 KB
  • scripts/compare-models.ts 4 KB
  • scripts/get-endpoints.ts 3 KB
  • scripts/lib.ts 2 KB
  • scripts/list-models.ts 1 KB
  • scripts/package-lock.json 16 KB
  • scripts/package.json 1 KB
  • scripts/resolve-model.ts 5 KB
  • scripts/search-models.ts 1 KB

Versions

RepositoryScoreLicence
This page · nateslabach/skills100MIT
mrsandipmandal/CineForge100Apache-2.0
davidondrej/skills100MIT

Database snapshot: 13.11.2026 · package version 377fbf8289ff (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100openrouter-model-catalog
    Build explore and query the OpenRouter model catalog programmatically. Use when selecting models or checking availability. Trigger with phrases like 'openrouter models', 'list openrouter models', 'openrouter model catalog', 'available models openrouter'.
  • 100openrouter-model-routing
    Implement advanced model routing with A/B testing. Use when optimizing model selection or running experiments. Trigger with phrases like 'openrouter a/b test', 'model experiment', 'openrouter routing', 'model comparison'.
  • 95openrouter-integration
    Connect apps to hundreds of AI models through OpenRouter — live model and discount discovery, batch and service-tier cost controls, multimodal chat, exact cost and credit diagnostics, provider routing, reasoning, tool calling, structured output validation, starter templates,…
  • 90gdd-openrouter-status
    Read-only OpenRouter catalog + tier-mapping diagnostic - surfaces catalog freshness (fetched_at vs the 24h TTL), the last-fetch timestamp, the resolved opus/sonnet/haiku → model mappings (via the Phase-33.6 adapter), and a per-tier preview. Use when investigating which…
  • 100openrouter-usage
    Query OpenRouter API costs, credits, and usage breakdown by model, provider, and date for the last 30 days. Triggers on API spending, check costs, openrouter usage, how much have I spent.
  • 100openrouter-evaluate
    Run a bounded, authorized comparison or prompt test using OpenRouter models, then report outputs, observed behavior, and available cost metadata. Use for requests to test, compare, or evaluate models on actual prompts. Use Ori only when the user explicitly requests an Ori or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.