How to Test If Your API Key Works — Free Online Checker 2026
Step-by-step guide to testing API keys for OpenAI, Anthropic, Google Gemini, Zhipu, and more — using a free online checker.
Whether you just generated a new API key, purchased one from a reseller, or inherited one from a colleague, you need to know if it actually works. A broken key blocks your development. A fake key drains your budget. This guide shows you how to test any LLM API key for free — and what to do when it fails.
Why Testing Your API Key Matters
API key problems fall into three categories:
- Invalid keys — The key is expired, revoked, or malformed. Your code fails immediately.
- Restricted keys — The key works but lacks access to the models or features you need. Your code fails on specific endpoints.
- Fake keys — The key connects to a relay that pretends to offer one model but serves another. Your code works, but you're overpaying for inferior output.
Each problem requires a different level of testing. A simple "does it work?" check catches the first two. Only a deep behavioral analysis catches the third.
How to Test an OpenAI API Key
OpenAI keys start with sk- or sk-proj-. To test one:
- Paste your key into API-DNA — No sign-up required
- Review the provider check — Confirms the key reaches OpenAI's servers (not a relay)
- Check model access — Verifies which GPT models are available to this key
- Run a behavioral test — Sends a prompt and fingerprints the response to confirm the real model
For more on OpenAI key validation specifically, see our OpenAI API Key Validator guide.
How to Test an Anthropic API Key
Anthropic keys start with sk-ant-api. Testing an Anthropic key follows the same process:
- Enter your key in API-DNA
- Provider verification — Checks whether the key connects to Anthropic's API directly or through a proxy
- Model fingerprinting — Confirms whether you're getting Claude 3.5 Sonnet, Claude 3 Opus, or a substituted model
- Token audit — Compares reported token counts against independent measurement
See our dedicated Anthropic API Key Checker guide for deeper analysis.
How to Test a Google Gemini API Key
Google Gemini keys start with AIza. The testing process is the same — paste the key into API-DNA and review the results. We verify whether the key reaches Google's servers, which Gemini models are accessible, and whether the responses match the claimed model's behavior.
How to Test Chinese LLM API Keys
Chinese LLM providers have their own key formats and API structures. API-DNA supports:
- Zhipu (智谱) — GLM-4, GLM-4-Plus, ChatGLM
- Moonshot — Moonshot-v1 series
- DeepSeek — DeepSeek-V2, DeepSeek-Coder
- Qwen (通义千问) — Qwen-Max, Qwen-Plus
Chinese API resellers are particularly common, making key verification even more important. Many resellers advertise access to top-tier models but route to cheaper alternatives.
How to Test OpenAI-Compatible Keys (From Any Provider)
Many providers offer OpenAI-compatible endpoints — they use the same API format but connect to different backends. If you have a custom base URL (like https://api.someprovider.com/v1), paste both the key and the base URL into API-DNA. We'll trace the actual infrastructure and identify the real model behind the endpoint.
Manual Testing with cURL
If you want to do a quick manual test, you can use cURL:
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4","messages":[{"role":"user","content":"hi"}],"max_tokens":5}'A successful response (200) means the key works. But this only tells you the key is valid — not whether the model is real or tokens are accurate. For that, you need API-DNA's behavioral analysis.
What to Do If Your API Key Fails
- 401 error — Key is invalid or revoked. Generate a new one from the provider dashboard.
- 403 error — Key lacks permissions. Check your plan and billing status.
- 429 error — Rate limited. Wait and retry, or check your usage limits.
- Model mismatch detected — Your provider is serving a different model than claimed. See our fake API detection guide.
- Token inflation detected — You're being overcharged. Read about token inflation and consider switching providers.
Test Your API Key Now — Free
Stop guessing whether your API key works. Test it now — free, instant, no sign-up. Supports OpenAI, Anthropic, Google, Zhipu, and any OpenAI-compatible endpoint.