Optimize your AI API costs directly in VS Code and Cursor with intelligent caching, compression, and smart routing.
Features
Smart Caching: Automatically cache AI responses locally. Same question = instant answer, no API cost
Prompt Compression: Reduce token usage while preserving meaning
Security Scanning: Detect API keys, passwords, and sensitive data before sending
Cost Tracking: See real-time savings in the status bar
Dashboard Sync: Usage data syncs to your iri AI dashboard
Installation
Option 1: Download from iri AI Dashboard
Log in to your iri AI dashboard
Go to Settings > Extensions
Click Download VS Code Extension
Open the downloaded .vsix file in VS Code
Option 2: Install from Command Line
# Download the extension
curl -o iri-optimizer.vsix https://your-domain.com/downloads/iri-optimizer-latest.vsix
# Install in VS Code
code --install-extension iri-optimizer.vsix
# Or for Cursor
cursor --install-extension iri-optimizer.vsix
Option 3: Install from VS Code
Open VS Code
Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
Type "Install from VSIX"
Select the downloaded .vsix file
Getting Started
Login: Press Ctrl+Shift+P and run "iri: Login"
A browser window opens - sign in with your iri AI account
Once authenticated, the extension starts automatically
Look for the savings indicator in the status bar: iri: $0.00 saved
Commands
Command
Description
iri: Login
Connect to your iri AI account
iri: Logout
Disconnect from iri AI
iri: Show Savings
View detailed cost savings
iri: Clear Cache
Clear the local response cache
iri: Open Settings
Configure optimization settings
iri: Toggle Proxy
Enable/disable the optimization proxy
Settings
Setting
Default
Description
iri.enabled
true
Enable the optimization proxy
iri.proxyPort
9876
Local proxy server port
iri.caching.enabled
true
Enable response caching
iri.caching.ttlHours
24
Cache duration in hours
iri.compression.enabled
true
Enable prompt compression
iri.compression.level
balanced
Compression level: light, balanced, aggressive
iri.routing.enabled
false
Enable automatic model routing
iri.security.scanSecrets
true
Scan for API keys before sending
iri.security.scanPii
false
Scan for PII before sending
iri.sync.enabled
true
Sync usage to web dashboard
How It Works
The extension runs a local proxy server on port 9876
AI API calls are routed through this proxy
The proxy applies optimizations (caching, compression, etc.)
Savings are tracked and displayed in real-time
Privacy & Security
Your code stays local: All processing happens on your machine
API keys are encrypted: Stored securely using VS Code's secret storage
No source code exposure: Only compiled code is distributed
Usage data is optional: Disable sync in settings if preferred
Troubleshooting
Extension not working?
Check if proxy is running: Run "iri: Toggle Proxy" twice