Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 76
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-architecture

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install openrouter-reference-architecture in Claude Code

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 →

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.

openrouter-reference-architecture Install

Add to stack

Loading.