AI Model APIs
AI Model APIsProviders
AI Model APIs

The complete platform for comparing AI models. Find pricing, capabilities, and the perfect model for your use case.

contact@aimodelapis.com

Resources

  • AI Models APIs
  • Providers

About

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 AI Model APIs. All rights reserved.

Back to Models
xAI

Grok 4 API

xAI
About

Build advanced reasoning agents with Grok 4, a specialized AI model optimized for complex logic and chain-of-thought tasks. This model delivers cost-effective pricing at $3.00/1M input and $15.00/1M output tokens, native tool calling support. Access Grok 4 via the xAI API with up to 64K output tokens.

Capabilities

Input Modalities

text

Output Modalities

text
Reasoning
Yes
Structured Output
No
Tool Use
Yes
WeightsClosed
Temperature
Adjustable
Attachment
Not Supported
Limits
Context Window
256K

Tokens

Input Limit
256K

Tokens

Max Output
64K

Tokens

Pricing

Standard (per 1M tokens)

Input
$3.00
Output
$15.00

Reasoning (per 1M tokens)

Output
$15.00

Caching (per 1M tokens)

Read
$0.75
Frequently Asked Questions

Grok 4 by xAI costs $3.00 per 1M input tokens and $15.00 per 1M output tokens. Cached reads cost $0.75 per 1M tokens.

Model Details
ID
grok-4
Provider
xAI
Family
grok
Release Date
Jul 9, 2025
Knowledge Cutoff
Jul 1, 2025
API Integration
NPM Package
@ai-sdk/xai
Environment Variables
XAI_API_KEY
Documentation