Grok API key and pricing
The Grok API gives programmatic access to SpaceXSI’s Grok models. You can get a key in two ways: open an account on SpaceXSI’s developer console and add credit there, or use an API gateway such as apimodels.app, where one key calls Grok alongside Claude, GPT, Gemini, DeepSeek and the image, video and audio models on the site.
Below: the two ways to get a key, what Grok 4.7, 4.6 and 4.5 cost on each, which Grok models are available, and how Grok differs from Groq, a different company that people often mix up with it.
How to get a Grok API key
From SpaceXSI: create an account on the SpaceXSI developer console, add credit, then create an API key. Requests go to SpaceXSI’s own base URL, and the key only works for SpaceXSI models.
From apimodels.app: sign up, top up with Stripe, PayPal or Alipay, and create a key in the console. Point any OpenAI SDK at https://api.apimodels.app/v1 and set the model to grok-4.7, grok-4.6 or grok-4.5. The same key and balance work for every other model on the site.
Grok API price: SpaceXSI and apimodels.app
Per 1M tokens, checked on 1 December 2026 on docs.x.ai; SpaceXSI list prices are for prompts under 200K tokens unless the row says otherwise. On apimodels.app Grok 4.7 and Grok 4.6 are 25% below SpaceXSI on input, cached input and output in both tiers: once a prompt reaches 200K tokens, cached tokens included, the whole request bills at $3.00 / $0.75 / $9.00 against SpaceXSI’s $4.00 / $1.00 / $12.00. Grok 4.5 is about 36% below on input and 29% below on output, with cached input at the same $0.30. Billing is per actual token and failed calls are free.
| Model | SpaceXSI list (input / cached / output) | apimodels.app (input / cached / output) |
|---|---|---|
| grok-4.7, prompt under 200K | $2.00 / $0.50 / $6.00 | $1.50 / $0.375 / $4.50 |
| grok-4.7, prompt 200K+ (whole request) | $4.00 / $1.00 / $12.00 | $3.00 / $0.75 / $9.00 |
| grok-4.6, prompt under 200K | $2.00 / $0.50 / $6.00 | $1.50 / $0.375 / $4.50 |
| grok-4.6, prompt 200K+ (whole request) | $4.00 / $1.00 / $12.00 | $3.00 / $0.75 / $9.00 |
| grok-4.5 | $2.00 / $0.30 / $6.00 | $1.275 / $0.30 / $4.25 |
Which Grok models you can call
Language models: grok-4.7, grok-4.6 and grok-4.5, all with a 500K-token context on SpaceXSI. grok-4.7 is SpaceXSI’s newest Grok model, released on 21 September 2026 and recommended by SpaceXSI for code and chat; on apimodels.app it costs the same as grok-4.6.
The same key also covers SpaceXSI’s other APIs on the site: Grok Imagine for images and video, and Grok Voice 3.0 for real-time speech-to-speech. Each has its own page with prices and limits, linked below.
Over the last 30 days of external traffic, grok-4.6 served 1,579 calls with 17 failures, one of them a content-moderation refusal, and grok-4.5 served 315 calls with 8 failures, four of them moderation refusals. Not every call succeeds; failed ones are not charged.
Grok and Groq are not the same thing
Grok is SpaceXSI’s family of models. Groq is a separate company that runs other providers’ open models on its own inference chips. A Groq API key does not call Grok, and a Grok key does not call Groq. apimodels.app offers Grok; it does not offer Groq.
Inicio rápido
cURL
curl https://api.apimodels.app/v1/chat/completions \
-H "Authorization: Bearer $APIMODELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.7",
"messages": [{"role": "user", "content": "Summarise the main argument of this paragraph in one line."}]
}'Python
from openai import OpenAI
client = OpenAI(api_key="YOUR_APIMODELS_KEY", base_url="https://api.apimodels.app/v1")
r = client.chat.completions.create(
model="grok-4.7",
messages=[{"role": "user", "content": "Give me three names for a coffee shop."}],
)
print(r.choices[0].message.content)Preguntas frecuentes
How do I get a Grok API key?
Either create an account on SpaceXSI’s developer console, add credit and generate a key there, or sign up on apimodels.app, top up and create a key in the console. The apimodels.app key calls Grok through the OpenAI-compatible base URL https://api.apimodels.app/v1 and also works for the other models on the site.
How much does the Grok API cost?
SpaceXSI lists Grok 4.7, 4.6 and 4.5 at $2 input and $6 output per 1M tokens for prompts under 200K tokens. On apimodels.app Grok 4.7 and Grok 4.6 are $1.50 / $4.50 with cached input at $0.375 in that range, 25% below SpaceXSI; from 200K prompt tokens, cached tokens included, the whole request is $3.00 / $9.00 with cached input at $0.75, against SpaceXSI’s $4.00 / $12.00 / $1.00. Grok 4.5 is $1.275 / $4.25 with cached input at $0.30. Billing is per token and failed calls are free.
Is Grok the same as Groq?
No. Grok is SpaceXSI’s model family; Groq is a different company that serves other models on its own chips. Their API keys are not interchangeable. apimodels.app provides Grok and does not provide Groq.
Can I use the Grok API from mainland China?
apimodels.app is served through Cloudflare, and most networks in mainland China can reach it directly; test with a small top-up first. Payment by Alipay is supported.
Is Grok 4.7 available?
Yes. grok-4.7, SpaceXSI’s newest Grok model, is on apimodels.app at $1.50 input / $4.50 output per 1M tokens with cached input at $0.375 for prompts under 200K tokens, 25% below SpaceXSI’s $2.00 / $6.00 / $0.50 (checked 1 December 2026); from 200K tokens the whole request is $3.00 / $9.00 / $0.75 against $4.00 / $12.00 / $1.00. grok-4.6 costs the same in both tiers and grok-4.5 is $1.275 / $4.25; all three use the same key and endpoint, so switching is a change to the model field.
