---
title: "xAI (Grok) API key"
description: "Add your xAI API key to score mentions with Grok: where to get the key, model options and costs, and troubleshooting."
source: https://backtalk.sh/docs/xai
---
# xAI (Grok) key

Bring your own [xAI](https://x.ai/) key to score and categorise mentions with **Grok**. Without an AI key, BackTalk uses a free offline word-list scorer; a Grok key upgrades every new signal to AI sentiment, categories, and priority.

## What it unlocks

- AI sentiment (positive / neutral / negative) instead of the offline lexicon.
- Category and priority tagging on each mention.
- A one-time background **re-score** of your existing mentions when you save the key.

You can save **a key per provider**. Left untouched, your first key powers filtering (sentiment, relevance, priority) and every saved key's model joins the AI share-of-voice comparison. Point either job at any saved key and model, including several models from one provider, under **What runs each task** in Settings.

## Get your API key

1. Sign in to the [xAI Console](https://console.x.ai).
2. Add a payment method or credits under **Billing** (API usage is separate from an X or Grok subscription). New accounts usually include free trial credits, so you can often start without adding funds.
3. Open **API Keys**, choose **Create API Key**, and copy it. The key starts with `xai-…` and is shown only once.

## Add it in BackTalk

1. Go to [**Settings**](/app/settings/ai) and find the **Grok (xAI)** card under AI providers.
2. Pick a model (see below) and paste your `xai-…` key.
3. **Save.** BackTalk sends one tiny test request to confirm the key and model, then stores the key encrypted and starts the background re-score.

## Models & cost

Billed by xAI directly at their token rates, with no markup from BackTalk. List prices (USD per million input / output tokens):

- **Grok 4.20 (non-reasoning)**: ~$1.25 / $2.50. No reasoning overhead; the right default for sentiment.
- **Grok 4.3**: ~$1.25 / $2.50. Newest flagship.

## Troubleshooting

- **"The provider rejected that API key."** Wrong or revoked key, or no credits on the xAI account. Recreate the key and add billing.
- **"That model isn't available on this key."** Pick Grok 4.20 (non-reasoning), which is the lightest option for scoring.
- **Key check failed.** Usually missing credits. Top up in the console, then retry.

> **Your key stays private.** It's encrypted at rest and only decrypted server-side when a scoring call runs. It is never returned to your browser and never logged. Settings shows only a masked hint.
>
> **Rotating your key:** create a new key in the xAI Console, paste it into Settings to replace the old one, then revoke the previous key.
