Xai API as grok-beta : custom model

How can I use a custom model with my own API?

Xai API was released, and their model is grok-beta.

How can I use this?

Cursor does not have a spot to add my API key for my custom model.

See picture.

here are Xai docs for integration: Welcome to the xAI documentation

1 Like

Hi @shibz

You can use this model via OpenRouter:

2 Likes

You can try adding your API key too. Just change the base URL to https://api.x.ai/v1, add your API key, and add the grok-beta model to the model list.

1 Like

I hoped this would work, but unfortunately not. I tried to add a custom js file and have the model use it, but that does not work either.

Thanks for the other tip via, but not interested in the OpenRouter if it bypasses Cursor’s subscription entirely.

Verifying cuustom URL API keys would always fail for me with even with Open Router until I disabled the cursor-small model. I think this could be handled better by Cursor.

I was able to get my xAI key to verify by disabling every model except for:
grok-beta

FYI: Use this model name if you want it to work with Open Router.
x-ai/grok-beta

4 Likes