Grok API key setup
xAI's Grok models for frontier reasoning, vision, voice, and image/video generation through one API. Usage-based pricing, no minimums.
Get your key
- Open the Grok API keys page: console.x.ai/
- Create an account and generate an API key.
- Paste it into the Dracon BYOK provider keys, stored encrypted (AES-256-GCM), used browser-direct, works in every Dracon tool.
Use your key in every tab
Two free extensions take the key you just set up. Both read the page you are on and use your own provider key: free, no account, nothing stored on a server we run.
AI Auto Form Filler
Complete a web form from a short description, using a model you bring yourself.
All extensions · last checked 2026-10-22.
Get the key and test it
- Open the Grok API keys page: console.x.ai/ Create a key and copy the secret straight away.
- Point your client at this provider's base URL:
https://api.x.ai/v1It speaks the OpenAI-compatible shape, so an OpenAI SDK client works against it with no adapter: only the base URL and the key change. - Prove the endpoint answers before you trust it. Send one call
with no
Authorizationheader: a live endpoint answers401 Unauthorized, because it is waiting for a bearer key. The wording of that error differs by provider (some sayinvalid_api_key, othersincorrect_api_keyorToken is invalid), so read the 401 as the signal, not the error text. - Paste the key into the Dracon BYOK provider keys ; stored encrypted, used browser-direct, no relay.
- Compare other provider plans when this subscription does not match your usage or budget.
Test the key
Both examples read the key from the XAI_API_KEY environment
variable, so the key stays out of the command line.
export XAI_API_KEY="<YOUR_API_KEY>"
curl https://api.x.ai/v1/chat/completions \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"grok-4","messages":[{"role":"user","content":"hi"}]}' import os
from openai import OpenAI
# export XAI_API_KEY="<YOUR_API_KEY>" first
client = OpenAI(
api_key=os.environ["XAI_API_KEY"],
base_url="https://api.x.ai/v1",
)
resp = client.chat.completions.create(
model="grok-4",
messages=[{"role": "user", "content": "hi"}],
)
print(resp.choices[0].message.content)Free tier
No recurring free tier advertised as of the last check (2026-10-27). Usage is billed per the provider's listed pricing. You pay them directly, no Dracon markup.
Rate limits: Usage-based, no minimums; per-model rate limits apply (see xAI docs)
Paid plans compared
Every tier Grok publishes, with the price and the limit as the vendor states them, last checked 2026-10-27. Confirm with the provider before you buy. You pay them directly, no Dracon markup.
| Plan | Price | Usage limit | What you get |
|---|---|---|---|
| Free | no monthly fee | Free within generous limits; Real-time web + X search (Limited) |
|
| Plus | $8/mo | Plus plan per x.ai/pricing |
|
| Premium | $30/mo | Premium plan per x.ai/pricing |
|
| Super | $100/mo | Super plan per x.ai/pricing; AI usage billed separately for Cursor-style agents | not published |
| Ultra | $200/mo | Ultra plan per x.ai/pricing | not published |
| Teams | $30/mo | $30+/user/month; team plan | not published |
Official plan source: x.ai/pricing
Connection details
- Base URL
https://api.x.ai/v1- API shape
- OpenAI-compatible
- Env var
XAI_API_KEY- Models
- grok-4, grok-3, grok-3-mini
- Model lineup
- Grok 4.5, Grok 4.3, Grok 4.20 (reasoning), Grok 4.20 (non-reasoning), Grok 4.20 Multi-Agent
Our verdicts on this kind of provider
Independent comparisons we keep current as pricing and free tiers shift. A guide is setup; a verdict is whether it's worth setting up.