A universal API key inspector — one package, zero fluff, maximum insight.
Project description
apikey-inspector 🔍
One package, zero fluff, maximum insight.
apikey-inspector is a universal, privacy-first API key inspector. It allows you to identify, validate, and inspect API keys from major AI providers without risking leakage.
✨ Features
- 🔒 Privacy-First: Pure regex detection before any network calls.
- 🎭 Auto-Masking: Sensitive keys are always masked in terminal output and redacted in JSON.
- 🚀 Async-First: Batch inspect hundreds of keys concurrently with per-provider rate-limiting.
- 📡 Deep Inspection: Fetches available models, usage, costs, and rate limits where available.
- 🛠️ CI/CD Ready: Exit codes optimized for security pipelines (
--scanflag).
📦 Supported Providers
| Provider | Key Detection | Validation | Usage/Costs | Models List |
|---|---|---|---|---|
| OpenAI | ✅ | ✅ | ✅ | ✅ |
| Anthropic | ✅ | ✅ | 🚧 | ✅ |
| Google Gemini | ✅ | ✅ | 🚧 | ✅ |
| HuggingFace | ✅ | ✅ | ✅ | ✅ |
| Cohere | ✅ | ✅ | 🚧 | ✅ |
🚀 Quick Start
Installation
pip install apikey-inspector
Usage
# Basic inspection (masks key automatically)
apikey inspect sk-proj-1234...
# Offline mode (detection only, no network calls)
apikey inspect sk-proj-1234... --offline
# Batch inspection from a file or stdin
cat keys.txt | apikey inspect --json > results.json
# Security scanning mode (exit 1 if valid keys are found)
apikey inspect sk-proj-1234... --scan
🛠️ CLI Reference
| Option | Description |
|---|---|
inspect [KEY] |
The main command to inspect a key. |
--offline |
Skip network checks, only perform local regex detection. |
--json |
Output raw JSON instead of the rich table. |
--no-redact |
Disable automatic redaction of secrets in JSON output. |
--from-env VAR |
Read the API key from an environment variable. |
--scan |
Return exit code 1 if any valid keys are detected (for CI). |
version |
Show the current version. |
🧪 Development & Testing
# Clone the repo
git clone https://github.com/AliHaSSan-13/apikey-inspector.git
cd apikey-inspector
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
📜 License
MIT © Ali Hassan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apikey_inspector-0.1.0.tar.gz.
File metadata
- Download URL: apikey_inspector-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d5d12ca9dfc5ee0647198827b3092d1d0979bd22a5ed831de2a20f4ad28983b
|
|
| MD5 |
461cab96fe60cee4dc95f6159765f994
|
|
| BLAKE2b-256 |
1a814496203e7510788969a82dd85fc5737d0d741549977c615bdeef8c1f6d48
|
Provenance
The following attestation bundles were made for apikey_inspector-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on AliHaSSan-13/apikey-inspector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apikey_inspector-0.1.0.tar.gz -
Subject digest:
2d5d12ca9dfc5ee0647198827b3092d1d0979bd22a5ed831de2a20f4ad28983b - Sigstore transparency entry: 1179803149
- Sigstore integration time:
-
Permalink:
AliHaSSan-13/apikey-inspector@5c5793d30df2c7be296530423e3843752e5cb3cf -
Branch / Tag:
refs/tags/v0.1.0.2 - Owner: https://github.com/AliHaSSan-13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5c5793d30df2c7be296530423e3843752e5cb3cf -
Trigger Event:
release
-
Statement type:
File details
Details for the file apikey_inspector-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apikey_inspector-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d8fdbe0441c470927e8ca38c0d4b435a710d8732b6d7525d00b0e0ef27ce738
|
|
| MD5 |
5e6e3dbe9f200d12a4b91b40a6650ad8
|
|
| BLAKE2b-256 |
70148df587d796d27f31e3efc024fe13617c95a49b8e8fda442207900782fafa
|
Provenance
The following attestation bundles were made for apikey_inspector-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on AliHaSSan-13/apikey-inspector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apikey_inspector-0.1.0-py3-none-any.whl -
Subject digest:
8d8fdbe0441c470927e8ca38c0d4b435a710d8732b6d7525d00b0e0ef27ce738 - Sigstore transparency entry: 1179803164
- Sigstore integration time:
-
Permalink:
AliHaSSan-13/apikey-inspector@5c5793d30df2c7be296530423e3843752e5cb3cf -
Branch / Tag:
refs/tags/v0.1.0.2 - Owner: https://github.com/AliHaSSan-13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@5c5793d30df2c7be296530423e3843752e5cb3cf -
Trigger Event:
release
-
Statement type: