Skip to content
Agentmart
Submit a tool

openrouter

Choose OpenRouter models and routers, query live catalog data, use structured outputs and batch inference, and debug routing with metadata.

Skill by nateslabach

IndexedMIT★ 6
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/nateslabach-openrouter

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: data, ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Node.js package

Network hosts it talks to 2

  • codeload.github.com · found in install command
  • openrouter.ai · found in code

Files it touches

  • ~/.claude/skills/openrouter

What's inside

Skill 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.
License
MIT
Instructions
76 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions call the network

Files (14)

  • SKILL.md
  • SOURCE.md · references/
  • batch.md · references/
  • models-scripts.md · references/
  • routing.md · references/
  • .gitignore · scripts/
  • compare-models.ts · scripts/
  • get-endpoints.ts · scripts/
  • lib.ts · scripts/
  • list-models.ts · scripts/
  • package-lock.json · scripts/
  • package.json · scripts/
  • resolve-model.ts · scripts/
  • search-models.ts · scripts/

SKILL.md (first lines)

# 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)

From nateslabach/skills, MIT.

More from nateslabach/skills

Compare and alternatives

    Featured in

    Signals

    Stars
    6
    Forks
    0
    Open issues
    0
    Last commit (this folder)
    Sep 29, 2026 (28 days ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    License
    MIT
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from nateslabach

    Cite this page

    openrouter skill. Agent Mart. https://agentmart.dev/skills/nateslabach-openrouter (last updated 2026-10-24)