🚀Wrong API key
Error: 401 Incorrect API key provided
The key sent to an outside service (AI, maps, payments, etc.) is wrong or can't be used.
🤔 Why does it happen?
- Part of the key got cut off when copying, or a space slipped in
- The key was deleted or reissued, so the old key no longer works
- Test keys and live keys got mixed up
🔧 Try this
- Create a new key in the service's dashboard and put it in again
- After adding it to the environment variables, restart the server or redeploy
- If the key was uploaded to GitHub, cancel it right away and create a new one
🤖 Ask your AI like this
I get an 'Invalid API key' error when I call an outside API. Please check that the code reads the key from an environment variable correctly, and also make sure the key isn't exposed in the browser or on GitHub. Don't ask me for the key value.
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Build failed (deploy failed)
Build failed - Missing environment variable
Missing environment variable - Timed out (504 Timeout)
504 Gateway Timeout - Domain not found (DNS)
DNS_PROBE_FINISHED_NXDOMAIN - Secure connection error (SSL certificate)
Your connection is not private - Deployed site shows 404 (Vercel NOT_FOUND)
404: NOT_FOUND (Vercel) - Server function failed to run (FUNCTION_INVOCATION_FAILED)
500: FUNCTION_INVOCATION_FAILED - Environment variable is undefined in the browser
process.env 값이 브라우저에서 undefined - Only a white screen after deploying
배포했더니 흰 화면만 나와요