Grok 4

JSON →
xai llm
text

The fourth-generation large language model from xAI with advanced reasoning capabilities.

context window 256K tokens
max output 256K tokens
input price $3 / 1M tokens
output price $15 / 1M tokens
streamingreasoningcode-generationfunction-callingtool-useprompt-caching
full doc /v1/models/grok-4