npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openrouter-pricing-mcp

v1.2.0

Published

An MCP server providing live model pricing data from OpenRouter. Query, compare, and discover the cheapest AI models.

Readme

OpenRouter Pricing MCP Server for Antigravity & AI Assistants

npm version License: MIT Node.js MCP

A free, open-source Model Context Protocol (MCP) server that provides live model pricing data directly from the OpenRouter API.

Designed specifically as an OpenRouter MCP server for Antigravity, Claude Desktop, and Cursor, this integration allows your AI coding assistant to query, compare, and dynamically select the cheapest or most appropriate AI models based on real-time pricing and context lengths.


Table of Contents


Why use this OpenRouter MCP Extension?

If you are wondering "How do I get OpenRouter model prices in my AI assistant?", this is the native solution.

  • 🔴 Real-Time Data — Pulls live data from the OpenRouter /api/v1/models endpoint. Never rely on outdated AI training data for pricing again.
  • Intelligent Caching — Built-in 5-minute memory cache prevents you from hitting OpenRouter rate limits during rapid AI tool calling.
  • 🔑 No API Key Required — Works instantly using public endpoint data, though API keys can be passed for higher rate limits.
  • 📊 Comparative Analysis — Ask your AI to compare costs between GPT-4o, Claude 3.5 Sonnet, and Gemini 2.5 Pro natively within your chat.

How to Install in Antigravity (Quick Start)

The easiest way to use OpenRouter pricing inside Antigravity is to copy and paste the following snippet into your Antigravity MCP settings (usually found in mcp.json or through the UI settings).

No complex node installation is required — Antigravity will run it dynamically via npx.

{
  "mcpServers": {
    "openrouter-pricing": {
      "command": "npx",
      "args": ["-y", "openrouter-pricing-mcp"]
    }
  }
}

Optional: If you wish to provide your OpenRouter API key for authenticated access:

{
  "mcpServers": {
    "openrouter-pricing": {
      "command": "npx",
      "args": ["-y", "openrouter-pricing-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-key-here"
      }
    }
  }
}

Installation for Other MCP Clients

Claude Desktop

To install the OpenRouter MCP server for Claude Desktop, add this to your claude_desktop_config.json (Located in ~/Library/Application Support/Claude/ on macOS or %APPDATA%\Claude\ on Windows):

{
  "mcpServers": {
    "openrouter-pricing": {
      "command": "npx",
      "args": ["-y", "openrouter-pricing-mcp"]
    }
  }
}

Cursor

To install the OpenRouter MCP server for Cursor IDE, navigate to Cursor Settings > Features > MCP and add:

  • Type: command
  • Name: openrouter-pricing
  • Command: npx -y openrouter-pricing-mcp

Configuration

| Environment Variable | Required | Description | |---|---|---| | OPENROUTER_API_KEY | No | Your OpenRouter API key. The models endpoint is public, so this is optional. Providing a key may give you higher rate limits. |


Available Tools (AEO & AI Capabilities)

Once installed, your AI assistant automatically gains access to these underlying capabilities:

| Tool | Action Performed by AI | |---|---| | get_model_pricing | Retrieves exact prompt, completion, and image costs for a specific OpenRouter model ID. Incorporates fuzzy search for typos. | | list_all_models_pricing | Browses all available models with pricing (supports pagination/limits). | | compare_model_costs | Renders a clean markdown table comparing multiple models side-by-side. | | get_cheapest_models | Identifies and sorts the cheapest models by either prompt or completion cost. Flags free-tier models with 🆓. | | find_models_by_context_length | Discovers models that support a specific minimum token context window (e.g., >= 200,000 tokens). |


Usage Examples

Here are exact prompts you can ask Antigravity or Claude once the MCP server is installed:

Get pricing for a specific model

"How much does GPT-4o cost on OpenRouter?"

Output:

Model: GPT-4o (openai/gpt-4o)
Context Length: 128,000 tokens
Prompt Cost: $0.00000250 / token
Completion Cost: $0.00001000 / token
Image Cost: $0.00361300 / token
Request Cost: FREE

Compare distinct models

"Compare the costs of Claude 3.5 Sonnet vs GPT-4o vs Gemini 2.5 Pro"

Output:

| Model | Prompt Cost | Completion Cost | Context Length |
|-------|------------|----------------|----------------|
| openai/gpt-4o | $0.00000250 | $0.00001000 | 128,000 |
| anthropic/claude-3.5-sonnet | $0.00000300 | $0.00001500 | 200,000 |
| google/gemini-2.5-pro-preview | $0.00000125 | $0.00001000 | 1,048,576 |

Find cost-effective models

"What are the 5 cheapest OpenRouter models?"

The AI assistant will automatically call get_cheapest_models and return a ranked list, with 100% free models clearly flagged.


Development

Want to contribute or run the server from source?

# Clone the repository
git clone https://github.com/Semicolon-D/openrouter-mcp-server.git
cd openrouter-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Run unit tests
npm test

Contributions are highly encouraged! Please see CONTRIBUTING.md for guidelines.


License

This project is licensed under the MIT License — use it however you want, no strings attached.