Back to tools

AI Agent Tool

Grok 4 logo

Grok 4

xAI's frontier language model with 1M-token context, multimodal reasoning, and agentic task support.

AI ModelCommunity

x.ai

•

API Key

About Grok 4

Grok 4 is xAI's flagship large language model, released in 2025, with subsequent versions (Grok 4.3 released April 30, 2026) refining capabilities and pricing. It accepts text and image inputs, supports a 1 million token context window, and is designed for agentic workflows, long-document analysis, deep research, and instruction-following tasks. As of June 2026, Grok 4.3 is the most capable model in the family and is 58% cheaper on input than the original Grok 4. The model is accessible via the xAI API (developer key) and consumer plans through X/SuperGrok subscriptions.

AI Agent Use Cases

- 1 million token context window with no output token limit

- Multimodal input: text and images

- Configurable reasoning effort levels (none/low/medium/high)

- Optimized for agentic workflows, multi-step tasks, and long-document analysis

- Available via xAI API with up to $175/month in free developer credits

- Consumer access via SuperGrok ($30/month) and X Premium+ ($40/month)

Available Actions

These are the specific actions that AI agents can perform with this tool

Inputs

api_key

API key used for authentication, must be included as 'Authorization: Bearer <api_key>' in the request headers.

model

The model used for invoice extraction, must be set to a supported model for structured outputs.

system_prompt

A prompt that instructs the model to extract invoice data, e.g., 'Given a raw invoice, carefully analyze the text and extract the relevant invoice data into JSON format.'

invoice_text

The raw, unstructured text content of an invoice to be parsed (can include multiple lines, must include all relevant invoice info).

invoice_schema

The schema to define what fields and structure should be returned in the JSON output; must comply with the structured output requirements.

Inputs

model

ID of the model to use for the chat completion. Must be a valid model available to your API key (e.g., 'grok-4').

messages

Conversation messages as a list of objects. Each message must include a 'role' ('system', 'user', etc.) and 'content' (string for text or relevant info for images). Must provide enough context for the model to generate a response.

reasoning_effort

Configures the model's reasoning effort. Optional, typical values like 'low', 'medium', or 'high' may influence response quality vs speed.

n

Number of response choices to generate and return. If omitted, defaults to 1. Must be a positive integer.

max_tokens

Maximum number of tokens to generate in the completion. If omitted, model default is used.

temperature

Sampling temperature to use. Higher values (e.g., 1.0) produce more diverse outputs, lower values (e.g., 0.1) are more deterministic. Optional.

Inputs

image

The image to be analyzed. This must be provided as a binary file upload, such as a JPEG or PNG file, for the API to detect content within it.

Inputs

model

The model name to use for chat completion; required, must be set to a supported model with live search capability.

messages

An ordered list of chat message objects, with at least one user message; determines prompt and conversation history.

search_parameters

Configuration object for live search; must include at least the 'mode' field to activate search. All other fields are optional.

Inputs

messages

Message history, including user, assistant, and tool messages, where each tool message should contain the tool function's result and the tool_call_id as required by the model.