Resource: How to Get Your Grok API Key | Stein Solutions
AI API Keys

How to Get Your Grok API Key

Create an xAI account and generate your Grok API key in about 3 minutes.

← All Resources

Before you start

The xAI Console is separate from the Grok chatbot built into X. You need a Console account specifically to use the API. Plan on about 3 minutes.

Step 1, Create an xAI account

Open xAI Console →

  1. Click Sign Up, or log in if you already have an account.
  2. Sign up with your X (Twitter) account, Google, or email.
  3. Complete email verification if prompted.

Step 2, Add billing

  1. Once logged in, navigate to Billing in the left sidebar or top menu.
  2. Click Add Payment Method and enter your credit card details.
  3. Add credits to your account. You can start small with $5 to $10.

xAI often provides free credits for new accounts. Check the billing page for any promotional balance before adding your own funds.

Step 3, Generate your API key

  1. In the sidebar, click API Keys.
  2. Click Create API Key.
  3. Give your key a descriptive name like "Workshop Key".
  4. Click Create to generate it.
  5. Your key will appear. It starts with xai-...

Important. Copy your API key immediately and save it somewhere safe. You won't be able to see it again after you leave this page. If you lose it, you'll need to create a new one.

Step 4, Store your key safely

Good places to save your API key:

Never share your API key publicly, commit it to code repositories, or paste it into untrusted websites. Anyone with your key can use your account and run up charges.

Verify it worked

To confirm your key is live, paste it into any tool that accepts a Grok API key, or test it directly in your xAI Console.

Grok's API is compatible with the OpenAI SDK format, so many tools that support "OpenAI-compatible" APIs will work with your Grok key. Just point the base URL to https://api.x.ai/v1.

You're building the tools. Now see where AI actually fits your business.

The free 5-minute AI Efficiency Audit scores your operations and hands you your first three moves, emailed the moment you finish. No call required.

Take the Free Audit →