Run a non-Grok model like Claude or Gemini

models and endpoints

// what it does

Combine --model with a --base-url that serves it to drive a non-Grok model, for example grok --model claude-sonnet-4-20250514 --base-url https://your-endpoint/v1 or grok --model gemini-2.5-pro --base-url .... The key must belong to that endpoint.

// shell

$ grok --model gemini-2.5-pro --base-url https://your-endpoint.example.com/v1
$ grok --model claude-sonnet-4-20250514 --base-url https://your-endpoint.example.com/v1

// gotcha

Model ids are provider-specific — claude-* and gemini-* only resolve on endpoints that host them, not on api.x.ai. A mismatched model and base URL is the most common cause of a 404 model-not-found error.

// resources