xAIFrontierNew

Grok 4

xAI's most capable model with exceptional reasoning, real-time knowledge, and unfiltered analytical capabilities.

4.6(4,300 ratings)

Quick Overview

CategoryGeneral Purpose
Context Window256K tokens
SpeedStandard
Input$5 / 1M tokens
Output$15 / 1M tokens

Pricing

Simple, transparent token-based pricing. Pay only for what you use.

Input Tokens
$5
per 1M tokens
Output Tokens
$15
per 1M tokens

Capabilities

Core strengths and supported features of Grok 4.

Text Generation
Reasoning
Analysis
Code

Performance

Context window capacity and inference speed characteristics.

Context Window

256K

Extended context window suitable for processing long documents, large codebases, and multi-turn conversations with extensive history.

Speed: Standard

Balanced speed and quality. Well-suited for production workloads that need a good balance between response quality and latency.

Quick Start

Get started with Grok 4 in just a few lines of code.

import OriginalPoint from "originalpoint";

const client = new OriginalPoint({
  apiKey: process.env.ORIGINALPOINT_API_KEY,
});

const response = await client.chat.completions.create({
  model: "grok-4",
  messages: [
    {
      role: "user",
      content: "Hello, how can you help me today?",
    },
  ],
  max_tokens: 1024,
});

console.log(response.choices[0].message.content);