---
canonical_url: "https://docs.composio.dev/toolkits/grok"
markdown_url: "https://docs.composio.dev/toolkits/grok.md"
product: "platform"
version: null
last_updated: null
---

# Grok

Grok is xAI's API platform for text, image, video, embedding, file, search, and voice capabilities.

- **Category:** artificial intelligence
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 8
- **Triggers:** 0
- **Slug:** `GROK`
- **Version:** 00000000_00

## Tools

### Create Embeddings

**Slug:** `GROK_CREATE_EMBEDDINGS`

Create vector embeddings for one or more text inputs with an xAI embedding model.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user` | string | No | Stable end-user identifier that helps xAI monitor and detect abuse. |
| `input` | string | Yes | One non-empty text value or a batch of up to 128 non-empty text values to embed. |
| `model` | string | Yes | xAI embedding model ID to use. |
| `dimensions` | integer | No | Requested number of output dimensions when supported by the model. |
| `encoding_format` | string ("float" | "base64") | No | Embedding encoding to return: 'float' for numeric vectors or 'base64'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Response

**Slug:** `GROK_CREATE_RESPONSE`

Generate a bounded, non-streaming Grok response from text or structured multimodal input, with optional reasoning, search, and function or web-search tools. Responses are ephemeral by default; set store=true to retain one for 30 days.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `input` | string | Yes | Plain text, or structured message, function-call, and function-result items containing text, images, or files. To continue a tool call without store=true, replay the model's function_call item followed by its function_call_output. |
| `model` | string | Yes | xAI model ID to use; obtain available IDs from GROK_LIST_MODELS. |
| `store` | boolean | No | Whether xAI should retain the input and response for retrieval or continuation. Defaults to false; stored responses are retained for 30 days. |
| `tools` | array | No | Up to 128 function or web-search tool definitions available to the model. |
| `temperature` | number | No | Sampling temperature from 0 to 2. |
| `tool_choice` | string | No | Whether tools are disabled, automatic, required, or a named tool is forced. |
| `instructions` | string | No | System-level guidance; do not combine with previous_response_id. |
| `reasoning_effort` | string ("none" | "low" | "medium" | "high") | No | Reasoning effort supported by the selected model. |
| `max_output_tokens` | integer | No | Upper bound on generated output and reasoning tokens (1-128000). |
| `search_parameters` | object | No | Realtime web, X, news, or RSS search configuration. |
| `previous_response_id` | string | No | Prior response ID whose conversation context should be continued. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Image

**Slug:** `GROK_GENERATE_IMAGE`

Generate one or more images from a text prompt with an xAI image-generation model.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user` | string | No | Stable end-user identifier that helps xAI monitor and detect abuse. |
| `model` | string | No | xAI image-generation model ID; omit only when relying on the provider default. |
| `prompt` | string | Yes | Description of the image to generate. |
| `resolution` | string ("1k" | "2k") | No | Output resolution supported by grok-imagine models; omit to use the provider default. |
| `image_count` | integer | No | Number of images to generate (1-10). |
| `aspect_ratio` | string ("1:1" | "3:4" | "4:3" | "9:16" | "16:9" | "2:3" | "3:2" | "9:19.5" | "19.5:9" | "9:20" | "20:9" | "1:2" | "2:1" | "auto") | No | Output aspect ratio supported by grok-imagine models; omit to use the provider default. |
| `response_format` | string ("url" | "b64_json") | No | Image result format: 'url' for a generated-file URL or 'b64_json' for base64-encoded image bytes. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Generate Video

**Slug:** `GROK_GENERATE_VIDEO`

Start asynchronous xAI video generation from a text prompt, optionally conditioned on an image, and return a request ID for status checks.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user` | string | No | Stable end-user identifier that helps xAI monitor and detect abuse. |
| `model` | string | No | Video-generation model ID; omit only to use xAI's provider default. |
| `prompt` | string | Yes | Description of the video to generate. |
| `duration` | integer | No | Requested video duration in seconds (1-15); xAI defaults to 8. |
| `image_url` | string | No | Optional public URL or base64 data URL for a JPEG, PNG, or WebP image to use as the video's first frame. |
| `resolution` | string ("480p" | "720p" | "1080p") | No | Output video resolution supported by xAI. |
| `aspect_ratio` | string ("1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3") | No | Output aspect ratio supported by xAI. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get API Key Info

**Slug:** `GROK_GET_API_KEY_INFO`

Inspect the connected xAI API key's identity, wildcard or granular ACLs, and key or team blocking state.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Current Account

**Slug:** `GROK_GET_CURRENT_ACCOUNT`

Verify the connected xAI credential and return the caller, team, zero-data-retention status, and key blocking state.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Video

**Slug:** `GROK_GET_VIDEO`

Check an asynchronous xAI video request. Returns pending while generation is in progress, the video and usage when done, or the structured generation error when failed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `request_id` | string | Yes | Deferred request ID returned by GROK_GENERATE_VIDEO. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Models

**Slug:** `GROK_LIST_MODELS`

List models available to the connected xAI key, including model IDs and published pricing metadata needed to choose a model for other tools.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
