Guides · ai · Popular APIs

xAI Grok API

Account at console.x.ai, a team, prepaid credits, then an API key with model and endpoint ACLs. Keys can also be created through the Management API.

Researched · not yet run liveLast researched 25 October 2026 · xAI · provider site

Researched, not yet run live. Built from the provider’s official pages (linked below). A person hasn’t walked this flow end to end yet, so check each step against the source.

Who owns what

An xAI console account belongs to one or more teams; credits, billing and API keys belong to a team.

  • xAI console account personal owned by the person
  • Team organisation owned by the company · under xAI console accountA default team is referenced in console URLs (team/default). Billing changes apply to every user on the team. Admins see all team keys; members see only their own.

Several official pages now brand the platform "SpaceXSI API"; the console and docs remain at console.x.ai and docs.x.ai.

Have ready

  • An account to sign up at console.x.ai
  • Card for prepaid credits (card saved at first purchase) · With the default $0 invoiced limit, requests are rejected without prepaid credits [2]Needed for: Buy prepaid credits

Steps

Steps marked “human step” are ones only you can do: verapli never signs in, submits, pays or accepts terms for you.

  1. Sign up at console.x.ai

    You create the account yourself.

    • Guided by hand
    • Human step: You sign in

    Where: https://console.x.ai/login?mode=sign-up

  2. Accept xAI's terms

    API use is governed by the Enterprise Terms of Service and the Acceptable Use Policy. You accept them yourself. [to verify where acceptance happens]

    • Guided by hand
    • Human step: You accept the terms
    • After: Sign up at console.x.ai
  3. Choose the team

    Make sure you are in the intended team before billing or creating keys; credits and billing changes apply to the whole team. The team ID is on the team settings page.

    • Guided by hand
    • After: Sign up at console.x.ai

    Where: https://console.x.ai/team/default/settings/team

  4. Buy prepaid credits

    Under Billing > API spend management buy credits (card processes immediately, bank transfer 2-3 business days); optionally set auto top-up and a monthly cap. verapli never touches payment details.

    • Guided by hand
    • Human step: You add payment details
    • After: Accept xAI's terms, Choose the team
    The provider says
    Card payments process immediately; bank transfers take 2-3 business days. [2]
    If something goes wrong (1)
    • API requests are rejected: Prepaid credits ran out (invoiced limit defaults to $0); buy credits or enable auto top-up. [2]
  5. Create an API key

    On the API Keys page create a key and grant ACLs (e.g. api-key:model:* and api-key:endpoint:*); a key with no permissions fails every request. The full key is not shown again; verapli writes it to your env file.

    • verapli co-pilot
    • Human step: You press submit
    • After: Buy prepaid credits

    verapli captures XAI_API_KEY here by plain code: encrypted in your browser, never shown to AI.

    Where: https://console.x.ai/team/default/api-keys

  6. Create a management key (optional, for API provisioning)optional

    In Settings > Management Keys create a management key, separate from inference keys, to create, list and rotate team API keys via management-api.x.ai.

    • Guided by hand
    • Human step: You press submit
    • After: Choose the team

    verapli captures XAI_MANAGEMENT_API_KEY here by plain code: encrypted in your browser, never shown to AI.

Terms and gotchas

Plain-English summary, not legal advice. Each card links its source.

Can cost moneyThe rules say

Acceptable Use Policy applies to developers and their users

The Enterprise Terms require compliance with the AUP and passing equivalent obligations to your own users. The AUP prohibits illegal or abusive uses, reverse engineering, and high-stakes automated decisions about people; violations can lead to suspension or termination. [to verify - pages returned 403 to fetch; based on search summary of official pages] [7]

Can cost moneyThe rules say

No training models on outputs; no competing services

The Enterprise Terms bar using outputs to train foundation models unless an Order Form allows it, and the Enterprise FAQ says using the API to build a similar or competing service is prohibited. [to verify] [8]

Worth knowingThe rules say

Prepaid credits are non-refundable

xAI does not refund prepaid credit purchases unless required by law in your region. [3]

What you end up with

Env varSecretFormatWhat it is
XAI_API_KEYsecretxai-… [to verify]xAI inference API key for the team
XAI_MANAGEMENT_API_KEYsecret[to verify: format not documented]…Management API key for key, team and billing management

Pricing

  • Free tier: No free credits found in the docs. [to verify]
  • Costs: Prepaid credits. grok-4.7 is $2.00 per 1M input and $6.00 per 1M output tokens under 200k prompt tokens ($4.00 / $12.00 at or above 200k, applied to the whole request); grok-4.3 and grok-4.20 variants $1.25 / $2.50.
  • Auto top-up minimum is $5. Monthly invoiced billing is off by default and requested via sales@x.ai. Tool (web/X search) pricing not listed on the models page. [to verify]

Source [4]

For agents

The same entry as JSON: /api/v1/entries/xai/grok-api · requirements /api/v1/requirements/xai/grok-api · terms /api/v1/terms/xai/grok-api.

Remote MCP (read-only, no auth)
claude mcp add --transport http verapli https://verapli.com/mcp

> "What do I need for xAI Grok API, and how long will it take?"
  → tools/call requirements { "provider_id": "xai/grok-api" }

Sources

  1. Getting started (quickstart) Sign up at console.x.ai, load credits, create key on the API Keys page, XAI_API_KEY env var, example model grok-4.7; docs refer to the platform as SpaceXSI API · accessed 25 October 2026 · official
  2. Billing, Credits & Invoices Add payment information; buy prepaid credits under API spend management; auto top-up ($5 minimum, monthly cap); $0 invoiced limit by default, requests rejected when credits run out; invoiced billing via sales; billing changes apply to the whole team · accessed 25 October 2026 · official
  3. FAQ - API Billing No refunds on prepaid credits unless required by law; credits assigned to the team chosen at purchase · accessed 25 October 2026 · official
  4. Models and pricing Per-1M-token prices for Grok models, long-context pricing at 200k prompt tokens · accessed 25 October 2026 · official
  5. Using Management API Management key from Settings > Management Keys, separate from API key; POST /auth/teams/{teamId}/api-keys with name, acls, qps, qpm, tpm · accessed 25 October 2026 · official
  6. Accounts and Authorization (Management API reference) List and rotate key endpoints; team ID location; ACL format and wildcards; full key not exposed after creation · accessed 25 October 2026 · official
  7. xAI Acceptable Use Policy AUP applies to developers; prohibits illegal or abusive uses, reverse engineering, high-stakes automated decisions; suspension or termination (from search summary; page returned 403 to fetch) · accessed 25 October 2026 · official
  8. xAI Terms of Service - Enterprise Customer must comply with the AUP and flow it down; no training foundation models on outputs without an Order Form; ZDR for personal data (from search summary; page returned 403 to fetch) · accessed 25 October 2026 · official
  9. xAI Enterprise FAQs Inputs and outputs deleted within 30 days unless flagged; competing services prohibited (from search summary) · accessed 25 October 2026 · official

Provider rules change. This page is generated from verapli registry version 2026.1025.387; spotted something out of date? Tell us. xAI is not affiliated with verapli.