AI · Web app

xAI API

Developer API for Grok models covering text, multimodal, voice, and vision

Visit docs.x.ai ↗

xAI's developer platform provides API access to Grok models for text generation, reasoning, coding, and multimedia capabilities. It supports OpenAI-compatible SDK integrations, function calling, structured outputs, real-time voice, and image or video generation. Developers can use it to build AI-driven applications with large context windows and integrated live search tools.

What it's for

  • Integrate Grok into web or backend apps using OpenAI-compatible SDKs
  • Run structured data extraction and reasoning tasks with function calling
  • Generate images and videos via programmatic API prompts
  • Build real-time voice agents with speech-to-speech and text-to-speech endpoints

Features

  • Access to Grok text and reasoning models with up to 500k context
  • OpenAI SDK compatibility using custom base URLs
  • Built-in tool calling including web search and X search
  • Structured outputs and JSON schema enforcement
  • Imagine API for image and video generation and editing
  • Voice API supporting speech-to-speech, text-to-speech, and transcription
  • Batch API, async requests, and prompt caching

Pricing

Paid. Pay-as-you-go per token, image, or audio second (e.g. Grok 4.7 at $2/1M input, $6/1M output tokens)

Details

Type
Web app
Category
AI
Topic
Developer APIs
Open source
No
Platforms
API, Web
For
Software engineers and product builders integrating LLMs into software
Alternative to
OpenAI API, Anthropic Claude API, Google Gemini API
Tags
grok, xai, llm, api, ai models, multimodal

Why it was saved

  • @AlexFinn, 21 October 2024: Access to Grok-2 and Grok-2 mini models via API for building applications.

Related

Updated