A comprehensive monitoring tool for tracking free models available through the OpenRouter API. Built to deploy on Cloudflare Workers with real-time notifications via Bark.
- Real-time Monitoring: Automatically fetch and track OpenRouter models every 1-60 minutes (configurable)
- Free Model Detection: Intelligently identifies free models (both
:freesuffix and zero-cost models) - Change Notifications: Get instant iOS notifications via Bark when free models are added or removed
- Web Interface: Beautiful, responsive web UI to browse all models with glassmorphism design
- Advanced Filtering: Search, sort, and filter models with ease
- One-Click Copy: Copy model IDs directly to clipboard
- Mobile Friendly: Fully responsive design optimized for all devices
- Settings Management: Web-based configuration for monitoring interval and Bark notifications
- Test Notifications: Built-in API to test Bark push functionality
- Custom Domains: Support for custom domain names
- Development Mode: Enhanced local development experience with automatic refresh
- Backend: Cloudflare Worker with scheduled triggers
- Storage: Cloudflare KV for persistent data storage
- Frontend: Vanilla JavaScript SPA served directly from the worker
- Notifications: Bark API integration for iOS push notifications
- Cloudflare account with Workers and KV enabled
- Node.js and npm installed locally
- (Optional) Bark app installed on iOS device for notifications
- (Optional) OpenRouter API key for higher rate limits
git clone <your-repo-url>
cd openrouter-monitor
npm install# Login to Cloudflare (if not already done)
npx wrangler login
# Create a KV namespace for data storage
npx wrangler kv:namespace create "OPENROUTER_KV"
npx wrangler kv:namespace create "OPENROUTER_KV" --preview
# Update wrangler.toml with the KV namespace IDs returned from above commandsConfigure the following environment variables using Wrangler secrets:
# Required: Your Bark notification URL (get from Bark app)
npx wrangler secret put BARK_API_URL
# Enter: https://api.day.app/YOUR_BARK_KEY/
# Optional: OpenRouter API key for higher rate limits
npx wrangler secret put OPENROUTER_API_KEY
# Enter your OpenRouter API key
# Optional: Custom monitoring interval (default: 5 minutes)
npx wrangler secret put MONITOR_INTERVAL_MINUTES
# Enter: 5 (or your preferred interval)Update wrangler.toml with your KV namespace IDs:
[[kv_namespaces]]
binding = "OPENROUTER_KV"
id = "your-kv-namespace-id-here"
preview_id = "your-preview-kv-namespace-id-here"Add a cron trigger to your wrangler.toml:
[triggers]
crons = ["* * * * *"] # Every minute (actual interval controlled in settings)# Deploy to Cloudflare Workers
npm run deploy
# For development/testing
npm run dev| Variable | Description | Required | Default |
|---|---|---|---|
BARK_API_URL |
Your Bark notification URL | Yes | - |
OPENROUTER_API_KEY |
OpenRouter API key | No | - |
MONITOR_INTERVAL_MINUTES |
Monitoring frequency | No | 5 |
- Install Bark from the App Store
- Open the app and copy your unique URL
- Set the
BARK_API_URLenvironment variable to:https://api.day.app/YOUR_KEY/
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Web interface (SPA) |
/api/models |
GET | Get all models data with metadata |
/api/free-models |
GET | Get only free models |
/api/status |
GET | Service status and stats |
/api/settings |
GET | Get current configuration settings |
/api/settings |
POST | Update configuration settings |
/api/monitor/run |
GET | Manually trigger monitoring (for testing) |
/api/test/bark |
GET | Test Bark notification functionality |
- Search: Real-time search across model names, IDs, and descriptions
- Sorting: Sort by name, ID, pricing, or context length
- Filtering: Toggle between all models and free models only
- Copy to Clipboard: Click any model ID to copy it instantly
- Auto-refresh: Interface refreshes every 5 minutes automatically
- Responsive Design: Works perfectly on mobile and desktop
- Scheduled Monitoring: At the configured interval (default 5 minutes), the worker fetches the latest models from OpenRouter's API
- Free Model Detection: The system identifies free models by:
- Models with IDs ending in
:free - Models with both prompt and completion prices of $0.00
- Models with IDs ending in
- Change Detection: Compares current free models with previously stored data
- Notifications: If changes are detected, sends a detailed notification via Bark
- Web Interface: Serves a responsive web interface showing all models with filtering and search capabilities
The system will notify you via Bark when:
- ✅ New free models are detected
- ❌ Previously free models are no longer available
- 🚨 API errors or system failures occur
Notification format:
Title: OpenRouter免费模型更新
Content: 新增免费模型:GPT-4 Turbo:free,Claude-3-Haiku:free;失效免费模型:Llama-2-70B:free
npm run devopenrouter-monitor/
├── src/
│ └── worker/
│ ├── index.js # Main worker entry point
│ ├── monitor.js # Monitoring logic
│ └── web.js # Web interface handler
├── scripts/
│ └── build-frontend.js # Build script
├── wrangler.toml # Cloudflare Workers config
└── package.json
npm run buildMIT License - see LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues and questions:
- Check the logs in Cloudflare Workers dashboard
- Verify KV namespace configuration
- Test API endpoints manually
- Check Bark URL format
- Email notifications support
- Webhook integrations
- Historical data and trends
- Custom filtering rules
- Model comparison features
- Export functionality