invalid_api_key error: cause & fix
Invalid API key or authentication failed
invalid_api_keyincorrect api keyauthentication_errorunauthorized401
Likely cause
The key may be wrong, expired, missing permission, or not accepted by this endpoint.
Recommended fixes
- Check whether the key was copied completely
- Confirm the API base URL and key belong to the same provider
- Use the key checker to validate the /models endpoint
Scan to join WeChat group