Skip to main content

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.

PyPI version License: MIT


✨ 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 (--scan flag).

📦 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

Metadata

Release files for apikey-inspector 0.1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apikey-inspector 0.1.0.4
File Size Uploaded
apikey_inspector-0.1.0.4.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apikey-inspector 0.1.0.4
File Interpreter ABI Platform
apikey_inspector-0.1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / apikey_inspector-0.1.0.4.tar.gz

Download URL apikey_inspector-0.1.0.4.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9cdcc98d48eb555cbf29f26cb0215c73263c159222efff5750b31554c77e5bff
BLAKE2b-256 checksum
How to use checksums
8198d268e6651f6a8fb610b9c9c02a5161e2f5cb8dcf67fe61b760de52976103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 5, 2026.

Transparency log

Release files / apikey_inspector-0.1.0.4-py3-none-any.whl

Download URL apikey_inspector-0.1.0.4-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
264722d560e50eb5a639765c17237085cb914ddc8614c6664b93043066da7b00
BLAKE2b-256 checksum
How to use checksums
e2f19a67d944185831e24fbc3dd52df58fd0487a15e0bd30798c255244f4ca01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page