The OpenRouter API Watcher is a tool that monitors changes in OpenRouter models and stores those changes in a SQLite database. It queries the model list via the API every hour and includes a simple web interface for viewing the changes.
To run the OpenRouter API Watcher, you'll need the Bun runtime. Install the dependencies with the following command:
bun install
Build the web client with the following command:
bun run build
The tool can be run in three different modes:
-
Background Mode: To run the watcher in the background, use the following command:
bun run orw.ts
The watcher will continuously monitor the OpenRouter API and store any changes in the database.
-
Query Mode: To view the most recent changes, use the following command:
bun run orw.ts --query [number]
Replace
[number]
with the maximum number of changes you want to display (default is 10). -
One-Time Mode: To run the watcher just once, use the following command:
bun run orw.ts --once
This will perform a single check and update the database if any changes are detected.
The OpenRouter API Watcher includes a simple web interface that allows you to view the list of models and the changes that have been detected. By default, the web interface starts on a random, available port. Check the console output for the URL.
The OpenRouter API Watcher also includes a RSS feed generator, available at the /rss
endpoint. It will serve the last 50 recorded changes as formatted JSON encapsulated in a <code>
tag, so it does not look like a garbled mess in RSS readers.
You can run a set of simple test cases with the following command:
bun test
This project is licensed under the MIT License.