openrouter-cli

npm latest npm beta

📽️ Video Overview

Want to see OpenRouter CLI in action? Watch our video overview!

Spec Kit video header

OpenAI‑compatible CLI for OpenRouter. Ask questions, chat in a REPL, and fuzzy‑search models.

Note: This project is in MVP development. Beta releases are for testing, and stable releases are for general use. See Release Strategy for details.

You can change your model any time. In a terminal, run openrouter models to browse, or in the REPL type /model to search inline. Tip: search for free to see free models.


Monitor your current session costs

Get Billing Information

Fuzzy Search Models


Monitor your current session costs

Repl Chat Configurations


Repl Chat Configurations

Install

Beta Release (Testing)

Tip: Running openrouter with no args starts the setup wizard and then opens the REPL (in a terminal).

Requirements

Quick start

  1. Create an API key: https://openrouter.ai/keys
  2. Run setup: openrouter (or openrouter init) — enter your key if asked, then pick a model
  3. Ask once: openrouter ask "Hello!" — formatted answer by default
  4. Chat: openrouter repl — formatted replies; toggle streaming when you like

Everyday commands

Behavior & defaults

Configuration

Example: inline model search in REPL

(openai/gpt-oss-20b:free) > /model
Search models (>=2 chars, blank to cancel): free
Matches:
1. openai/gpt-oss-120b:free — OpenAI: gpt-oss-120b (free)
2. openai/gpt-oss-20b:free — OpenAI: gpt-oss-20b (free)
…
Pick 1-10 or type a model id:

Output & accessibility

Troubleshooting

Advanced flags (optional)

License