openrouter-reference-architecture
Skill by jeremylongshore
Designs production architectures that use OpenRouter as an LLM gateway. It offers simple, standard and enterprise tiers, chosen by team size, request volume and latency needs. Written for engineers planning, reviewing or scaling AI applications.
Install openrouter-reference-architecture
Built from the published package, never by AI.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-reference-architecture ~/.claude/skills/openrouter-reference-architectureRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install openrouter-reference-architecture in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/openrouter-reference-architecture ~/.gemini/antigravity-cli/skills/openrouter-reference-architectureAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install openrouter-reference-architecture in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a design guide for production systems that use OpenRouter as an LLM gateway. It describes three reference architectures: simple (single service), standard (microservice), and enterprise (event-driven). Each tier adds surrounding pieces such as caching, rate limiting, cost controls, observability, and async processing.
The skill helps you choose a tier by scoring team size, requests per day, latency needs, budget tracking, failure handling, and observability. It includes Python snippets for a shared client wrapper, a FastAPI /v1/complete endpoint with task-based model routing and fallbacks, and a Redis queue worker. It also stresses routing every call through one shared client so budgets are not bypassed. It is aimed at engineers planning system design, reviewing architecture, or scaling AI applications.
Written from the project's SKILL.md and checked against it.
What it can do
- Architecture selectionScores a system against a table of team size, requests per day, latency, budget tracking and failure handling.
- Simple architectureShows one shared OpenAI SDK client for OpenRouter with retries, a timeout and a logging wrapper.
- Standard architectureShows a FastAPI endpoint with task-type routing, cache-first lookup, budget checks and fallback models.
- Enterprise architectureShows a Redis queue feeding auto-scaling workers, a results store and OTEL metrics.
- Error handling guidanceLists fixes for single points of failure, queue backlogs, cache stampedes and budget bypass.
- Enterprise considerationsCovers dead letter queues, separate worker pools by priority, and tracing from gateway to OpenRouter.
What you need
- An OpenRouter API key exported as OPENROUTER_API_KEY
- Python 3.8+ with the OpenAI SDK
- FastAPI and Pydantic for the standard architecture's AI service
- Redis with the redis package for the standard and enterprise tiers
- SQLite or Postgres if you implement the budget enforcer
Try asking
- Score my system against the OpenRouter architecture selection table
- Design a standard OpenRouter microservice with caching and per-user budgets
- Review my LLM gateway design for budget bypass and cache stampede risks
Good to know
- The code blocks are reference snippets, not a packaged service.
- The cache and budget helpers are called but not defined in the snippets.
- API key setup is covered by a separate skill, openrouter-install-auth.
Security check
B- Allowed to use Write, Edit without limitsIn
SKILL.md
Checked automatically: skills/.curated/openrouter-reference-architecture/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadWriteEditGrepBash(python3:*)
Alternatives to openrouter-reference-architecture
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
openrouter-reference-architecture: common questions
What does this skill cover?
It covers three reference architectures for OpenRouter: simple, standard and enterprise. Each tier is described with a diagram and Python code examples.
How do I choose between the architectures?
The skill scores your team size, requests per day, latency needs, budget tracking, failure handling and observability against a comparison table. The table then points to the tier that fits.
Which tools does the skill allow?
The skill's allowed tools are Read, Write, Edit, Grep and Bash limited to python3 commands. It is designed for Claude Code.
How do I install openrouter-reference-architecture?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is openrouter-reference-architecture free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is openrouter-reference-architecture safe to use?
It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.
What are alternatives to openrouter-reference-architecture?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
