Use with Code Editors
You can use Grok with coding assistant plugins to help you code. Our Code models are specifically optimized for this task, which would provide you a smoother experience.
For pricing and limits of Code models, check out Pricing.
Using Grok Code models with Cursor
You can also use Grok with Cursor to help you code.
After installing Cursor, head to Cursor Settings -> Models.

Open API Keys settings, enter your xAI API key, and set Override OpenAI Base URL to https://api.x.ai/v1

In the "Add or search model" input box, enter a coding model such as grok-4.3. Then click on "Add Custom Model".

Other code assistants supporting Grok Code models
Besides Cursor, you can also use our code model with GitHub Copilot, opencode, Kilo Code, Roo Code, and Windsurf.
Using xAI API with Xcode
To use xAI API with Xcode, you need to add xAI API endpoint as a new Model Provider in Xcode coding intelligence.
Go to Xcode -> Settings -> Intelligence, and click on "Add a Provider..." button. In the pop-up menu, enter the following:
- URL:
https://api.x.ai - API Key: Your xAI API key starting with
xai-..., without Bearer - API Key Header:
Authorization
For more information, you can review Apple's guide on setting up a new Model Provider in Xcode coding intelligence.
Last updated: May 14, 2026