Embeddings via 9Router
decolua/9router
Generates vector embeddings through the 9Router /v1/embeddings endpoint, using models from providers such as OpenAI, Gemini, Mistral and Voyage for RAG and semantic search.
Implement intelligent model routing to optimize cost, quality, and latency on OpenRouter.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routing --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .claude/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .claude/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routing --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .agents/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .agents/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routing --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .cursor/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .cursor/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/openrouter-model-routing--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routing --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .gemini/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .gemini/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .github/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .github/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace openrouter-model-routing --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/openrouter-model-routing .opencode/skills/openrouter-model-routing && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "openrouter-model-routing" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/openrouter-model-routing into .opencode/skills/openrouter-model-routing/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "openrouter-model-routing", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
openrouter-model-routingImplement intelligent model routing to optimize cost, quality, and latency on OpenRouter.
Openrouter Model Routing is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement intelligent model routing to optimize cost, quality, and latency on OpenRouter. Use when building multi-model systems or optimizing spend across task types. Triggers: 'openrouter routing', 'model routing', 'route to model', 'model selection openrouter'.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/cascading-router.md`, `references/context-aware-routing.md` and `references/cost-quality-optimization.md`). Compatibility notes: Designed for Claude Code
It sits in AI & LLM Engineering, covering Model routing and gateways. It works with OpenRouter and OpenAI. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditGrepBash(python3:*)From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pipFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
openrouter.aiFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
OPENROUTER_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code
From compatibility in the SKILL.md frontmatter.
Openrouter Model Routing loads about 2.4k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 522 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 522 words, ~2,438 tokens.
.claude/skills/openrouter-model-routing/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.OpenRouter gives you access to 100+ models through one API. The key to cost efficiency is routing each request to the right model based on task complexity, required capabilities, cost budget, and latency requirements. This skill covers task-based routing, complexity classification, cost-aware selection, and OpenRouter's native routing features.
OPENROUTER_API_KEY — see the openrouter-install-auth skill for setuprequests (pip install openai requests)TASK_ROUTING tableopenai/o1) runs $15/$60 per 1M tokens, 250x the budget tierMODELS dict (free → budget → mid → standard → premium) and the TASK_ROUTING map, then send requests through route_request(), which returns content, the serving model, tier, and token count.classify_complexity() scores word count, code, reasoning, and math markers to pick a tier inside auto_route().extra_body={"models": [...], "route": "fallback"} tries models in order, provider.order controls which provider serves, and the :floor variant picks the cheapest provider automatically.get_model_pricing() pulls live per-1M rates from GET /api/v1/models, and cheapest_model_for_task() selects under context/tooling constraints.max_tokens.import os, re
from openai import OpenAI
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=os.environ["OPENROUTER_API_KEY"],
default_headers={"HTTP-Referer": "https://my-app.com", "X-Title": "my-app"},
)
# Model tiers by cost and capability
MODELS = {
"free": "google/gemma-2-9b-it:free", # $0/0 — testing only
"budget": "meta-llama/llama-3.1-8b-instruct", # $0.06/$0.06 per 1M
"mid": "openai/gpt-4o-mini", # $0.15/$0.60 per 1M
"standard":"anthropic/claude-3.5-sonnet", # $3/$15 per 1M
"premium": "openai/o1", # $15/$60 per 1M
}
TASK_ROUTING = {
"classification": "budget", # Simple label assignment
"translation": "mid", # Moderate quality needed
"summarization": "mid", # Good quality, cost-effective
"code_generation": "standard", # Needs high accuracy
"code_review": "standard", # Needs reasoning
"analysis": "standard", # Complex reasoning
"creative_writing":"standard", # Quality matters
"deep_reasoning": "premium", # Multi-step logic
"simple_qa": "budget", # Basic questions
"chat": "mid", # General conversation
}
def route_request(task_type: str, messages: list[dict], **kwargs) -> dict:
"""Route to appropriate model based on task type."""
tier = TASK_ROUTING.get(task_type, "mid")
model = MODELS[tier]
response = client.chat.completions.create(
model=model, messages=messages, **kwargs
)
return {
"content": response.choices[0].message.content,
"model": response.model,
"tier": tier,
"tokens": response.usage.prompt_tokens + response.usage.completion_tokens,
}def classify_complexity(prompt: str) -> str:
"""Classify prompt complexity to select model tier.
Simple heuristics -- replace with a trained classifier for production.
"""
word_count = len(prompt.split())
has_code = bool(re.search(r'```|def |function |class |import ', prompt))
has_reasoning = bool(re.search(r'explain|analyze|compare|why|how does|trade.?off', prompt, re.I))
has_math = bool(re.search(r'calculate|equation|formula|derive|proof', prompt, re.I))
if has_math or (has_reasoning and has_code):
return "premium"
if has_code or has_reasoning or word_count > 500:
return "standard"
if word_count > 100:
return "mid"
return "budget"
def auto_route(messages: list[dict], **kwargs):
"""Automatically select model based on prompt complexity."""
user_msg = next((m["content"] for m in reversed(messages) if m["role"] == "user"), "")
tier = classify_complexity(user_msg)
model = MODELS[tier]
response = client.chat.completions.create(model=model, messages=messages, **kwargs)
return response# Route: "fallback" — try models in order until one succeeds
response = client.chat.completions.create(
model="anthropic/claude-3.5-sonnet",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=200,
extra_body={
"models": [
"anthropic/claude-3.5-sonnet",
"openai/gpt-4o",
"openai/gpt-4o-mini",
],
"route": "fallback",
},
)
# Provider routing — control which provider serves a model
response = client.chat.completions.create(
model="anthropic/claude-3.5-sonnet",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=200,
extra_body={
"provider": {
"order": ["Anthropic", "AWS Bedrock"],
"allow_fallbacks": True,
},
},
)
# Model variant: ":floor" picks cheapest provider
response = client.chat.completions.create(
model="anthropic/claude-3.5-sonnet:floor",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=200,
)import requests
def get_model_pricing() -> dict:
"""Fetch current pricing for cost-aware routing."""
models = requests.get("https://openrouter.ai/api/v1/models").json()["data"]
return {
m["id"]: {
"prompt": float(m["pricing"]["prompt"]) * 1_000_000,
"completion": float(m["pricing"]["completion"]) * 1_000_000,
"context": m["context_length"],
}
for m in models
}
def cheapest_model_for_task(pricing: dict, min_context: int = 4096,
needs_tools: bool = False) -> str:
"""Find the cheapest model that meets requirements."""
candidates = [
(mid, p) for mid, p in pricing.items()
if p["context"] >= min_context and p["prompt"] > 0 # Exclude free (unreliable)
]
candidates.sort(key=lambda x: x[1]["prompt"] + x[1]["completion"])
return candidates[0][0] if candidates else "openai/gpt-4o-mini"route_request(): the reply content, the actual model that served, the tier chosen, and total tokens consumed[Router] Task=code -> Model=anthropic/claude-3.5-sonnet, giving you an audit trail to tune the routing table againstget_model_pricing() keyed by model ID: per-1M prompt/completion cost plus context length for cost-aware selectionThe same router sends trivial and demanding prompts to opposite ends of the cost spectrum:
print(routed_completion("What is 2+2?"))
# [Router] Task=simple -> Model=google/gemma-2-9b-it:free
print(routed_completion("Write a Python function to merge two sorted lists."))
# [Router] Task=code -> Model=anthropic/claude-3.5-sonnetThe 4-word arithmetic prompt lands on the free tier while the code request escalates to Claude 3.5 Sonnet — the spread between those two decisions is where the cost savings live. More worked examples: references/examples.md.
| Error | Cause | Fix |
|---|---|---|
| Wrong model selected | Classification too coarse | Add more task categories; test with diverse prompts |
| Model unavailable | Selected model temporarily down | Add fallback chain per tier |
| Cost overrun | Complex tasks routed to premium models | Set max_tokens and daily budget caps |
| Quality regression | Budget model can't handle task | Monitor output quality; escalate tier on poor results |
:floor variant to automatically get the cheapest provider for any modelmax_tokens on every request to cap per-request cost regardless of model tier© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 7 other files (references) in skills/.curated/openrouter-model-routing of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit cfae287
Openrouter Model Routing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Openrouter Model Routing this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.4k | Automated safety check: Pass | MIT | |
| Embeddings via 9Routerdecolua/9router | 31k | — | ~604 | Automated safety check: Pass | MIT | |
| Using Ccproxy Inspectorstarbaser/ccproxy | 350 | — | ~2.7k | Automated safety check: Pass | Custom licence | |
| Mecatl Model Router Configstacklok/mecatl | 254 | — | ~2.7k | Automated safety check: Pass | Apache-2.0 | |
| Using Ccproxy APIstarbaser/ccproxy | 350 | — | ~4k | Automated safety check: Pass | Custom licence | |
| Configuring Visionoxbshw/watch-skill | 470 | — | ~509 | Automated safety check: Notes | MIT |
decolua/9router
Generates vector embeddings through the 9Router /v1/embeddings endpoint, using models from providers such as OpenAI, Gemini, Mistral and Voyage for RAG and semantic search.
starbaser/ccproxy
Operates the ccproxy inspector MITM system for intercepting, inspecting, and transforming LLM API traffic.
stacklok/mecatl
Interviews you about provider, cost, openness and image needs, then designs the models section of a mecatl settings file with aliases, slots and router categories.
starbaser/ccproxy
Guides users through ccproxy as an OpenAI-compatible and Anthropic-compatible LLM API server with SDK integration, OAuth authentication, sentinel key substitution, model routing, and troubleshooting.
oxbshw/watch-skill
The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.
Detrol/quorum-cli
Run a structured debate between agent CLIs (claude, codex, agy, grok) and the user's configured API or local models (OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama and more) through the Quorum…
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Works with
Categories
Implement intelligent model routing to optimize cost, quality, and latency on OpenRouter. Openrouter Model Routing is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement intelligent model routing to optimize cost, quality, and latency on OpenRouter.
Openrouter Model Routing fits situations like: building multi-model systems; optimizing spend across task types.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a claude-code`. Or copy the skill folder (skills/.curated/openrouter-model-routing in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/openrouter-model-routing in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a codex`. Or copy the skill folder (skills/.curated/openrouter-model-routing in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/openrouter-model-routing in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill openrouter-model-routing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openrouter-model-routing, .gemini/skills/openrouter-model-routing, .github/skills/openrouter-model-routing and .opencode/skills/openrouter-model-routing in your project.
Going by SKILL.md and its folder, Openrouter Model Routing needs the command-line tools its instructions call (pip) and credentials named OPENROUTER_API_KEY. Our summary lists: Python 3; A credential in OPENROUTER_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Bash(python3:*). Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 1 domain. In commands or code: openrouter.ai; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Openrouter Model Routing is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.8k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Openrouter Model Routing: Embeddings via 9Router (decolua/9router, 31k stars), Using Ccproxy Inspector (starbaser/ccproxy, 350 stars), Mecatl Model Router Config (stacklok/mecatl, 254 stars) and Using Ccproxy API (starbaser/ccproxy, 350 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.