routerbase-model-gateway

routerbase-model-gateway is a skill for Claude Code, Codex from cosmicstack-labs/mercury-agent-skills. It costs 33 tokens per session (1,633 once invoked), scanned A, original, MIT.

A guide for using RouterBase as one OpenAI-compatible connection to AI model providers. It keeps provider selection, fallback models, media generation, and credentials behind a server-side boundary.

In plain words
What is it for?
Use it to connect backends, workers, command-line tools, or agent runtimes to chat, embeddings, image, video, audio, speech, routing, and fallback services through RouterBase.
Why use it?
It lets an application change providers or add fallback behavior without rewriting its whole AI layer. Keeping credentials on the server reduces the risk of exposing them in the frontend.

Skill for Claude CodeCodex

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

Good fit Use it to connect backends, workers, command-line tools, or agent runtimes to chat, embeddings, image, video, audio, speech, routing, and fallback services through RouterBase.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway
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 cosmicstack-labs/mercury-agent-skills --skill routerbase-model-gateway
Clone the repo
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-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 routerbase-model-gateway

README.md
[![agentmods](https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway/github.svg)](https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway)
Your own site
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway/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 routerbase-model-gateway

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway"><img src="https://agentmods.dev/badge/skills/cosmicstack-labs/mercury-agent-skills/routerbase-model-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00033 $0.01633
Opus 5 $0.00016 $0.00816
Sonnet 5 $0.00007 $0.00327
Haiku 4.5 $0.00003 $0.00163

Measured 11d ago against content hash 323d470cba68, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

routerbase-model-gateway 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 11d 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.

categories/ai-ml/routerbase-model-gateway/SKILL.md · 200 lines

How it starts

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

RouterBase Model Gateway

Use routerbase when an application needs an OpenAI compatible gateway for chat, embeddings, image, video, audio, speech, model routing, or fallback behavior.

The goal is not to rewrite the whole AI layer. The goal is to move provider selection behind a clean server side boundary, keep credentials private, and make model choices reversible.

When To Use

Use this skill when the user asks to:

  • Migrate an OpenAI compatible client to RouterBase.
  • Add RouterBase to a backend API, worker, command line tool, or agent runtime.
  • Route requests across multiple model providers through one API surface.
  • Choose primary and fallback models for latency, quality, price, or availability.
  • Add image, video, audio, speech, or embedding generation through a gateway.
  • Debug RouterBase base URLs, model IDs, streaming, JSON output, or media job polling.

Do not use this skill for:

  • General API gateway design unrelated to AI models.
  • Direct provider SDK features that are not exposed through the OpenAI compatible API.
  • Frontend only integrations that would expose API keys to users.
  • Production security review of the whole application.

Implementation Principles

1. Keep The Gateway Server Side

All RouterBase calls should run in trusted code:

  • backend route
  • serverless function
  • worker
  • command line tool
  • internal service
  • agent runtime process

Never place ROUTERBASE_API_KEY in browser code, mobile applications, public logs, screenshots, or checked in examples.

2. Change Configuration Before Code Shape

Most migrations should start with configuration:

  • base URL: https://routerbase.com/v1
  • API key variable: ROUTERBASE_API_KEY
  • chat model variable: ROUTERBASE_CHAT_MODEL
  • embedding model variable: ROUTERBASE_EMBEDDING_MODEL
  • media model variables for image, video, audio, or speech

Keep the OpenAI compatible request shape until there is a documented reason to change it.

3. Isolate Provider Choices

Read the full file on GitHub · 200 lines

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. 11d ago First seen · 200 lines · 33 tokens per session scan A 323d470cba68

Subscribe to this mod's changes

routerbase-model-gateway is a skill published in the GitHub repository cosmicstack-labs/mercury-agent-skills (470 stars, last pushed 16d ago), licensed MIT. It adds 33 tokens to every session and 1,633 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

gemini-interactions-api

Guides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.

google/skills · 58 tokens

notebooklm

Install, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API.…

teng-lin/notebooklm-py · 79 tokens

gemini-live-api

Generates a Gemini LiveAPI client service class in the user's chosen programming language. Use when the user wants to build, scaffold, or integrate a client that connects to the Gemini Enterprise LiveAPI websocket endpoint, handles session setup/resumption, bearer token refresh, and sending/receiving…

google/skills · 119 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, streaming responses, background research tasks, function calling, structured output, or migrating from the old generateContent API. Covers SDK usage and best…

google-gemini/gemini-skills · 73 tokens

migrating-ai-sdk-to-common-ai

Migrates Airflow projects from airflow-ai-sdk to apache-airflow-providers-common-ai 0.4.0+. Use when replacing airflow-ai-sdk with the official Airflow AI provider - migrating LLM decorators (@task.llm, @task.agent, @task.llmbranch, @task.embed), switching from model strings/objects to connection-based LLM…

astronomer/agents · 151 tokens

creating-openlineage-extractors

Create custom OpenLineage extractors for Airflow operators. Use when the user needs lineage from unsupported or third-party operators, wants column-level lineage, or needs complex extraction logic beyond what inlets/outlets provide.

astronomer/agents · 51 tokens