How this tool works
When you click "Test API Key", this page makes a direct request to OpenAI's /v1/models endpoint using JavaScript. If OpenAI returns a 200 OK status, your key is valid. If it returns a 401 Unauthorized error, your key is invalid, revoked, or typed incorrectly. Because the request happens entirely in your browser, your API key is never logged or stored by ToolHunt.
Common OpenAI API Key Errors
- 401 Unauthorized: The key is incorrect, deleted, or you are using an old key from a different organization.
- 429 Too Many Requests: The key is valid, but you have hit your rate limit or have no remaining credits.
- insufficient_quota: You need to add billing information to your OpenAI platform account.
How to test an OpenAI API key using cURL
If you are a developer and want to test your key locally, you can use the following terminal command:
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
If the key is valid, you will see a JSON list of available models (like GPT-4o or GPT-3.5-Turbo).