Upcoming model deprecation — May 15, 2026. Several older models will be retired on May 15 at 12:00pm PT, including grok-4-1-fast, grok-4-fast, and grok-4. We recommend migrating to grok-4.3 for reasoning workloads and grok-4.20-non-reasoning for non-reasoning workloads. View the full migration guide for details and recommended replacements.
Get started with xAI
Build with intelligent, fast, and cost effective models across text, voice, images, and video.
Models
We offer a range of models supporting multiple use cases and modalities.
Grok 4.3
Excels at agentic reasoning, knowledge work, and tool use.
Context- tokens
Input- / 1M tokens
Output- / 1M tokens
Voice API
Real-time conversations, speech-to-text, and text-to-speech.
Agent$3.00 / hour
TTS$4.20 / 1M characters
STT
Imagine API
Turn ideas into reality with image and video generation.
ModesGeneration & editing
Image- / image
Video- / second
Jump straight in
Try text, voice, image, and video models below
import os
from xai_sdk import Client
from xai_sdk.chat import user, system
client = Client(
api_key=os.getenv("XAI_API_KEY"),
)
chat = client.chat.create(model="grok-4.3")
chat.append(system("You are Grok, a chatbot inspired by the Hitchhiker's Guide to the Galaxy."))
chat.append(user("What is the meaning of life, the universe, and everything?"))
response = chat.sample()
print(response)