I work with models from several providers, and over time I ended up with a drawer full of API keys: Anthropic for Claude, an OpenAI project key from something I barely remember, a Gemini key from AI Studio, an xAI one for playing with Grok and a couple from OpenRouter, spread across .env files and environment variables on different machines. Whenever something broke, usually in the middle of a demo or right before a class, I had to open five consoles to work out which key had run out of credit, which had expired and which was still fine, so I built a small tool that answers that at a glance.
What My Project Does
Mecha is a local dashboard, with a web UI and a CLI, that checks every AI credential you give it and shows a traffic light per key: whether it's valid, whether it has funds, when it expires and what kind of credential it is (API key, admin key, management key or OAuth session). Every value is labelled with where it came from, whether that's the provider's API, a response header, a JWT decoded locally, a session file, something you typed or an estimate, and "unknown" is an allowed answer, because the most surprising thing I learned while building it is how little the providers tell you. Anthropic, OpenAI and Google have no endpoint to read your remaining balance, Gemini doesn't expose key expiry at all, and only xAI (with a management key) and OpenRouter give you the balance directly. For the cases where running out of credit only shows up when a request fails, there's an opt-in probe that sends the smallest possible paid request, a single output token on the cheapest model, which costs between $0.00002 and $0.015 per thousand probes depending on the provider and is limited to once an hour per key.
If you add an admin key, Mecha uses it to fill in the expiry date and status of the regular keys in that organization, since that's the only place OpenAI and Anthropic expose them, and it flags Gemini keys starting with AIza in amber, because AI Studio has only issued the newer AQ. keys since May 28 and Google is moving away from the old ones. Subscription OAuth tokens (Claude Code, Codex, Gemini CLI) are never used to call any API; Mecha only reads their session files locally to show your plan and when the session expires.
Since the whole point is to hold every key you own, a lot of the work went into not leaking them. It only listens on 127.0.0.1, with a per-session token and a Host header check against DNS rebinding; secrets are encrypted at rest with AES-256-GCM under a key kept in your OS keychain and are never sent back to the browser; each kind of key has a closed allowlist of method, host and path, so an admin key can only make the specific read requests Mecha needs; there's no telemetry; and the README has an explicit threat model, including what it doesn't protect against, which is code already running as your user.
Target Audience
Developers who juggle keys from several AI providers, whether for side projects, teaching or a small team. It's an alpha (0.1.2) under the MIT license, built for my own keys first, so I wouldn't call it production software yet: several provider error messages are undocumented, and reports of anything that doesn't match what your console shows are the most useful feedback I can get.
Comparison
Each provider's console shows its own piece, so you need five of them open. Secret managers like 1Password or Vault store keys but don't tell you whether they still work or have credit left, and secret scanners like gitleaks or TruffleHog find leaked keys (TruffleHog can even verify they're live) but don't track balance or expiry over time. Gateways like LiteLLM can track spend, but only for traffic that goes through their proxy, while Mecha never sits in your request path and only checks the keys themselves. I didn't find anything that does this locally across providers, which is why I wrote it, but if you know of one I'd genuinely like to hear about it.
Try it
There's a web demo with made-up data that runs entirely in your browser; its Content Security Policy blocks every network request and it never asks you to paste a key: https://joaquinruiz.github.io/mecha/
To run it locally (Python 3.12+):
uvx mecha-keys serve --demo # same demo, no keys, no network
uv tool install mecha-keys # then: mecha add, mecha serve
Code and threat model: https://github.com/JoaquinRuiz/mecha
Full disclosure: I built it with Claude Code from a written spec, phase by phase, reviewing every PR, with 400+ tests and CI on Linux, macOS and Windows; the spec is in the repo (in Spanish) if you're curious how it was designed. I'd especially love to hear from anyone whose account is in a state I couldn't test, like an exhausted Gemini prepay balance or an xAI team over its spending limit.