api-key-verification
FreeRuns bundled scriptsNot checkedIdentify pasted API keys by prefix and verify liveness.
by jiayaoqijia★ 81 GitHub starsAbout this skill
API Key Identification & Verification
Use when: the user pastes an API key/token and asks "what is this?", "is this valid?", "whose account is this?". Goal: identify the provider from the key's prefix, verify it is live, and report usage/limits/ownership — without printing the secret.
Steps
- Identify the provider from the key prefix. Index:
references/providers.md. Prefix alone is not identity for generic prefixes (many providers usesk-); confirm with a metadata call. - Probe the provider's read-only metadata/credits endpoint with the key as a Bearer token. These calls have no side effects — never "test" a key against a state-mutating endpoint (no setWebhook-style calls just to check). When no metadata endpoint exists, verify with the single cheapest metered call the provider sells (Exa:
type: lite,numResults: 1, one query), say what that probe cost, and read 401 vs 200 — seereferences/providers.md. - Report: valid? label, expiry, spend limit, usage, remaining credits, creator id. Never echo the full key in your reply — it is already in the transcript, don't amplify it; refer to it as
<prefix>…<last4>. When the balance is unreadable (service-key-only admin API), say so plainly instead of inventing a number. - Warn when a live credential was pasted into chat: it is now also in the session store (
~/.hermes/state.db) and the agent log (~/.hermes/logs/agent.log), not just the shell history — offer to scrub those rows or to rotate the key at the provider's keys page.
Pitfalls
- A default/masked label (the key itself truncated) means the owner never named the key — not that it's fake.
- No prefix is not "no provider": bare UUIDs are real keys for search/retrieval APIs (Exa), and the auth header may be
x-api-keyrather thanBearer— check the vendor's own curl sample before concluding the key is malformed. - Google API keys are not always
AIza…: the current Stitch/Studio key format isAQ.…and is sent as theX-Goog-Api-Keyheader, never as a Bearer token. Probehttps://stitch.googleapis.com/mcpwith a JSON-RPCinitialize+tools/listPOST to prove it live. - Read the Google error code as state, not as invalidity:
403 API has not been used in project N … or it is disabledmeans the key is valid for that project and only the API is off — say that, and name the project number.401 Request had invalid authentication credentialswhen the same key is sent asAuthorization: Bearermeans you used the wrong header, not that the key is dead. - Never store the key yourself by echoing it back into a command line that a log or shell history will keep; write it to the credential file from a variable and confirm only with a masked check (
grep -c '^KEY_NAME=',stat -c '%A'). - Usage figures are in USD.
- 401 from the metadata endpoint = invalid or revoked. Say so; don't retry-hammer.
limit: null= no spend cap set;expires_at: null= no expiry. Both are normal, not anomalies.
Verified example: OpenRouter (sk-or-v1-)
curl -s https://openrouter.ai/api/v1/auth/key -H "Authorization: Bearer $KEY"
# → label, is_management_key, limit, usage (lifetime/daily/weekly/monthly, USD),
# is_free_tier, expires_at, creator_user_id
curl -s https://openrouter.ai/api/v1/credits -H "Authorization: Bearer $KEY"
# → total_credits, total_usage (no account email in the 2026-08 response)
Prefix index for other providers: references/providers.md.
Install api-key-verification in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the api-key-verification skill do?
Identify pasted API keys by prefix and verify liveness.
How do I install the api-key-verification skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the api-key-verification skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic