Grok by xAI
Grok is xAI's advanced language model API that provides powerful AI capabilities for chat completions, function calling, and text generation. The Grok API connector enables you to interact with Grok models through the xAI API, allowing you to generate text responses, perform function calling with external tools, and leverage AI-powered capabilities in your data workflows. This connector is particularly useful for applications that need to generate content, perform language analysis, integrate AI capabilities into data processing pipelines, or build conversational AI applications.
Power end-to-end data operations for your Grok by xAI API with Nexla. Our bi-directional Grok by xAI connector is purpose-built for Grok by xAI, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Grok by xAI or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Grok by xAI workflows fast, secure, and fully governed.
Features
Type: API
- Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
- Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
- API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
- Request optimization with intelligent batching, retry, and caching to minimize API calls and costs
Prerequisites
Before creating a Grok by xAI credential, you'll need to obtain an API key from your xAI account. xAI provides API keys for programmatic access to the Grok API, which are used to authenticate API requests.
To obtain a Grok API key:
-
Log in to your xAI account or create an account at
https://x.aiif you don't have one. -
Navigate to the API settings or developer section of your xAI account dashboard. This is typically accessible from your account settings or a dedicated API/Developer section.
-
In the API settings, locate the option to create or generate a new API key. xAI API keys typically start with the prefix
xai-. -
Click Create API Key or Generate New Key to create a new API key for your application.
-
Copy the API key immediately after generation, as it may only be displayed once for security purposes. Store it securely, as you'll need both the API key and the ability to regenerate it if needed.
-
Note the base URL for the Grok API (typically
https://api.x.ai) and the API version you'll be using (typicallyv1for the current Grok API version).
For detailed information about Grok API authentication and API key management, refer to the xAI API Documentation.
Authenticate
Credentials required
Authenticate using your Grok API Key
| Field | Required | Secret | Description |
|---|---|---|---|
| API Key | Yes | Yes | xAI-provided Grok API key (starts with xai-) |
| Base URL | Yes | No | Parameter for defining the base URL for the Grok API |
| API Version | Yes | No | Parameter for defining the API version for Grok API requests |
Create a credential in Nexla
- To create a new Grok by xAI credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
New Credential Overlay – Grok by xAI

-
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
-
In the API Key field, enter the Grok API key that you obtained from your xAI account. This is the API key that starts with
xai-and is used to authenticate requests to the Grok API.The API key is sensitive information and should be kept secure. If you've lost your API key, you'll need to generate a new one in your xAI account settings. API keys are used in the Authorization header as a Bearer token for all API requests.
-
In the Base URL field, enter the base URL for the Grok API. The default value is
https://api.x.ai, which is the standard base URL for xAI's Grok API. You typically won't need to change this unless you're using a custom endpoint. -
In the API Version field, enter the API version you want to use. The default value is
v1, which is the current version of the Grok API. You can specify a different version if your organization uses a specific API version. -
Click the Save button at the bottom of the overlay to save the configured credential. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.
Use as a data source
To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Grok by xAI connector tile, then select the credential that will be used to connect to the xAI instance, and click Next; or, create a new Grok by xAI credential for use in this flow.
Endpoint templates
Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Grok API endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.
Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.
Manual configuration
Grok by xAI data sources can also be manually configured to ingest data from any valid Grok API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom authentication headers or request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.
Grok API endpoints typically follow the pattern https://api.x.ai/v1/chat/completions or https://api.x.ai/v1/models. Common response data paths include $.choices[*] for chat completions or $.models[*] for model listings.
Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Grok by xAI data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.