Simon Willison’s LLM command‑line tool now works with OpenRouter, giving developers a single CLI to try dozens of frontier models without rewriting code.
Reference: Willison’s announcement and setup notes: llm + OpenRouter.
Why this matters
- One interface, many models: Swap Anthropic, OpenAI, Google, Meta, and open‑weights via a single flag.
- Faster iteration: Compare outputs and costs model‑to‑model without new SDKs.
- Portability: Keep your prompt workflow stable while the model landscape shifts.
Quick start (5 minutes)
- Install LLM (recommended via pipx):
pipx install llm - Add the OpenRouter plugin:
llm install llm-openrouter(orpip install llm-openrouter) - Set your API key (either works):
llm keys set openrouteror setOPENROUTER_API_KEY - See available models:
llm models(look for entries prefixed withopenrouter/) - Run a prompt:
llm -m openrouter/<provider>/<model-slug> "Summarize the key risks and mitigations."
Run your first comparisons
- Anthropic example:
llm -m openrouter/anthropic/claude-3-5-sonnet "Draft a 120-word product update in a confident tone." -o temperature 0.4 - OpenAI example:
llm -m openrouter/openai/gpt-4o-mini "Draft the same product update." -o temperature 0.4 - Google example:
llm -m openrouter/google/gemini-1.5-flash "Create 5 alt-text options for this product image." - Stream tokens as they arrive: add
-s - Provide a system style:
--system "You are a precise, terse technical writer." - Prompt from a file:
llm -m openrouter/<provider>/<model> -f brief.txt
Tips for teams
- Version discipline: Pin exact model slugs and note date tested—frontier models change frequently.
- Cost control: Use smaller “mini/flash” variants for drafts; save premium models for the final pass.
- Reproducibility: Log prompts, model slug, and options (e.g., temperature) alongside outputs.
- Safety posture: Treat anything you send as leaving your boundary; avoid secrets in prompts.
Caveats
- Data flows through OpenRouter; review docs and model‑specific terms.
- Availability and latency vary by model/provider. Build timeouts and retries.
- Pricing differs per model—check OpenRouter’s pricing.
Learn more: the LLM project on GitHub (simonw/llm) and the OpenRouter plugin (simonw/llm-openrouter).
Takeaway: If you already use LLM, adding OpenRouter gives you fast access to a broad model marketplace with minimal changes to your workflow.
Get weekly, no‑fluff AI tips in your inbox—subscribe to The AI Nuggets newsletter.

