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.
npx skills add jnPiyush/AgentX --skill llm-gateway-and-routinggit clone --depth 1 https://github.com/jnPiyush/AgentXWrote 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.
[](https://agentmods.dev/skills/jnpiyush/agentx/llm-gateway-and-routing)<a href="https://agentmods.dev/skills/jnpiyush/agentx/llm-gateway-and-routing"><img src="https://agentmods.dev/badge/skills/jnpiyush/agentx/llm-gateway-and-routing/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.
<a href="https://agentmods.dev/skills/jnpiyush/agentx/llm-gateway-and-routing"><img src="https://agentmods.dev/badge/skills/jnpiyush/agentx/llm-gateway-and-routing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.01381 |
| Opus 5.5 | $0.00035 | $0.00552 |
| Sonnet 5.5 | $0.00017 | $0.00276 |
| Haiku 4.5 | $0.00009 | $0.00138 |
Grade A, and why
llm-gateway-and-routing 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LLM Gateway and Routing
Purpose: Stop calling LLM provider SDKs directly from app code. Put a gateway in front so you can swap models, cap cost, and survive provider outages.
When to Use This Skill
- Multiple apps or teams calling LLMs in your org
- Multiple providers in play (OpenAI + Anthropic + Azure + open-weights)
- Need centralized cost, rate-limit, audit, and key management
- Want semantic caching to cut spend
- Need provider failover for SLO
What a Gateway Buys You
| Capability | Why |
|---|---|
| Unified API (OpenAI-compatible) | One client SDK, many backends |
| Routing policy | Cheapest / fastest / most capable per task |
| Failover | Provider outage does not page on-call |
| Caching | Exact + semantic; 20-60% cost cut typical |
| Rate limits & quotas | Per team, per tenant, per key |
| Key vaulting | App never sees provider keys |
| Cost attribution | Tag spans by team/tenant/feature |
| PII / safety hooks | Central guardrails |
| Audit log | Compliance, incident response |
Gateway Options
| Gateway | Notes |
|---|---|
| LiteLLM (OSS + cloud) | 100+ providers, OpenAI-compatible, easy self-host |
| Portkey | Hosted, strong observability + caching + guardrails |
| Azure AI Gateway / APIM with AI Gateway policies | Native Azure, semantic caching, token rate limits |
| OpenRouter | Hosted aggregator, many models, OAuth & marketplace |
| AWS Bedrock + Bedrock Gateway | AWS-native, IAM integration |
| Kong AI Gateway | Plugin-based on top of Kong |
| Self-built (FastAPI / Hono / ASP.NET) | Full control, full ops cost |
Recommendation: Start with LiteLLM or Portkey unless you must align with cloud provider (then Azure / Bedrock).
Routing Policies
Express as rules on a request:
input: { task_type, tenant, max_cost_usd, max_latency_ms, capability_required }
output: { primary: model_id, fallbacks: [model_id, ...] }
Common policies:
- Capability: requires reasoning -> route to o-series / Claude extended thinking; else cheap model
- Cost-tier: free / pro / enterprise tenants get different model tiers
- Latency-SLO: chat UI route to fast models; batch jobs route to cheap models
- Region / data residency: route per tenant geography
- Open-weights fallback: if hosted provider 5xx, fall back to self-hosted Llama / Mistral
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.
- 1mo ago Changed 1365f78bfb1c
- 1mo ago First seen · 158 lines · 87 tokens per session scan A aa818344564e
llm-gateway-and-routing is a skill published in the GitHub repository jnPiyush/AgentX (16 stars, last pushed 3d ago), licensed Apache-2.0. It adds 87 tokens to every session and 1,381 once invoked, about $0.0003 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-03.
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.
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…
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…
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…
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"…
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…