Skip to content

DimazzzZ/openrouter-intellij-plugin

Repository files navigation

OpenRouter IntelliJ Plugin

JetBrains Plugin Version CI License: MIT

An IntelliJ IDEA plugin for integrating with OpenRouter.ai, providing access to 400+ AI models with usage monitoring, quota tracking, and seamless JetBrains AI Assistant integration.

What's New in v0.5.2 🎉

  • 💰 Model Pricing - Input/Output price columns in model tables, per-model spend in stats
  • 📊 Total Models Count - Shows "X shown (Y total)" in Favorite Models settings
  • 💬 Chat Improvements - Fixed text copy/select, Markdown rendering with tables & links
  • 🔒 Privacy - Balance sharing now opt-in, Plugin Verifier added to release workflow

Key Features

Feature Description
💬 Chat Tool Window Multi-chat sessions in IDE sidebar with persistent history and token tracking
🤖 AI Assistant Proxy Local OpenAI-compatible proxy connecting AI Assistant to 400+ models
🎯 Custom Presets Built-in and custom OpenRouter presets for quick model selection
📊 Usage Analytics Real-time cost tracking, quota monitoring, and spending estimates
⭐ Favorite Models Quick access with filtering by provider, capabilities, and context length
🔐 Secure Storage OS-native credential storage (Keychain, Credential Manager, libsecret)
🔌 Plugin API Extension point for other plugins to receive balance data

Installation

From Plugin Marketplace

  1. Open IntelliJ IDEA → SettingsPlugins
  2. Search for "OpenRouter" in Marketplace
  3. Click Install (no restart required!)

Manual Installation

  1. Download the latest release from GitHub Releases
  2. SettingsPlugins → ⚙️ → Install Plugin from Disk...
  3. Select the downloaded ZIP file

Quick Start

First-Time Setup

When you first install the plugin, a welcome notification will appear with a "Quick Setup" button. The wizard guides you through:

  1. Authentication - Choose OAuth/PKCE (one-click) or Provisioning Key
  2. Favorite Models - Select your preferred models with search and filtering
  3. Proxy Setup - Configure AI Assistant integration

Manual Setup

  1. Open Settings: SettingsToolsOpenRouter
  2. Authenticate: Click "Connect to OpenRouter" for OAuth/PKCE, or paste a Provisioning Key
  3. Select Models: Go to Favorite Models tab and choose your models
  4. Start Using: Click the status bar widget to access features

AI Assistant Integration

Connect JetBrains AI Assistant to OpenRouter's 400+ models:

  1. Start the proxy server in SettingsToolsOpenRouter
  2. In AI Assistant: SettingsToolsAI AssistantModels → Add custom model
    • Server URL: Copy from OpenRouter settings (e.g., http://127.0.0.1:8880)
    • API Key: Any text (not validated)
    • Model: Any model from OpenRouter's catalog

📖 Complete Setup Guide with screenshots

Features

Chat Tool Window

Access via ViewTool WindowsOpenRouter:

  • Multi-Chat - Create and manage multiple conversation sessions
  • Model Selection - Choose from favorites or use presets
  • Persistent History - Chats saved locally and restored on restart
  • Token Tracking - Real-time estimation for input and cumulative counts
  • Keyboard Shortcuts - Enter to send, Cmd/Ctrl+Enter for newline

Custom Presets

Manage presets in SettingsToolsOpenRouterPresets:

  • Built-in Presets - openrouter/auto (best model for task) and openrouter/free (free models only)
  • Custom Presets - Add your own presets created at OpenRouter Presets
  • Chat Integration - Presets appear at the top of model selector with @preset/ prefix

Usage Monitoring

  • Status Bar Widget - Real-time usage display with color-coded connection status
  • Statistics Popup - Detailed analytics with days remaining estimate
  • Cost Tracking - Accurate "Today" statistics with local tracking

Extension API (for Plugin Developers)

Other plugins can receive balance updates via the balanceProvider extension point:

<extensions defaultExtensionNs="org.zhavoronkov.openrouter">
    <balanceProvider implementation="com.example.MyBalanceProvider"/>
</extensions>

See the CHANGELOG for API details and the BalanceProvider interface in the source code.

Compatibility

Supported IDEs IntelliJ IDEA, WebStorm, PyCharm, PhpStorm, RubyMine, CLion, Android Studio, GoLand, Rider
IDE Versions 2024.2+ and all future versions
Requirements Java 21+, OpenRouter.ai account (free or paid)

Development

See DEVELOPMENT.md for build instructions, testing, and contribution guidelines.

Legal & Privacy

Support

License

MIT License - see LICENSE for details.


This is an unofficial plugin and is not affiliated with OpenRouter.ai or JetBrains.

About

An IntelliJ IDEA plugin for integrating with OpenRouter.ai, providing access to 300+ AI models with usage monitoring and quota tracking.

Topics

Resources

License

Stars

Watchers

Forks

Packages