Back to models
Try in Agents
Model · xAI
Grok 4.20
xai/grok-4.20
xAI's latest flagship model with 2M context and agentic tool calling
reasoningvisioncachinglegacy
Specs
Context
2M
Max output
16K
Provider
xAI
Input
$1.25/ 1M tokens
Output
$2.50/ 1M tokens
Cache read
$0.200/ 1M tokens
Try it
Chat with Grok 4.20Terramind API
⌘+Enter to run
Code
import { streamText } from "ai";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
const terramind = createOpenAICompatible({
name: "terramind",
baseURL: "https://terramind.com/api/v1",
apiKey: process.env.TERRAMIND_API_KEY!,
});
const result = streamText({
model: terramind("grok-4.20"),
prompt: "Why is the sky blue?",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
Want to run this in your app? Grab an API key · Full chat reference
More by xAI
| Model | Context | In | Out | Capabilities |
|---|---|---|---|---|
| 1M | $0.200 | $0.500 | visioncaching | |
| 500K | $2.00 | $6.00 | reasoningvisioncaching | |
| 500K | $2.00 | $6.00 | reasoningvisioncaching | |
| 500K | $2.00 | $6.00 | reasoningvisioncaching | |
| 256K | $1.00 | $2.00 | reasoningvisioncaching | |
| 0 | $0 | $0 | editreference images |