Key Information

Pricing

View as Markdown

All prices are in USD. For per-model details, see the models page.

Chat API

Prices per 1M tokens
Model
Context
Input
Cached input
Output
grok-4.31M$1.25$0.20$2.50
grok-4.20-multi-agent-03092M$1.25$0.20$2.50
grok-4.20-0309-reasoning2M$1.25$0.20$2.50
grok-4.20-0309-non-reasoning2M$1.25$0.20$2.50
grok-4-1-fast-reasoning2M$0.20$0.05$0.50
grok-4-1-fast-non-reasoning2M$0.20$0.05$0.50

Imagine API

Image and video generation
Model
Cost
grok-imagine-image-quality$0.05 / image
grok-imagine-image-pro$0.07 / image
grok-imagine-image$0.02 / image
grok-imagine-video$0.05 / sec

Voice API

Realtime, TTS, and STT
Mode
Cost
Realtime$0.05 / min ($3.00 / hr)
Text to Speech$4.20 / 1M characters
Speech to Text$0.10 / hr (REST), $0.20 / hr (Streaming)

Tools Pricing

Requests which make use of xAI provided server-side tools are priced based on two components: token usage and server-side tool invocations. Since the agent autonomously decides how many tools to call, costs scale with query complexity.

Token Costs

All standard token types are billed at the rate for the model used in the request:

  • Input tokens: Your query and conversation history
  • Reasoning tokens: Agent's internal thinking and planning
  • Completion tokens: The final response
  • Image tokens: Visual content analysis (when applicable)
  • Cached prompt tokens: Prompt tokens that were served from cache rather than recomputed

Tool Invocation Costs

Web Search$5 / 1k calls

Search the internet and browse web pages

web_search
X Search$5 / 1k calls

Search X posts, user profiles, and threads

x_search
Code Execution$5 / 1k calls

Run Python code in a sandboxed environment

code_executioncode_interpreter
File Attachments$10 / 1k calls

Search through files attached to messages

attachment_search
Collections Search$2.50 / 1k calls

Query your uploaded document collections (RAG)

collections_searchfile_search

Analyze images found during Web Search and X Search*

view_image

Analyze videos found during X Search*

view_x_video
Remote MCP ToolsToken-based

Connect and use custom MCP tool servers

Tool name is set by each MCP server

All tool names work in the Responses API. In the gRPC API (Python xAI SDK), code_interpreter and file_search are not supported.

* Only applies to images and videos found by search tools — not to images passed directly in messages.

For the view image and view x video tools, you will not be charged for the tool invocation itself but will be charged for the image tokens used to process the image or video.

For Remote MCP tools, you will not be charged for the tool invocation but will be charged for any tokens used.

For more information on using Tools, please visit our guide on Tools.


Batch API Pricing

The Batch API lets you process large volumes of requests asynchronously at a fraction of the cost of standard pricing — effectively cutting your token costs in half. Batch requests are queued and processed in the background, with most completing within 24 hours.

Real-time APIBatch API
Token pricingStandard rates20%-50% off standard rates
Response timeImmediate (seconds)Typically within 24 hours
Rate limitsPer-minute limits applyRequests don't count towards rate limits

The batch discount applies to all token types — input tokens, output tokens, cached tokens, and reasoning tokens. To see batch pricing for a specific model, visit the model's detail page and toggle "Show batch API pricing".

The batch discount applies to text and language models only. Image and video generation are supported in the Batch API but are billed at standard rates. See Batch API documentation for full details.


Files and Collections Pricing

Files and collections stored on the xAI platform are billed based on the amount of storage used.

ResourceRate
File storage$0.025 / GiB / day
Collection storage$0.10 / GiB / day

Download Costs

Downloading data from files and collections is charged at a flat rate based on the amount of data transferred:

ResourceRate
File downloads$0.20 / GiB downloaded
Collection downloads$0.20 / GiB downloaded

You can view and manage your files and collections through the xAI console or the xAI API.


Usage Guidelines Violation Fee

When your request is deemed to be in violation of our usage guideline by our system, we will still charge for the generation of the request.

For violations that are caught before generation in the Responses API, we will charge a $0.05 usage guideline violation fee per request.


Billing and Availability

Your model access might vary depending on various factors such as geographical location, account limitations, etc.

For how the bills are charged, visit Manage Billing for more information.

For the most up-to-date information on your team's model availability, visit Models Page on xAI Console.


Last updated: May 9, 2026