Skip to main content
Glama

grok_chat_completions

Send messages to Grok chat models to generate OpenAI-compatible chat completions, supporting reasoning, vision, and tool calling via the 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv0.1.6
    • addedInput schema / properties / audio
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Audio output configuration when requesting audio modality.",
      +  "title": "Audio"
      +}
    • addedInput schema / properties / logit_bias
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "integer"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Token logit bias map.",
      +  "title": "Logit Bias"
      +}
    • addedInput schema / properties / logprobs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Whether to return log probabilities of output tokens.",
      +  "title": "Logprobs"
      +}
    • addedInput schema / properties / max_completion_tokens
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Upper bound for tokens generated for a completion.",
      +  "title": "Max Completion Tokens"
      +}
    • addedInput schema / properties / metadata
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Developer-defined metadata attached to the request.",
      +  "title": "Metadata"
      +}
    • addedInput schema / properties / modalities
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Output modalities requested for this response.",
      +  "title": "Modalities"
      +}
    • addedInput schema / properties / n
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "How many chat completion choices to generate. Default 1.",
      +  "title": "N"
      +}
    • addedInput schema / properties / parallel_tool_calls
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Whether to enable parallel tool calls. Default true.",
      +  "title": "Parallel Tool Calls"
      +}
    • addedInput schema / properties / prediction
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Static predicted output content to improve latency.",
      +  "title": "Prediction"
      +}
    • addedInput schema / properties / service_tier
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "auto",
      +        "default",
      +        "flex",
      +        "scale",
      +        "priority"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Specifies the processing tier. Options: 'auto' (default), 'default', 'flex' (asynchronous batch-eligible), 'scale', or 'priority'.",
      +  "title": "Service Tier"
      +}
    • addedInput schema / properties / store
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Whether to store the output of this chat completion. Default false.",
      +  "title": "Store"
      +}
    • addedInput schema / properties / stream_options
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Options for streaming responses.",
      +  "title": "Stream Options"
      +}
    • addedInput schema / properties / top_logprobs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Number of most likely tokens to return at each token position.",
      +  "title": "Top Logprobs"
      +}
    • addedInput schema / properties / web_search_options
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Web search configuration for search-capable models.",
      +  "title": "Web Search Options"
      +}
  2. Changed5 schema fields changedv0.1.3
    • changedInput schema / properties / messages / description
      Previous value: -"Conversation 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."New value: +"Conversation 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."
    • changedInput schema / properties / model / description
      Previous value: -"The 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."New value: +"The Grok chat model: grok-4.5 (default, latest flagship), grok-4 or grok-3."
    • changedInput schema / properties / model / enum
      Previous value: -[
      -  "grok-4",
      -  "grok-4-1-fast",
      -  "grok-4-1-fast-non-reasoning",
      -  "grok-3",
      -  "grok-3-mini",
      -  "grok-2-vision"
      -]New value: +[
      +  "grok-4.5",
      +  "grok-4",
      +  "grok-3"
      +]
    • changedInput schema / properties / reasoning_effort / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "low",
      -      "high"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "minimal",
      +      "low",
      +      "medium",
      +      "high"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / reasoning_effort / description
      Previous value: -"Reasoning effort: 'low' or 'high'. Only applies to reasoning-capable models (e.g. grok-3-mini). Ignored by non-reasoning models."New value: +"Reasoning effort. Only applies to reasoning-capable models; ignored by non-reasoning models."
  3. First observedv0.1.0

TDQS

A4.3/5.0
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.