Skip to main content

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apikey_inspector-0.1.0.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apikey_inspector-0.1.0.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file apikey_inspector-0.1.0.2.tar.gz.

File metadata

  • Download URL: apikey_inspector-0.1.0.2.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

Hashes for apikey_inspector-0.1.0.2.tar.gz
Algorithm Hash digest
SHA256 5320811d6d50cfd2eed90059004cb115d186d656879d6ed29e8a3fcd975b0238
MD5 bf53afa198e83731b5139fd5d7ab6176
BLAKE2b-256 195611452aac826a922e5a3484a5dc9db2cfb794ca3982a5ce7b510660c8d53e

See more details on using hashes here.

Provenance

The following attestation bundles were made for apikey_inspector-0.1.0.2.tar.gz:

Publisher: pypi-publish.yml on AliHaSSan-13/apikey-inspector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file apikey_inspector-0.1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for apikey_inspector-0.1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bdf8f8c60eba50e4ff74345420de1c441da42caab8405a9f45eef705ece9f733
MD5 97f79611b9648bf89ad9f937c74a9156
BLAKE2b-256 736cfbea9438c14b263a732a87ac87ed5e2bad098945342150c211661cccf3c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for apikey_inspector-0.1.0.2-py3-none-any.whl:

Publisher: pypi-publish.yml on AliHaSSan-13/apikey-inspector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page