Skip to main content
Glama

grok_chat_completions

Send messages to a Grok model (grok-4/3) to get chat responses, vision understanding, and function calling via AceDataCloud API.

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
- 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
nNoHow many chat completion choices to generate. Default 1.
seedNoRandom seed for (best-effort) deterministic sampling.
stopNoStop sequences where the API will stop generating tokens.
userNoEnd-user identifier for abuse monitoring.
audioNoAudio output configuration when requesting audio modality.
modelNoThe Grok chat model: grok-4.5 (default, latest flagship), grok-4 or grok-3.grok-4
storeNoWhether to store the output of this chat completion. Default false.
toolsNoList of tools (functions) the model may call.
top_pNoNucleus sampling probability mass. Default 1.
streamNoWhether to stream partial message deltas. Default False.
logprobsNoWhether to return log probabilities of output tokens.
messagesYesConversation messages. Each message is a dict with 'role' ('system'/'user'/'assistant'/'tool') and 'content' keys. Content may be a list of text/image_url parts for image input. Required.
metadataNoDeveloper-defined metadata attached to the request.
logit_biasNoToken logit bias map.
max_tokensNoMaximum number of tokens to generate.
modalitiesNoOutput modalities requested for this response.
predictionNoStatic predicted output content to improve latency.
temperatureNoSampling temperature between 0 and 2. Higher = more random.
tool_choiceNoControls tool calling. 'none', 'auto', 'required', or a dict.
service_tierNoSpecifies the processing tier. Options: 'auto' (default), 'default', 'flex' (asynchronous batch-eligible), 'scale', or 'priority'.
top_logprobsNoNumber of most likely tokens to return at each token position.
stream_optionsNoOptions for streaming responses.
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. Only applies to reasoning-capable models; ignored by non-reasoning models.
frequency_penaltyNoFrequency penalty between -2.0 and 2.0. Positive decreases repetition.
web_search_optionsNoWeb search configuration for search-capable models.
parallel_tool_callsNoWhether to enable parallel tool calls. Default true.
max_completion_tokensNoUpper bound for tokens generated for a completion.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the behavioral burden, and it delivers the key traits: it sends messages to a remote Grok model and returns the response in the OpenAI-compatible chat completion format, with vision and function-calling capabilities called out. It does not mention cost, rate limits, or data-sharing implications of calling an external API, but those are inherent to the named API and less critical than the operation/response behavior.

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 front-loaded and well structured with a short definition, scoped usage bullets, an alternative, and a returns note. Minor redundancy exists between the opening sentence and the 'Returns:' line, but no sentence is wasted.

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?

For a 29-parameter tool with a fully described schema and an output schema, the description covers purpose, use cases, exclusions, and response format. It is not a 5 because it omits an example of the required messages structure and model-specific caveats, though the schema compensates for most of this.

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 input schema already documents all 29 parameters. The narrative mentions vision and tool calling, which aligns with messages/tools, but it does not add syntax or format details beyond what the schema provides; baseline 3 is appropriate.

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 opens with a specific action and resource: 'Create a Grok (xAI) chat completion via the AceDataCloud Grok API' and then clarifies it sends messages to a Grok model and returns an OpenAI-compatible response. It also separates itself from sibling generation tools by telling agents to use grok_text_to_video / grok_image_to_video for video.

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?

It provides explicit 'Use this when' bullets for chat/reasoning, vision, and tool calling, and an explicit exclusion: 'For generating videos, use grok_text_to_video / grok_image_to_video instead.' This tells the agent both when to invoke this tool and when not to.

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