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 2mo 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.
- 2mo ago Changed 1365f78bfb1c
- 2mo 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 (19 stars, last pushed today), 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.
llm-gateway-and-routing compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| llm-gateway-and-routingjnPiyush/AgentX | Skill | 19 | today | Apache-2.0 | A | 87 | Claude Code, Codex |
| open-sourcebrowser-use/browser-use | Skill | 122k | today | MIT | A | 101 | Claude Code |
| gemini-api-agent-platformdavila7/claude-code-templates | Skill | 35k | today | MIT | A | 61 | Claude Code, Codex |
| prowler-mcpprowler-cloud/prowler | Skill | 15k | today | Apache-2.0 | A | 67 | Claude Code |
| deepstream-sopNVIDIA/skills | Skill | 4.2k | today | Apache-2.0 | A | 219 | Claude Code |
| tao-run-inference-serviceNVIDIA/skills | Skill | 4.2k | today | Apache-2.0 | A | 92 | Claude Code |
| gemini-api-devgoogle-gemini/gemini-skills | Skill | 5.0k | 11d ago | Apache-2.0 | A | 96 | Claude Code |