LLM Open Connector + Grok
Learn how to implement Salesforce's LLM Open Connector with the xAI platform and Grok. This blog walks through generating an xAI API key and creating a configured model in Salesforce. No custom scripts or deployments are required.
Prerequisitesβ
- If you don't already have one, create an xAI account.
- Create a team in the xAI Cloud Console.
- Purchase some xAI API credits.
- Create an API key.
Integrate with Agentforceβ
xAI is fully compatible with the Open Connector API specification, so you can follow the LLM Open Connector product guide. Follow the steps in this post for an overview.
Step 1. Add a Foundation Modelβ
Navigate to Einstein Studio in Data Cloud.
Step 2. Connect Your LLMβ
Select the option to bring your own model.
Step 3. Enter Your xAI API Keyβ
Enter your xAI details to create a new model connection in Model Builder.
- Add
https://api.x.ai/v1/chat/completions
to the URL field. - Add your API secret to the Auth Key field.
- Add
grok-4
to the Model Name field.
Step 4. Create A Configured Modelβ
Before you can use your connected model, you need to create a configured model. Select grok-4 in the Model Library and click New Configuration.
Test your model in the the Model Playground. When you're ready, you can save your configuration and create the model for use in Salesforce.
Step 5. Start Using Grokβ
You can now use Grok 4 via Salesforce's Open Connector! You can leverage Grokβs advanced reasoning in your Agentforce application to handle complex requests and streamline workflows.
To monitor consumption, purchase additional credits, and manage your Grok models, use the xAI Cloud console.