Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

openrouter

Skill by alexdcd

OpenRouter gives an AI assistant guidance for the OpenRouter API, which provides unified access to 400+ AI models through one endpoint. It covers chat completions, model fallbacks, auto routing and sampling settings. It suits developers who call several model providers from one codebase.

  • Score 77
  • 71 stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install openrouter

Built from the published package, never by AI.

git clone --depth 1 https://github.com/alexdcd/Mafia-Claude-Skills /tmp/Mafia-Claude-Skills && mkdir -p ~/.claude/skills && cp -r /tmp/Mafia-Claude-Skills/skills/openrouter ~/.claude/skills/openrouter

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install openrouter in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a working reference for building with the OpenRouter API. OpenRouter provides access to hundreds of AI models through a single endpoint at https://openrouter.ai/api/v1. The skill includes chat completion examples in Python, JavaScript and cURL, using OpenAI-compatible SDKs with a changed base URL. It also covers model fallback arrays, the openrouter/auto router, sampling parameters, streaming, JSON mode and seed settings.

The skill is aimed at developers who target several model providers and want automatic fallbacks or provider failover. It points to reference files that list available models and links to the official OpenRouter documentation. The source notes that pricing depends on the model actually used, which matters when a fallback runs. Beginners can start with basic chat requests, while advanced users can tune routing and parameters.

Written from the project's SKILL.md and checked against it.

What it can do

  • Chat completionsSends chat requests to many models through one OpenRouter endpoint.
  • Model fallbacksPasses a list of backup models that are tried if the primary model fails.
  • Auto routerUses openrouter/auto to pick a model based on the prompt.
  • Sampling controlsSets temperature, top_p, max tokens and presence or frequency penalties.
  • Streaming responsesStreams model output through Server-Sent Events.
  • JSON modeRequests structured JSON output using response_format.
  • Seed parameterSets a seed to aim for reproducible output where the model supports it.
  • Tool callingConnects models to external functions and APIs across providers.

What you need

  • OpenRouter API key
  • OpenAI-compatible SDK or cURL for sending requests

Try asking

  • Call openai/gpt-4o through OpenRouter with a Claude 3.5 Sonnet fallback.
  • Stream a story from a model using OpenRouter with stream enabled.
  • Use openrouter/auto to pick a model for my prompt and explain the choice.

Good to know

  • Seed-based determinism only applies when the model supports it.
  • Max tokens cannot exceed the context length minus the prompt length.
  • Pricing is based on the model that actually processed the request.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/openrouter/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to openrouter

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

openrouter: common questions

Does this need an OpenRouter API key?

Yes. Requests use Bearer token authentication, and the examples read the key from OPENROUTER_API_KEY.

How do model fallbacks work with OpenRouter?

You pass a models array with backup models through extra_body. The source says the request retries on the listed models if the primary model fails.

Can I use the OpenAI SDK with OpenRouter?

Yes. The source says OpenRouter uses an OpenAI-compatible API format, and the examples set base_url to the OpenRouter endpoint.

How do I install openrouter?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is openrouter free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is openrouter safe to use?

It scores 77 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to openrouter?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

openrouter Install

Add to stack

Loading.