stips
OpenRouter CLI — check credits, view usage, manage your API key.
stips — Latin for a small coin or contribution.
Install
Setup
Get an API key at openrouter.ai/keys, then save it to the macOS Keychain:
The key is stored under the service name openrouter-api-key and retrieved automatically on each command.
On non-macOS platforms, set the OPENROUTER_API_KEY environment variable instead (see Environment Variables).
Commands
stips / stips credits
Show your current credit balance. Running stips with no subcommand is equivalent to stips credits.
$ stips
$13.74 remaining ($636.26 used of $650.00)
If your remaining balance is below $5.00, a warning is printed to stderr:
⚠️ Low — top up at https://openrouter.ai/credits
The warning never affects the exit code — stips credits always exits 0 on success.
stips credits --json
Output the balance as JSON, suitable for scripting:
stips usage
Show spend broken down by period:
$ stips usage
Daily: $0.11
Weekly: $1.45
Monthly: $10.75
All values are in USD as returned by the OpenRouter API.
stips usage --json
stips key open
Open openrouter.ai/keys in the default browser (macOS only).
stips key save <key>
Save an API key to the macOS Keychain (macOS only). Overwrites any previously saved key.
Environment Variables
| Variable | Description |
|---|---|
OPENROUTER_API_KEY |
API key. Takes precedence over the macOS Keychain. Required on non-macOS platforms. |
OPENROUTER_BASE_URL |
Override the API base URL (default: https://openrouter.ai). Useful for testing against a local mock. |
Low Balance Warning
When stips credits (or bare stips) detects that your remaining balance is below $5.00, it prints a warning to stderr pointing to the top-up page. The warning is purely informational — the exit code remains 0. In non-TTY contexts (pipes, scripts), the emoji is omitted so the output stays clean.
Changelog
v0.2.0
--jsonflag added tocreditsandusagefor machine-readable output- Fixed
usagevalues: removed incorrect/100scaling heuristic — the API always returns dollar-denominated floats - Fixed exit code: low-balance warning no longer causes a non-zero exit
- Platform guards:
key saveandkey opennow compile and fail gracefully on non-macOS OPENROUTER_BASE_URLoverride for testing against local mocks
v0.1.x
- v0.1.2 — minor dependency cleanup
- v0.1.1 — removed unused
serde_jsondependency - v0.1.0 — initial release:
credits,usage,key open,key save, macOS Keychain integration
License
MIT