# xAI API — AI Compare Ninja

> xAI's developer API for Grok models (text, coding, image/video), billed usage-based per token.

## Overview
- **Category:** Development & Code (Agent & RAG frameworks)
- **Status:** Active · checked - Active.
- **Paid from:** $2 / $6 / Custom (xAI API)
- **Free access:** Free plan
- **Website:** https://x.ai/api
- **Canonical URL:** https://www.aicompare.ninja/en/tool/xai-api

## What it does
- Grok 4 and Grok 3 models with real-time web search
- Live search across X platform posts as a built-in feature
- Image understanding and generation via Aurora from Grok 3
- Streaming and function calling with an OpenAI-compatible API
- $5 credit per month in the free tier
- Dedicated high-throughput endpoints for enterprise

## In brief
xAI exposes Grok 4 and Grok 3 through an OpenAI-compatible REST API; Grok 4 Mini and Grok 3 Mini are smaller variants at lower prices. The API provides streaming, function calling, image understanding, and image generation via Aurora.

Billing is per token; a public pricing table at x.ai/api lists all current models. $5 credit per month is included in the free tier. Real-time web search and X platform search are directly integrated into model calls.


## Limits
Standalone token list, separate from consumer seats in Grok/xAI. Grok 4.7 matches Grok 4.6: $2 / $6 below 200k prompt tokens, $4 / $12 at 200k+, cached $0.50 / $1.00. Grok 4.7 Fast (2x token price) is only available in Cursor and Grok Build, not in the public API. Prices without currency conversion.

## Pricing tiers
| Tier | Price | Period | What you get |
| --- | --- | --- | --- |
| xAI API | $2 / $6 | Custom | API access to Grok 4.7, Grok 4.6, 4.3, and Grok Build (coding); Grok 4.7 matches 4.6: $2 / $6 below 200k, $4 / $12 at 200k+; cached $0.50 / $1.00. Fast variant is not on the public API. |

## Sources
All details regarding plans, limits, and features are based on official vendor documentation and the primary sources verified below.

- https://docs.x.ai/docs/pricing
- https://x.ai/api
- https://docs.x.ai/developers/pricing
- https://docs.x.ai/docs/models
- https://x.ai/news/grok-4-7

---
*Source: AI Compare Ninja (2026) - https://www.aicompare.ninja/en/tool/xai-api*
