How to Get a Grok API Key for Free
Updated 27 October 2026.
In short: xAI's Grok API is paid, but Grok 4.7 runs on Perplexity's Agent API, where some new accounts get a one-time $10 credit. A new xAI console account shows a credit balance of $0.00 and asks you to add credits before using the API. xAI's Grok subscriptions (Plus, Premium and Super) include Grok API usage from a shared pool, but they are paid plans.
The Grok API: credits first
On a new account at console.x.ai, checked on 27 October 2026, the dashboard says "Add credits to start using the API", with a credit balance of $0.00 (box 1). xAI's quickstart also says to load the account with credits first.

The console lists Grok 4.7 at $2 per 1M input tokens and $6 per 1M output tokens, with a 500K-token
context window. The base URL is https://api.x.ai/v1.
Where Grok is free
Perplexity's Agent API runs xai/grok-4.7, and some new Perplexity API accounts get a one-time $10
signup credit for 60 days, with no card. Grok 4.7 answered on that credit on 27 October 2026 for
$0.00167 per short reply: how to get a Perplexity API key for free
shows each step.
Grok subscriptions that include API use
xAI's plans page lists three subscriptions, Plus, Premium and Super, as one subscription across Grok, the Grok API, Cursor and X. Plus includes Grok Chat, Voice, Imagine and Build and the Grok API from a shared usage pool; Premium has 4 times the usage of Plus. None of the three is free, and the page shows prices in each visitor's local currency.
Free API keys for other models
For a free API key today, other companies' models are free on several services: how to get AI API keys for free lists each one with its daily limit, and free API keys by model groups them by model family.
Words to know
- API key: the password an app uses to call a model. See what is an API key.
- Credits: money paid into an xAI account in advance; API requests are charged from it.
- Grok: xAI's model family; Grok 4.7 is the newest.
- Groq: a different company, with a free API tier; see how to get a Groq API key for free.
- Token: a piece of a word; the unit models read and write. See tokens and context windows.
Frequently asked questions
Is the Grok API free?+
No. A new xAI console account shows a credit balance of $0.00 and asks to add credits before using the API.
How much does the Grok API cost?+
The xAI console lists Grok 4.7 at $2 per million input tokens and $6 per million output tokens, with a 500K-token context window.
Does a Grok subscription include the API?+
Yes. Grok Plus, Premium and Super include Grok API use from a shared usage pool across Grok, Cursor and X. All three are paid plans.
Is Grok the same as Groq?+
No. Grok is xAI's model family; Groq is a different company that runs open models and has a free API tier with 1,000 requests a day.
More free API key tutorials
- How to get a Gemini API key for free
- How to get a Groq API key for free
- How to get a Cloudflare Workers AI API key for free
- How to get a Cohere API key for free
- How to get an OpenRouter API key for free
- How to get an Experimental Labs API key for free (with the $1 verification)
- How to get a Requesty API key for free
- How to use Kilo Code free models (no API key)
- How to get an LLM7 API key for free
- How to use a free AI API without an API key
- How to get an Ollama API key for free
- How to get a Gonka AI API key for free
- How to get a Perplexity API key for free
- Where Qwen is free
- Where Mistral models are free
- Where DeepSeek models are free
- Where GLM models are free
- Where OpenAI models are free
- Every free AI API and its daily limit
By model: DeepSeek · OpenAI (GPT) · Claude · Perplexity · Mistral · Kimi · Qwen · GLM · MiniMax · Llama · Nemotron · Gemma · gpt-oss
Want to use these APIs in a desktop app? OpenCode is a free, open-source AI coding app for Windows, Mac and Linux. How to add free API keys to OpenCode and pick a model.