Skip to main content
Glama

grok_chat_completions

Send messages to Grok models to generate chat completions with reasoning, vision, and function calling capabilities. Returns the response in OpenAI-compatible format.

Instructions

Create a Grok (xAI) chat completion via the AceDataCloud Grok API.

Sends messages to a Grok chat model and returns the generated response in the
OpenAI-compatible chat completion format.

Use this when:
- You want to chat/reason with a Grok model (grok-4 / grok-3 family)
- You need vision/image understanding (use grok-2-vision)
- You need tool/function calling with Grok

For generating videos, use grok_text_to_video / grok_image_to_video instead.

Returns:
    JSON response containing the chat completion result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoRandom seed for (best-effort) deterministic sampling.
stopNoStop sequences where the API will stop generating tokens.
userNoEnd-user identifier for abuse monitoring.
modelNoThe Grok chat model. grok-4 (default, flagship) and grok-3 are the broadly available models. Also: grok-4-1-fast, grok-4-1-fast-non-reasoning, grok-3-mini, grok-2-vision (image input) — availability depends on upstream provisioning.grok-4
toolsNoList of tools (functions) the model may call.
top_pNoNucleus sampling probability mass. Default 1.
streamNoWhether to stream partial message deltas. Default False.
messagesYesConversation messages. Each message is a dict with 'role' ('system'/'user'/'assistant'/'tool') and 'content' keys. For vision with grok-2-vision, content may be a list of text/image_url parts. Required.
max_tokensNoMaximum number of tokens to generate.
temperatureNoSampling temperature between 0 and 2. Higher = more random.
tool_choiceNoControls tool calling. 'none', 'auto', 'required', or a dict.
response_formatNoResponse format specification (e.g. {"type": "json_object"}).
presence_penaltyNoPresence penalty between -2.0 and 2.0. Positive increases topic variety.
reasoning_effortNoReasoning effort: 'low' or 'high'. Only applies to reasoning-capable models (e.g. grok-3-mini). Ignored by non-reasoning models.
frequency_penaltyNoFrequency penalty between -2.0 and 2.0. Positive decreases repetition.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It mentions OpenAI-compatible format, returns JSON response, and notes model availability dependence on provisioning. However, it does not disclose potential side effects, auth requirements, or rate limits, which are relevant for a chat completion API.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bullet points and sections. It is concise (about 10 lines) and front-loaded with the main purpose. The 'Returns:' line slightly repeats the output schema, but overall it is efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 15 parameters with 100% schema coverage and an output schema, the description covers the main purpose, usage scenarios, and model availability. It does not detail every parameter (schema does) but provides sufficient context for agents to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds some context (e.g., vision content structure for grok-2-vision) but largely restates what the schema already says. It does not add meaningful new information beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a Grok (xAI) chat completion') and the resource via the AceDataCloud Grok API. It lists specific use cases (chat/reason, vision, tool calling) and distinguishes from sibling tools (grok_text_to_video/grok_image_to_video). This provides high purpose clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides a 'Use this when:' section listing three scenarios, and explicitly directs to alternative tools for video generation. This offers clear guidance on when to use the tool versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AceDataCloud/GrokMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server