Grok API

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

01
−50%

Half the official price

We offer token rates 50% below the displayed official xAI reference rates.

02

Crypto payments

Top up your balance with USDT and pay for API usage without linking a bank card or purchasing a monthly plan.

03

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

1

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.

2

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.

3

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.

Bash
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.

Available models
ModelContextInput / 1MOutput / 1M
grok-4.5500k$1.00 $2.00$3.00 $6.00
grok-4.6500k$1.00 $2.00$3.00 $6.00