Back to Models
xAI: Grok 4 AI Model Icon

xAI: Grok 4

x-ai/grok-4

Description

Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the [xAI docs](https://docs.x.ai/docs/models/grok-4-0709)

API Usage Examples

OpenAI Compatible Endpoint

Use this endpoint with any OpenAI-compatible library. Model: xAI: Grok 4 (x-ai/grok-4)

curl https://api.ridvay.com/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer YOUR_API_KEY"   -d '{
    "model": "x-ai/grok-4",
    "messages": [
      {
        "role": "user",
        "content": "Explain the capabilities of the xAI: Grok 4 model"
      }
    ],
    "temperature": 0.7,
    "max_tokens": 1024
  }'

Supported Modalities

  • Text
  • Images

API Pricing

  • Input: 3$ / 1M tokens
  • Output: 15$ / 1M tokens

Token Limits

  • Max Output: 256,000 tokens
  • Max Context: 256,000 tokens

Subscription Tiers

  • free
  • pro
  • ultimate