Warning: The provided API key is invalid.
The API key was loaded from the CURSOR_API_KEY environment variable.
Please check you have the right key, create a new one, or authenticate without it.
We’re aware of an issue where the “The provided API key is invalid” error is shown for any connectivity issue, not just for invalid credentials. So your API key may actually be fine; the CLI just can’t reach our servers from inside the container.
Could you try running these two commands locally to help narrow down the issue?
1. Verify DNS resolution:
nslookup api2.cursor.sh
2. Test HTTPS connectivity:
curl -v https://api2.cursor.sh
If either of these fails, the issue is network-related rather than an API key problem.