Listed by DevHunt
xAI API

xAI API

Grok models by API

SubscriptionAPIAI0 impressions

Get an API key at console.x.ai and build with Grok. grok-4.7 from $2/M tokens, plus image, video, and voice APIs. Try Grok free in the Playground.

xAI API alternatives →More API tools →74 free dev tools →

xAI API provides a unified API for text, code, image, video, and voice generation using Grok models.

for
Developers building AI-powered apps, agents, and media generation features.
pricing
paid
works withcURL

Key features

6 features of xAI API
  • Text & Code Generation — Generate text and code with Grok models via a standard chat completions endpoint.
  • Image & Video Generation — Create and edit images and videos using the Imagine API with per-image or per-second pricing.
  • Voice Capabilities — Realtime speech-to-speech, text-to-speech, and speech-to-text via the Voice API.
  • Live Web & X Search — Integrate real-time web and X (Twitter) search results into responses.
  • File & Collection RAG — Upload documents and query them with built-in file and collection search tools.
  • Enterprise Controls — SSO, audit logging, SOC 2, HIPAA, data residency, custom rate limits, and dedicated support.

Use cases

  • Add AI chat and coding assistance to a SaaS product
  • Generate marketing images, videos, or voiceovers on demand
  • Build real-time voice agents for customer support
  • Enable live web search results in an AI assistant
  • Perform RAG over uploaded PDFs, spreadsheets, or presentations

xAI API vs alternatives

xAI APIOpenRouterOpenAI APIClaude APIGemini API
Best forUnified generative AI APIOne-stop shop for multiple providersOpenAI model ecosystemAnthropic’s Claude modelsGoogle Gemini models
PricingPaidSubscriptionSubscriptionSubscriptionSubscription
DevHunt upvotes00000
Launched—————
  • xAI API vs OpenRouter: Offers a single endpoint that aggregates many AI models, but xAI provides its own Grok models and media APIs.
  • xAI API vs OpenAI API: OpenAI API provides GPT models and separate endpoints for images and audio, while xAI bundles text, image, video, and voice under one API.
  • xAI API vs Claude API: Claude API focuses on Anthropic’s models; xAI includes its own Grok models plus media generation and enterprise controls.
  • xAI API vs Gemini API: Gemini API offers Google’s models; xAI provides Grok models with longer context windows and integrated media generation.

xAI API FAQ

How do I get an API key?+

Create a free account at console.x.ai, open the API Keys page, and generate a key; it takes about a minute.

Is there a free tier?+

API usage is billed per token, but the Playground is free with every Console account for testing.

What does Grok-4.7 cost?+

$2 per M input tokens and $6 per M output tokens (US endpoint adds a 1.1× premium).

Can I use existing OpenAI or Anthropic SDKs?+

Yes—point the SDK to https://api.x.ai/v1 with your xAI API key; no other changes are needed.

What media generation models are available?+

Imagine API offers image models (e.g., grok-imagine-image-2.0) and video models (e.g., grok-imagine-video-1.5) with per-image or per-second rates.

Summarized by DevHunt from x.ai, docs.x.ai · Nov 7, 2026. Details may change; check the official site.

About this listing

DevHunt lists xAI API because developers expect to find it next to the tools in its category. It did not launch on DevHunt. Work on xAI API? Message us to claim this listing.