xAI

[PROVIDER]
id: xai
npm: @ai-sdk/xai
env: XAI_API_KEY

Models

Grok 4.20 (Non-Reasoning)

grok-4.20-0309-non-reasoning
in $1.25/M
out $2.50/M
cache read $0.20/M
ctx: 1,000,000 max out: 30,000 in: text, image, pdf out: text
reasoning tools vision structured temp open weights

Grok 4.20 (Reasoning)

grok-4.20-0309-reasoning
in $1.25/M
out $2.50/M
cache read $0.20/M
ctx: 1,000,000 max out: 30,000 in: text, image, pdf out: text
reasoning tools vision structured temp open weights

Grok 4.20 Multi-Agent

grok-4.20-multi-agent-0309
in $1.25/M
out $2.50/M
cache read $0.20/M
ctx: 1,000,000 max out: 30,000 in: text, image, pdf out: text
reasoning tools vision structured temp open weights

Grok 4.3

grok-4.3
in $1.25/M
out $2.50/M
cache read $0.20/M
ctx: 1,000,000 max out: 30,000 in: text, image, pdf out: text
reasoning tools vision structured temp open weights

Grok Build 0.1

grok-build-0.1
in $1.00/M
out $2.00/M
cache read $0.20/M
ctx: 256,000 max out: 256,000 in: text, image, pdf out: text
reasoning tools vision structured temp open weights

Grok Imagine Image

grok-imagine-image
in
out
ctx: 8,000 max out: 0 in: text, image, pdf out: image, pdf
reasoning tools vision structured temp open weights

Grok Imagine Image Quality

grok-imagine-image-quality
in
out
ctx: 8,000 max out: 0 in: text, image, pdf out: image, pdf
reasoning tools vision structured temp open weights

Grok Imagine Video

grok-imagine-video
in
out
ctx: 1,024 max out: 0 in: text, image, video, pdf out: video
reasoning tools vision structured temp open weights