Grok/Google API can not use in Cursor

I try to use Grok and Google/Gemini API in cursor, but it always gives me a big ‘INVALID API KEY’ when I click ‘Verify’. That’s terrible. Is there anyone encountering the same problem ?

Hey, could you share a screenshot?

Thanks for your attention !!!
I have solved the problem of ‘INVALID API KEY’ which is caused by that I did’t uncheck the models that I have no api access (like gpt-4o, since I do not use an openai api) . However, when I switch to grok api, the following error occurs :
{“code”:“Client specified an invalid argument”,“error”:“An empty message was provided. Every message needs at least one non-empty content element.”}
I do have message in the text window. I do not know what’s wrong.

The api key is set correctly by default in the console and the base url has been changed to https://api.x.ai/v1. And the model is grok-2.

All right. The problem is solved somehow when I change between Ask/Edit/Agent. It might be a client bug.