xAI · Text

OpenClaw x Grok

Grok 4.5 and 4.6 serve conversational, coding, and agentic workloads through RunAPI with one API key, synchronous or streaming responses, and terminal usage reporting.

4 variants from $1.00 / 1M tokens Commercial OK

Prerequisite: npx runapi mcp install

Prompt

Prompt models

Use grok-4.20-0309-non-reasoning when it matches the task: grok-4.20-0309-non-reasoning.

You have access to RunAPI chat models for Grok.

Available Grok models:
- grok-4.20-0309-non-reasoning: grok-4.20-0309-non-reasoning
  chat endpoints: /v1/responses, /v1/chat/completions, /v1/messages
- grok-4.5: Grok for chat, coding, agentic tools, and lower hallucination risk
  chat endpoints: /v1/chat/completions, /v1/responses
- grok-4.6: Grok through Chat Completions and Responses with xhigh reasoning, image understanding, function tools, and structured output
  chat endpoints: /v1/responses
- grok-4.7: Newest Grok with 500K context, xhigh reasoning, image understanding, and function tools
  chat endpoints: /v1/responses

Use the model ID and chat endpoint that match the user's request.
Example request: Review this rollout plan, identify the three highest-risk assumptions, and return a concise mitigation for each.
Verify the active model with: openclaw models status;openclaw models set runapi/<model-id>

Public Versions and Endpoints

Model ID Endpoints Price Catalog
grok-4.20-0309-non-reasoning
/v1/responses /v1/chat/completions /v1/messages
$1.00 / 1M tokens Model detail
grok-4.5
/v1/chat/completions /v1/responses
$1.60 / 1M tokens Model detail
grok-4.6
/v1/responses
$1.60 / 1M tokens Model detail
grok-4.7
/v1/responses
$1.60 / 1M tokens Model detail

Verify

Poll until the task reaches a terminal status

Select <model-id> to generate verification commands.

Configuration

Guide endpoint: <endpoint>

Select <model-id> to generate a request with the endpoint's public input contract.
How it works

Get Started in 3 Steps

  1. Choose a model ID

    Select a public catalog model ID and review its endpoint and current starting price.

  2. Configure RunAPI

    Add the provider configuration for this agent.

  3. Verify the result

    Run the agent status and model-selection commands shown below.

What to Build with OpenClaw + Grok

  • Agent coding and reasoning

    Let your agent plan, write, and review code or work through multi-step problems with the model's reasoning.

  • Long document analysis and extraction

    Summarize reports, contracts, or codebases and pull structured fields out of long documents.

  • Tool-calling workflows

    Connect the model to functions and APIs so your agent can look up data and take actions between replies.

Why Use Grok Through RunAPI + OpenClaw

  • 4 variants, one API key

    Use one RunAPI connection to choose among the live model variants without changing your integration.

  • Clear usage pricing

    See current catalog pricing before you send a request, with no subscription or minimum spend required.

  • Direct responses

    Synchronous calls return the result in the same response, so your agent can use it immediately without task polling.

OpenClaw + Grok Questions

Which model ids should I use for Grok?

Use the public model ids grok-4.5 or grok-4.6 shown in the quickstart.

Can Grok call function tools through Responses?

Yes. Send flat Responses function definitions in tools and read the returned name and JSON arguments from function-call output items.

Do Grok 4.5 and 4.6 support structured JSON output?

Yes. Use text format with a strict JSON Schema for Responses, or response format for Grok Chat Completions.

How should I stream Grok Responses?

Treat a Responses stream as complete only after response.completed, terminal usage, and the final done marker.

Which model ID should I use?

Choose a public model ID from the version table. Each ID exposes the endpoints shown for that version.

Does this guide configure a chat model?

Yes. This Model Line supports a client-facing LLM protocol.

Start using Grok with OpenClaw

Building with a team?

We're here to help with enterprise setup, integrations, and technical questions.

Contact Us