Which API should you use with Grok Build?

For Grok Build with more than Grok models, the best API is a cost-optimized custom model: add [model.standardcompute] to ~/.grok/config.toml with base_url https://api.stdcmpt.com/v1, api_backend = "chat_completions" and env_key = "STANDARDCOMPUTE_API_KEY", and Standard Compute's router sends each step to the cheapest model that can do it (Claude Fable 5.1 or GPT-6 Astra only when it counts), on a plan from $19 a month with a $20 compute budget. Signing in with an xAI account runs Grok's own models; The X Subscription's paid tiers ($8 to $200 a month) include a weekly pool for first-party Grok usage, and an XAI_API_KEY bills per token. Grok Build itself is open source (Apache 2.0).

Guide updated 2026-10-15. Check each provider's current terms below.
Get your API key$0.25 trial for eligible new accounts, no card. Plans from $19/mo.
Light or occasional use
If Grok models are all you want and your work fits the weekly pool, an X Subscription plan you already pay for is the simplest bill. For occasional headless runs, an xAI API key billed per token will likely cost less.
Daily use, cost-optimized
When Grok Build runs long sessions with parallel subagents and you want Claude, GPT or open models next to Grok, a Standard Compute custom model sends each step to the cheapest model that can do it, and for every model we vet providers for price, uptime and speed, with automatic fallback. Opt-in Europe or US Compliance rules apply per key, team or company, and we don't train on your prompts or store them. The bill stays at the monthly plan price: requests stop with HTTP 402 when the compute budget is used, with nothing billed on top.

API and subscription options for Grok Build

OptionPriceWhat you get
The X Subscription (xAI)$0 / $8 / $30 / $100 / $200 per moGrok, Cursor and X in one plan. Paid tiers include a weekly pool for eligible first-party usage across Grok and Cursor surfaces (Premium 4x, Super 15x and Ultra 50x of Plus); usage beyond it is paid from prepaid credits. xAI does not list a separate Grok Build quota. Source: docs.x.ai
Standard Compute (us)From $19/moSmart routing sends each request to the cheapest model that can do it, or pin any model by its exact ID. Standard Compute starts at $19/month with a $20 monthly compute budget. Requests stop when that budget is exhausted until renewal or a plan change; there are no automatic overage charges. Requests are not slowed as the budget is used. It is a fixed bill with a finite allowance.
xAI APIPay-as-you-goGrok models billed per token with an XAI_API_KEY, which Grok Build uses when there is no browser login, as in CI and headless runs. Grok models only. Source: docs.x.ai
OpenRouterPay-as-you-goChoose models and providers through one API. Usage-based pricing can suit light or bursty work; estimate long agent sessions and review current fees and limits. Source: openrouter.ai

Prices and allowances can change. Grok Build's custom model fields, credential order and environment variables come from xAI's Grok Build overview, settings reference and enterprise docs; The X Subscription prices from xAI's pricing doc, all read on October 15, 2026. Grok Build: getting started · Grok Build: settings reference · The X Subscription pricing · Grok Build repo. Spot an error? Tell us.

Add Standard Compute as a Grok Build custom model

~/.grok/config.toml
[model.standardcompute]
model = "standardcompute"
base_url = "https://api.stdcmpt.com/v1"
name = "Standard Compute (routed)"
env_key = "STANDARDCOMPUTE_API_KEY"
api_backend = "chat_completions"
context_window = 200000

[model.sc-sonnet]
model = "anthropic/claude-sonnet-5.5"
base_url = "https://api.stdcmpt.com/v1"
name = "Claude Sonnet 5.5 (Standard Compute)"
env_key = "STANDARDCOMPUTE_API_KEY"
api_backend = "chat_completions"

[models]
default = "standardcompute"

Export STANDARDCOMPUTE_API_KEY, run grok inspect to check the config loaded, then start grok. Switch with /model sc-sonnet in the TUI or grok -m sc-sonnet. On Windows the file is %USERPROFILE%\.grok\config.toml.

Grok Build questions

Do I have to log out of my xAI account to use a custom model in Grok Build?
No, not when the model has its own key. Grok Build resolves credentials per model in this order: model.api_key, then model.env_key, then the active session token, then XAI_API_KEY. A [model.standardcompute] entry with env_key = "STANDARDCOMPUTE_API_KEY" therefore uses your Standard Compute key even while you are signed in, and Grok models keep using your xAI login.
Which api_backend should I use for a gateway in Grok Build?
The protocol the gateway serves. Custom models accept chat_completions, responses or messages (OpenAI-compatible or Anthropic Messages). Standard Compute serves Chat Completions and Responses at https://api.stdcmpt.com/v1; chat_completions is the safe default. GROK_MODELS_BASE_URL is a different mechanism: it points Grok Build's whole model list at {base}/models instead of adding one model.
Does Grok Build's web search work on a custom model?
The web_search tool runs on its own model, set with [models] web_search or GROK_WEB_SEARCH_MODEL, separate from your chat model. supports_backend_search marks whether an endpoint supports Grok-hosted server-side search tools; leave it off for a third-party endpoint such as Standard Compute.

Try one task before choosing a plan

  1. Check the API format and model configuration supported by your installed Grok Build version.
  2. Run a small task on a clean branch and review the result, elapsed time and compute used.
  3. Estimate your actual monthly workload before selecting a larger allowance.
Get your API keyGrok Build setup guide →Compare compute budgets →

Record your own results with the workload CSV and report template. These are blank templates, not published benchmark results.

Disclosure: this guide is maintained by Standard Compute, one of the options above. Choose based on task quality, supported features and total cost for your workload. Light usage may cost less on a usage-based API; sustained workloads need enough allowance on any subscription.

All flat-rate plans compared →The cheapest-tokens math →Plan compute for your team →