Short answer
You can create a Grok API key through the xAI console, but the key itself does not make API calls free. xAI’s quickstart says to create an account and load it with credits to use the API. I found no generally available current free-credit offer in the official materials reviewed. xAI’s earlier $25-per-month public-beta credit offer was limited to the end of 2024, so don’t count on it as a current offer. (Sources: xAI Quickstart; xAI API Public Beta announcement.)
How to get a Grok API key
- Create or sign in to an account at the xAI console.
- Open the API Keys page and create a key. xAI’s quickstart and API reference identify this as the key-creation route.
- Load credits through the team’s billing area before making API calls. With prepaid billing, requests are rejected when the credit balance runs out. Monthly invoiced billing is disabled by default; xAI says to contact sales or use the billing page to request it. (Source: xAI Billing, Credits & Invoices.)
The quickstart confirms that an account and credits are needed to use the API, but it does not clearly establish whether payment is required before you can create a key. API billing is separate from Grok chatbot billing. (Sources: xAI Quickstart; xAI API Accounts FAQ.)
Treat the key like a password: store it in an environment variable or secret manager, not in source code or a public repository. (Source: xAI Console Security FAQ.)
Current Grok API pricing
The official model page lists grok-4.7 at $2 per million input tokens and $6 per million output tokens. It lists a 500,000-token context window and says higher-context pricing applies to requests exceeding 200,000 tokens; check the pricing details for those requests before estimating their cost. (Source: xAI grok-4.7 model page.)
Prices are in USD. Model names, availability, and rates can change, so verify the current official model page before deployment.
Example monthly budget
Suppose you make 1,000 requests a month, each averaging 2,000 input tokens and 500 output tokens. At the listed grok-4.7 rates, that is 2 million input tokens and 500,000 output tokens:
- Input: 2M × $2/M = $4
- Output: 0.5M × $6/M = $3
- Estimated total: $7/month
This estimate assumes those rates apply to the requests and excludes any additional feature charges. For your own estimate, calculate: (input tokens ÷ 1,000,000 × input rate) + (output tokens ÷ 1,000,000 × output rate). Actual input-token consumption can include tokens added to process a request. (Source: xAI Console Billing FAQ.)
Does a subscription or free Grok account make API calls free?
Keep Grok chatbot billing and xAI API billing separate. xAI’s account FAQ says API billing is managed in the xAI console, separately from chatbot billing. A chatbot subscription is not, by itself, confirmation of free API tokens or unlimited API calls. (Source: xAI API Accounts FAQ.)
The old $25-per-month API-credit announcement applied to xAI’s public beta through the end of 2024. Third-party sites make newer credit claims, but those claims conflict and are not confirmed by the official materials reviewed. Treat a credit as available only when its amount and terms appear in your account. (Source: xAI API Public Beta announcement.)
Is free access enough for production?
A credit balance, if one is granted to your account, is temporary funding—not evidence of lasting free service or sufficient production capacity. Before launch, check:
- Budget: Estimate input and output usage, account for any applicable feature charges, and set a spending limit. xAI’s billing console supports prepaid credits and auto top-up with a configurable monthly maximum. (Source: xAI Billing, Credits & Invoices.)
- Model access and throughput: Check your team’s model availability in the console. Rate limits vary by model and team tier; xAI says the tier depends on cumulative API spend and directs teams to the console’s Models page to view their current per-model limits. Compare those limits with your expected peak requests and tokens. (Source: xAI Rate Limits.)
- Data handling: xAI says API inputs and outputs are not used for training without explicit permission. By default, requests and responses are stored, encrypted, for 30 days for potential abuse or misuse audits. Zero Data Retention (ZDR) is available where offered and applies to the whole team; it disables features that rely on stored data, including the stateful Responses API, Files and Collections, and the Batch API. Review the current terms and feature trade-offs before sending sensitive production data. (Source: xAI Developer Security FAQ.)
Bottom line: You can create a key through the xAI console, but budget for metered API usage unless your account shows an applicable credit or allowance. Check current model prices, your team’s model access and rate limits, and the data terms before putting a workload into production.
