Models / Grok 4
🔮

Grok 4

by xAI · 256k context · flagship

xAI's most powerful model. Strong at reasoning, real-time knowledge, and unconventional problem-solving approaches.

Pricing Comparison

Per 1 million tokens

Official (xAI) NeatAPI You Save
Input Tokens $3.00 $2.85 $0.15
Output Tokens $15.00 $14.25 $0.75

That's 5% savings on every API call. See full pricing →

Code Examples

Drop-in replacement — just change the base URL and API key.

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.neatapi.ai/v1",
    api_key="your-neatapi-key"
)

response = client.chat.completions.create(
    model="grok-4",
    messages=[
        {"role": "user", "content": "Hello, world!"}
    ]
)
print(response.choices[0].message.content)

Node.js

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.neatapi.ai/v1',
  apiKey: 'your-neatapi-key'
});

const response = await client.chat.completions.create({
  model: 'grok-4',
  messages: [
    { role: 'user', content: 'Hello, world!' }
  ]
});
console.log(response.choices[0].message.content);

cURL

curl https://api.neatapi.ai/v1/chat/completions \
  -H "Authorization: Bearer your-neatapi-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4",
    "messages": [
      {"role": "user", "content": "Hello, world!"}
    ]
  }'

Key Specifications

Provider

xAI

Context Window

256k tokens

Category

Flagship

API Format

OpenAI-compatible

Related Models

Start Using Grok 4 Today

Get your API key in 30 seconds. Same API format as xAI — zero migration effort.