# Grok API

## Grok (xAI) API Setup

Connect your xAI API key to use Grok models for content generation. Grok is Elon Musk's AI model, known for real-time information and a distinctive style.

***

### What is Grok?

Grok is developed by xAI and offers:

* **Real-time information** from X (Twitter)
* **Distinctive voice** — more casual and witty
* **Strong reasoning** capabilities
* **Cost-effective** pricing

***

### Available Models

| Model           | Best For        | Notes                 |
| --------------- | --------------- | --------------------- |
| **Grok-2**      | General content | Balanced quality/cost |
| **Grok-2-mini** | Bulk generation | Faster, cheaper       |

***

### Step 1: Create an xAI Account

1. Go to [x.ai/api](https://x.ai/api)
2. Click **API Platform** (top right)
3. Sign up or log in

***

### Step 2: Get Your API Key

1. In the xAI console, go to **API Keys**
2. Click **Create API Key**
3. Name it "Cuppa"
4. Copy the key

Your key looks like: `xai-xxxxxxxxxxxxxxxxxxxx`

***

### Step 3: Add Key to Cuppa

1. Go to **Team Settings** → **API Keys**
2. Find the **Grok** section
3. Paste your API key
4. Click **Save**

***

### Using Grok in Cuppa

Once connected, select Grok when generating:

1. Go to **Create Content** → **Single Generation** (or Bulk)
2. In the model dropdown, select **Grok-2** or **Grok-2-mini**
3. Generate as normal

***

### When to Use Grok

#### Good for:

* **Social media content** — matches X's tone
* **Trending topics** — has real-time X data
* **Casual content** — witty, engaging style
* **Budget bulk generation** — competitive pricing

#### Consider other models for:

* **Formal/professional content** — Claude is better
* **Technical documentation** — GPT excels here
* **Long-form guides** — Claude handles better

***

### Cost

Grok offers competitive pricing:

| Model       | Cost per 1M tokens |
| ----------- | ------------------ |
| Grok-2      | \~$2-5             |
| Grok-2-mini | \~$0.50-1          |

Typical article cost: **$0.01-0.10**

***

### Troubleshooting

#### "Invalid API key"

* Verify you copied the full key
* Check the key exists in xAI console
* Create a new key if needed

#### "Model not available"

* Ensure you have API access (may require waitlist)
* Check xAI status page for outages

#### "Rate limit exceeded"

* xAI has usage limits on new accounts
* Wait a few minutes and retry
* Check your usage in xAI console

***

### FAQ

**Do I need X (Twitter) Premium for Grok API?**

No. X Premium gives you access to Grok in the X app. The API is separate.

**Is Grok better than GPT or Claude?**

Each has strengths. Grok is great for casual content and real-time topics. Try it and compare!

**Does Grok have access to X posts?**

Yes, Grok can incorporate real-time information from X, which can be useful for trending topics.

**Can I use Grok for all my content?**

Yes, but we recommend keeping OpenAI connected for internal Cuppa features.

***

### Related Docs

* OpenAI API Setup — Required for all users
* Anthropic API Setup — Add Claude models
* Model Comparison — Compare all available models
