Get an API key from xAI (Grok)

Make the key in xAI's console, keep its spending inside the credits you bought, then paste it into Runner. Every step at xAI comes from xAI's own documentation.

Updated

The short version

  • Make the key on the API Keys page of the xAI console, in the team you want charged.
  • Buy credits on Billing, and leave the invoiced billing limit at $0, so spending stops at what you bought.
  • In Runner, an owner or admin pastes it under Settings, then LLM providers, and presses Connect.
  • Grok runs on a key you connect, whichever way your plan pays for AI.

Make an xAI account, and buy credits

xAI's developer console is at console.x.ai. Usage, billing and keys belong to a team there: you start in a Personal Team, named in the console's top bar, and the team pays for its keys from its credits.

  1. Sign up

    Sign up for an account at console.x.ai.

  2. Buy credits

    Open Billing, then API spend management, and buy credits by card or bank transfer. A bank transfer takes 2 to 3 business days to arrive.

Create the key in the team you want charged

Check the team in the console's top bar first. A key belongs to the team it's made in, and stays with that team even if the person who made it is removed.

  1. Open API Keys

    Open API Keys from the sidebar.

  2. Create the key

    Create an API key on that page.

  3. Copy it somewhere safe

    Treat it like a password or a card number, and keep it where only you can reach it.

Keep xAI's spending inside what you bought

Two billing settings decide how far spending can go at xAI: the invoiced billing limit, and auto top-up.

  1. Leave the invoiced billing limit at $0

    It starts at $0, on Billing, then API Credits. Left there, only the credits you bought are spent, and xAI rejects requests once they run out. Raising it turns on monthly invoiced billing, up to the limit you set.

  2. Cap auto top-up, if you turn it on

    Auto top-up buys credits when your balance drops below an amount you set. Choose the top-up amount, at least $5, and the most it may buy in a month.

The warning

The API spend management card warns you once you've used four fifths of the monthly limit you set.

Paste the key into Runner, under Settings, then LLM providers

The key belongs to your Runner organization, so every product in it can use the key, and only an owner or admin can connect one. Runner encrypts it before storing it and never shows it again.

A key you connect is used before credits, even on AI included.

  1. Open LLM providers

    In Runner, open Settings, then LLM providers, under What the AI uses.

  2. Find the xAI card

    If it's folded under More providers, open it. Paste the key into xAI API key.

  3. Press Connect

    Runner tells you straight away if xAI turns the key down.

On Runner's LLM providers page, paste the key into the xAI API key box and press Connect.

Keep the key secret

xAI asks you to treat API keys as sensitive information, like passwords or credit card details.

  • Don't share a key between teammates.
  • Keep it out of source code and public repositories.
  • xAI works with GitHub's secret scanning: if your key turns up in a leak, xAI disables it and emails you.
  • Paste it only into Runner's key box, never into a chat, an email or a support ticket.

Swap the key for a new one, or switch it off

xAI suggests rotating keys regularly. Make the new one before the old one goes.

  1. Make the new key

    On API Keys, create a new key in the same team.

  2. Swap it in Runner

    On the xAI card in LLM providers, press Disconnect, then Confirm disconnect, and paste the new key and Connect. Disconnecting stops your team using the old key at once.

  3. Disable or delete the old key

    In the API Keys table, click the three dots beside the old key, then Disable key to switch it off for now, or Delete key to remove it for good.

Grok runs on your key, whichever way you pay

Grok runs on a key you connect, whether your plan has AI included or not.

Every plan comes two ways, AI included or your own key, and you can change your choice later in Settings. The page on choosing puts the two side by side.

AI included or your own key: help me choose

Give your business a growth team.

Create your account and pick a plan. Your team is built once the plan is paid.

  • AI models and keys

    Get an API key from Anthropic (Claude)

    Claude API key from Anthropic, step by step: make a Claude Console account, buy credits, create the key, set a spend limit, and connect it to Runner.

    Updated

  • AI models and keys

    Get an API key from OpenAI

    OpenAI API key, step by step: sign in to the OpenAI Platform, add credits, create the key, set a hard spend limit, and connect it to Runner.

    Updated

  • AI models and keys

    Get an API key from Google (Gemini)

    Gemini API key from Google, step by step: create the key in Google AI Studio, set up billing, cap the month's spend, and connect it to Runner.

    Updated

Trademarks of their owners. No affiliation or endorsement.