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.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-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

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

Hashes for apikey_inspector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2d5d12ca9dfc5ee0647198827b3092d1d0979bd22a5ed831de2a20f4ad28983b
MD5 461cab96fe60cee4dc95f6159765f994
BLAKE2b-256 1a814496203e7510788969a82dd85fc5737d0d741549977c615bdeef8c1f6d48

See more details on using hashes here.

Provenance

The following attestation bundles were made for apikey_inspector-0.1.0.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-py3-none-any.whl.

File metadata

File hashes

Hashes for apikey_inspector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d8fdbe0441c470927e8ca38c0d4b435a710d8732b6d7525d00b0e0ef27ce738
MD5 5e6e3dbe9f200d12a4b91b40a6650ad8
BLAKE2b-256 70148df587d796d27f31e3efc024fe13617c95a49b8e8fda442207900782fafa

See more details on using hashes here.

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

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