Grok API logo

Grok API

Official SpaceXAI API for building apps with Grok models: text, image, video, voice, and tool calling, for developers.

Price from0.02 USD
Freenot stated
Platformsapi
Grok API - zrzut strony

What is Grok API?

The Grok API is the developer interface to SpaceXAI's Grok models. It exposes chat and reasoning text models (currently grok-4.7 with a 500k-token context), image and video generation and editing through the Imagine API, a Voice API covering speech-to-speech, text-to-speech and speech-to-text, plus files, collections for retrieval, and built-in tools such as function calling, web search, X search and code execution.

Developers authenticate with an API key and call endpoints over HTTPS at api.x.ai. The documentation provides quickstarts in cURL, Python, the OpenAI-compatible SDK and JavaScript, with example requests to the responses endpoint. Beyond basic calls, the docs cover streaming, structured outputs, batch processing, rate limits, prompt caching, regional endpoints and cost tracking, so teams can use it in production applications, agents and media pipelines.

Key features

  • Chat and reasoning text models with up to 500k-token context
  • Image generation and editing via the Imagine API
  • Video generation, image-to-video and video editing
  • Voice API with speech-to-speech, text-to-speech and speech-to-text
  • Function calling, web search, X search and code execution tools
  • Structured outputs, batch API, prompt caching and rate limits

Who is it for

  • Software developers
  • AI product teams
  • Companies building voice or media apps

Pros and cons

Pros
  • Broad coverage: text, image, video and voice from one API
  • OpenAI-compatible SDK option and quickstarts in several languages
Cons
  • Usage is billed per token, per image, per second or per character
  • Long-context and US regional endpoint requests cost more

Grok API pricing

PlanPriceIncludes
grok-4.72 USD / one-timeInput per 1M tokens, short context; cached input 0.50 USD; output 6 USD per 1M; long context (200k+) input 4 USD and output 12 USD per 1M
Voice API - STS0.08 USD / one-timePer minute
Voice API - TTS15 USD / one-timePer 1M characters
Voice API - STT batch0.10 USD / one-timePer hour
Voice API - STT streaming0.20 USD / one-timePer hour
Imagine image generation0.02 USD / one-timeStarting price per image at 1K/2K resolution

Prices copied from Grok API pricing, checked October 12, 2026. Currency as shown by the vendor; taxes may apply.

Grok API pricing details →

Is Grok API free?

The vendor does not state this clearly on the homepage or pricing page.

Grok API alternatives

ToolPrice fromFree planCategory
MiniMax logoMiniMax0.3 USD input / 1.2 USD output per M tokens?APIs & models
Replicate logoReplicate0.025 USDtrialAPIs & models
DeepAI logoDeepAI9.99 USD/moyesAPIs & models
Z.AI Developer Platform logoZ.AI Developer Platform0.015 USDtrialAPIs & models
fal logofal0.05 USD?APIs & models
OpenRouter logoOpenRouternot listedyesAPIs & models

All alternatives to Grok API →

FAQ

What is Grok API used for?

Official SpaceXAI API for building apps with Grok models: text, image, video, voice, and tool calling, for developers.

Is Grok API free?

The vendor does not state this clearly on the homepage or pricing page.

How much does Grok API cost?

The cheapest paid plan is 0.02 USD (vendor pricing, October 12, 2026).

What are the best Grok API alternatives?

Closest alternatives: MiniMax, Replicate, DeepAI, Z.AI Developer Platform, fal.

Data checked October 12, 2026 on the vendor website (docs.x.ai).