CLI tool to validate API keys for AI providers. Checks whether your keys are still active and working.
| Provider | Validation Method |
|---|---|
| Anthropic | Sends a minimal 1-token completion request |
| OpenAI | Lists available models |
| Gemini | Lists available models |
| NVIDIA | Lists available models |
| OpenRouter | Queries key info and remaining credits |
git clone https://github.com/skynergroup/key-checker.git
cd key-checker
python3 -m venv .venv
source .venv/bin/activate
pip install -e .key-checker # Check all keys from .env or environment
key-checker --anthropic sk-ant-xxx # Check a single Anthropic key
key-checker --openai sk-xxx # Check a single OpenAI key
key-checker --gemini AIza-xxx # Check a single Gemini key
key-checker --nvidia nvapi-xxx # Check a single NVIDIA key
key-checker --openrouter sk-or-xxx # Check a single OpenRouter key
key-checker --anthropic sk-ant-xxx --openai sk-xxx # Check multiple keys at once
key-checker --json # Output results as JSON
key-checker --anthropic sk-ant-xxx --json # Combine CLI keys with JSON output
key-checker --help # Show help
key-checker --anthropic sk-ant-xxx --openai sk-xxx --gemini AIza-xxxexport ANTHROPIC_API_KEY=sk-ant-xxx
export OPENAI_API_KEY=sk-xxx
export GEMINI_API_KEY=AIza-xxx
export NVIDIA_API_KEY=nvapi-xxx
export OPENROUTER_API_KEY=sk-or-xxx
key-checkerCreate a .env file in the current directory (see .env.example):
ANTHROPIC_API_KEY=sk-ant-xxx
OPENAI_API_KEY=sk-xxx
GEMINI_API_KEY=AIza-xxx
NVIDIA_API_KEY=nvapi-xxx
OPENROUTER_API_KEY=sk-or-xxx
Then run:
key-checkerkey-checker --json[
{
"provider": "Anthropic",
"valid": true,
"status": "Valid",
"detail": "claude-sonnet-4-20250514"
},
{
"provider": "OpenAI",
"valid": false,
"status": "Invalid",
"detail": "401"
}
]Keys are resolved in this order (first match wins):
- CLI arguments (
--anthropic KEY) .envfile in the current directory- Environment variables
Only providers with a key present are checked. The rest are skipped silently.
| Status | Meaning |
|---|---|
| Valid | Key is active and working |
| Valid (rate limited) | Key is valid but currently rate limited (429) |
| Invalid | Key was rejected (401/403) |
| Unreachable | Could not connect to the provider |
| Timeout | Provider did not respond within 5 seconds |
0— all checked keys are valid1— one or more keys are invalid, or no keys were found
pip install -e ".[dev]"
pytest tests/ -v