How to get a Grok API key
Updated:
GrokAPI Dev is an independent platform and is not affiliated with xAI. Through our OpenAI-compatible API, you can access Grok models with lower token rates, crypto payments, and a straightforward integration.
Why get Grok API access through our platform
Half the official price
We offer token rates 50% below the displayed official xAI reference rates.
Crypto payments
Top up your balance with USDT and pay for API usage without linking a bank card or purchasing a monthly plan.
Easy integration
Keep your OpenAI SDK or compatible tool. Replace the base URL and API key, then select a model.
Get Grok API access in three steps
Create an account
Register with an email address or Google account. After sign-up, open the dashboard; the test credit is added to the new account automatically.
Generate and save the API key
Create a new key in the dashboard and copy it when it is shown. Store it in an environment variable or secret manager, never directly in browser code or a public repository.
Connect the flagship Grok 4.6
Set the base URL to the GrokAPI endpoint and select grok-4.6. OpenAI-compatible SDKs and tools can keep their existing request format.
Test the Grok API key
Export the key, then send a request to the Responses API. A successful JSON response confirms that the key, endpoint, model, and balance are all usable.
export XAI_API_KEY="sk-lg-YOUR_API_KEY"
curl https://api.llm-gate.tech/v1/responses \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.6",
"input": "Say hello in one sentence"
}'Available model and pricing
Below are prices for Grok models per 1M text tokens. Claude and other popular models are also available; check the dashboard for the current catalog and rates.