openrouter

openrouter is a skill for Claude Code, Codex from davidondrej/skills. It costs 43 tokens per session (1,018 once invoked), scanned A, original, MIT.

A guide for configuring, building, and troubleshooting integrations with the OpenRouter API, a service that connects applications to language models from different providers.

In plain words
What is it for?
Choosing models, routing between providers, setting reasoning and token limits, sending images or tool calls, using structured output, and investigating cost, speed, streaming, or API errors.
Why use it?
It helps verify that model settings, limits, prices, fallbacks, and provider support match the actual request sent by the software. This reduces failures, unexpected costs, and incorrect assumptions about model capabilities.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Choosing models, routing between providers, setting reasoning and token limits, sending images or tool calls, using structured output, and investigating cost, speed, streaming, or API errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davidondrej/skills/openrouter
About the project

David Ondrej's Agent Skills is a repository of reusable instruction packages for AI coding, research, and workflow agents. Each skill describes a focused process for tasks such as code improvement, research, documentation, transcript work, and agent coordination. The catalogue entries are the repository's own skills and related agent configuration.

davidondrej/skills · 4,159 stars · on GitHub · cloudroom.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davidondrej/skills --skill openrouter
Clone the repo
git clone --depth 1 https://github.com/davidondrej/skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openrouter

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidondrej/skills/openrouter/github.svg)](https://agentmods.dev/skills/davidondrej/skills/openrouter)
Your own site
<a href="https://agentmods.dev/skills/davidondrej/skills/openrouter"><img src="https://agentmods.dev/badge/skills/davidondrej/skills/openrouter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openrouter

Your own site · 80×15
<a href="https://agentmods.dev/skills/davidondrej/skills/openrouter"><img src="https://agentmods.dev/badge/skills/davidondrej/skills/openrouter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01018
Opus 5.5 $0.00017 $0.00407
Sonnet 5.5 $0.00009 $0.00204
Haiku 4.5 $0.00004 $0.00102

Measured 21d ago against content hash fd8d38483bc2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

openrouter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ops-and-setup/openrouter/SKILL.md · 43 lines

How it starts

The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenRouter

Make model behavior explicit. Preserve the user's quality, cost, privacy, and reliability requirements across every route and retry.

Before changing configuration

  1. Inspect the actual outgoing request, SDK version, existing configuration, and user preferences. Redact credentials and content. A setting in a UI or config file does not prove the SDK sends it.
  2. Verify exact model IDs and live capabilities through the models API. Inspect the selected model's provider endpoints too. Check input/output modalities, context and output limits, supported parameters, reasoning options, prices, and provider availability for both primary and fallback models.
  3. Choose and record an explicit reasoning setting for each reasoning model. Use the user's requested effort. If unspecified, choose a supported value for the task and state the choice; do not silently inherit a provider default or impose one effort on every model. Read reasoning and output before setting these fields.
  4. Set an output ceiling, total deadline, bounded retry policy, and cost limits appropriate to the workload. Reasoning uses output tokens too. A model's context window is not its maximum output length.
  5. Read the relevant reference below. Consult current official docs for unfamiliar fields; do not invent model IDs, provider slugs, parameter support, or SDK syntax.

Rules that prevent expensive mistakes

  • Use the unified reasoning object. reasoning.exclude: true hides reasoning; it does not turn reasoning off or make it free. Mandatory reasoning models cannot be disabled.
  • Check every fallback against the same required capabilities and privacy/cost constraints. A single models request shares configuration across candidates. If models need different efforts or budgets, implement bounded application-level attempts with separate configs.
  • Separate provider failover from model fallback. provider.order is a preference; only restricts providers; ignore excludes them. Use provider.require_parameters: true when silently dropping requested parameters would break correctness. Recheck endpoint support; this is not a semantic guarantee.
  • Match routing to the real goal: provider.sort: "price" for price, "latency" for TTFT, "throughput" for tokens/second. :nitro also permits priority tiers; :floor also permits flex tiers. They can change price or availability beyond plain sorting.
  • HTTP 200 is not application success. Check errors, finish reason, expected output type, schema, and task-specific validity. Null text may be a valid tool call. A truncated or unreviewed answer must not become a successful artifact.
  • Do not repeat a deterministic failure unchanged. On a confirmed output-limit failure, consider a supported lower effort, smaller task, or compatible fallback within the quality budget. Increasing the cap is one option, not the automatic answer. Preserve fail-closed validation on every attempt.
  • Keep keys server-side. Log diagnostic metadata, not prompts, attachments, raw reasoning, or provider errors that may contain private content. Never weaken safety/privacy restrictions just to get a successful response.

Read the full file on GitHub · 43 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed fd8d38483bc2
  2. 1mo ago Changed · -31 tokens per session e859cd8cf103
  3. 1mo ago First seen · 43 lines · 74 tokens per session scan A c79b6d5c0164

Subscribe to this mod's changes

openrouter is a skill published in the GitHub repository davidondrej/skills (4,159 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 1,018 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-07.

Related

Other skills, from other repositories

gemini-api-agent-platform

Guides the usage of the Gemini API on Agent Platform with the Google Gen AI SDK for enterprise AI applications. Covers SDK usage (Python, JS/TS, Go, Java, C#), capabilities like Live API, tools, multimedia generation, caching, and batch prediction.

davila7/claude-code-templates · 61 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

gemini-api-dev

Use this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice design, voice replication, streaming responses, background research tasks, function calling, structured output, or migrating from…

google-gemini/gemini-skills · 85 tokens

deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the…

NVIDIA/skills · 219 tokens

azure-search-documents-dotnet

Azure AI Search SDK for .NET (Azure.Search.Documents). Use for building search applications with full-text, vector, semantic, and hybrid search. Covers SearchClient (queries, document CRUD), SearchIndexClient (index management), and SearchIndexerClient (indexers, skillsets). Triggers: "Azure Search .NET"…

microsoft/skills · 102 tokens

varlock

Secure environment variable management with Varlock. Use when handling secrets, API keys, credentials, or any sensitive configuration. Ensures secrets are never exposed in terminal, logs, or LLM context. Provides guidance around integrating varlock into a project, reading/editing .env.schema and other .env files…

dmno-dev/varlock · 109 tokens