Introduction
xAI is a Copy Studio provider — it drives AI ad-copy generation with the Grok model. It does not power image or video generation; for those you’ll use other providers (e.g. Gemini or OpenAI for images; Gemini/Veo, Runway, or fal.ai for video). This guide walks you through getting an xAI key, adding it in MagicAds, and the model it unlocks.How keys are stored
All AI provider keys live in the AI Settings screen and are stored encrypted in the database. There are no.env edits — keys are injected into the drivers at runtime. Users never supply their own key; every generation runs on the admin’s key.
A model only becomes available to users when both are true: the xAI API key is saved and the Grok model is enabled in the vendor modal.
Before you start
- Admin access to your MagicAds platform.
- An xAI account with billing/credits set up.
Part 1 — Get your xAI API key
Sign in to the xAI Console
Go to the xAI Console and sign in or create an account. On first sign-in you may be asked to create a team.
Add billing / credits
Open the Billing section and add a payment method or purchase credits. xAI charges you directly for usage — separate from your MagicAds platform credits.
Create an API key
Open the API Keys section and click Create API key. Give it a name (e.g. “MagicAds”) and create it.
Part 2 — Add the key in MagicAds
Paste the key
Paste your API key into the API key field. Leaving it blank keeps the existing key unchanged. If a Base URL is shown, you can leave it at its default.
Enable the model
Toggle on the Grok 4.3 copy model and set its credit cost (what a user is charged per generation).
There is no “test connection” button. To verify, enable the model and run a quick generation in the Copy Studio.
Part 3 — Supported xAI models
Copy Studio
| Model | Model ID | Tier | Default credits | Best for |
|---|---|---|---|---|
| Grok 4.3 | grok-4.3 | Premium | 2 | xAI’s flagship — its most intelligent and fastest Grok, with a 1M-token context. Strong for long or complex briefs. |
The credit cost shown is the seeded default. You can change it in the vendor modal. It’s what your platform charges users in credits — not xAI’s price.
Part 4 — Make xAI the default copy engine (optional)
In the global section of AI Settings you can set the default copy engine to xAI so Grok is pre-selected for users. You can also toggle the Copy Studio on/off and control free-tier access there.Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Grok doesn’t appear in Copy Studio | Key missing or model disabled | Add the key in the xAI vendor modal and enable Grok 4.3, then Save. |
| ”The payload is invalid.” on generate | Saved key can’t be decrypted (e.g. after an environment change) | Re-enter the xAI key in AI Settings and Save to refresh it. |
| xAI API errors / 401 | Invalid key or no billing/model access | Re-check the key, billing, and grok-4.3 access in the xAI Console. |
| Looking for xAI image/video | Not supported | xAI is copy-only here; use an image/video provider instead. |
Keys are stored encrypted and applied at runtime. No
.env changes or commands are needed after saving.
