Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openrouter-models

List and filter models from OpenRouter and other AI providers from the command line.

Fetches the provider's models API and lets you filter by modality, capability, and pricing (OpenRouter-only filters).

Usage

openrouter-models [OPTIONS]

Options

Flag Description
--modality <MODALITY> Filter by input/output modality: text, image, audio, video, file
--output <MODALITY> Filter by output modality: text, image, audio
--free Show only models with all-zero pricing
--paid Show only models with non-zero pricing
--tools Show only models that support tool/function calling
--vision Show only models that accept image input
--multimodal Show only models that accept image, audio, or video input
-j, --json Output full model metadata as pretty JSON
--provider <PROVIDER> Provider mnemonic or full API URL (default: openrouter)
-h, --help Print help

Examples

# List all models
cargo run

# Text-to-image models
cargo run -- --output image

# Free models with tool support
cargo run -- --free --tools

# Multimodal models with vision
cargo run -- --multimodal

# Models accepting audio input
cargo run -- --modality audio

# Paid models with tool support
cargo run -- --paid --tools

# Full JSON output
cargo run -j

# Pipe and grep
cargo run -- --free | grep Llama

# Query a different provider
cargo run -- --provider ollama
cargo run -- --provider opencode
cargo run -- --provider nvidia-nim
cargo run -- --provider huggingface
cargo run -- --provider lmstudio

# Custom API URL
cargo run -- --provider https://custom.example.com/v1/models

Providers

The --provider flag accepts a mnemonic or a full URL:

Mnemonic API Endpoint Format
openrouter (default) https://openrouter.ai/api/v1/models Rich (pricing, capabilities, modalities)
ollama http://localhost:11434/api/tags Ollama
opencode https://opencode.ai/zen/v1/models OpenAI-compatible
nvidia-nim https://integrate.api.nvidia.com/v1/models OpenAI-compatible
huggingface https://huggingface.co/api/models Hub API
lmstudio http://localhost:1234/v1/models OpenAI-compatible

When using a non-OpenRouter provider, filters such as --free, --paid, --tools, --vision, --multimodal, --modality, and --output are ignored — all models from that provider are shown.

Full URL support auto-detects the provider from the hostname:

cargo run -- --provider http://localhost:11434/api/tags

Output

Default tabular output columns:

Column Description
Model Model name
Modality Modality string (e.g. text->text, text+image->text)
Pricing Prompt (p$) and completion (c$) cost per token
Context Context window length in tokens
T Tool/function calling support flag
V Vision (image input) support flag
FREE Label for zero-cost models

With -j, each model is printed as a JSON object followed by ---.

Install

From source

cargo build --release
./target/release/openrouter-models --help

System-wide

cargo install --path .
# binary at ~/.cargo/bin/openrouter-models
openrouter-models --help

Or copy to a directory on your PATH:

cargo build --release
cp target/release/openrouter-models /usr/local/bin/
openrouter-models --help

API

Consumes GET https://openrouter.ai/api/v1/models. The response is deserialized into strongly-typed structs covering:

  • Model identity (id, name, description)
  • Architecture (modality, input_modalities, output_modalities, tokenizer, instruct_type)
  • Pricing (prompt, completion, image, audio, web_search, internal_reasoning, input_cache_read, input_cache_write)
  • Capabilities (supported_parameters array — tools, structured_outputs, etc.)
  • Provider info (context_length, max_completion_tokens, is_moderated)

About

List and filter [OpenRouter](https://openrouter.ai) models from the command line.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages