أسعار Grok 4 API: التكاليف والحدود وكيفية البدء

Building an app or budgeting an agent? Start with the model you will actually run. The May 15, 2026 migration notice says the original Grok 4 ID now resolves to Grok 4.3 with low reasoning effort. A successful call to an old ID no longer proves that the original model served it.

API usage is metered separately from Grok’s consumer subscriptions. Grok subscription and access pricing covers the chat plans; those monthly fees are not token credits for a direct xAI integration.

Want to try a prompt before wiring it into an app? Try Grok 4.6 on GlobalGPT for a chat-based workflow. Use an xAI API key for your own integration and direct xAI billing. This article is published by GlobalGPT; product links use referral tracking.

Grok 4 API pricing: current rates and the retired original

The table below uses xAI list prices checked on September 8, 2026. Each amount is USD per one million tokens. Input, cached input and output are separate billable categories, so a single blended “price per million” hides the workload’s cost.

USD per 1M tokens · standard processing

grok-4.3

Original Grok 4 redirect target

السياق: 1,000,000 توكن

Prompt < 200K

المدخلات
$1.25
المدخلات المخزنة مؤقتًا
$0.20
Output / reasoning
$2.50

Prompt >= 200K

المدخلات
$2.50
المدخلات المخزنة مؤقتًا
$0.40
Output / reasoning
$5.00

grok-4.6

الرائد الحالي

السياق: 500,000 tokens

Prompt < 200K

المدخلات
$2.00
المدخلات المخزنة مؤقتًا
$0.50
Output / reasoning
$6.00

Prompt >= 200K

المدخلات
$4.00
المدخلات المخزنة مؤقتًا
$1.00
Output / reasoning
$12.00

grok-4.5

Earlier current-generation option

السياق: 500,000 tokens

Prompt < 200K

المدخلات
$2.00
المدخلات المخزنة مؤقتًا
$0.30
Output / reasoning
$6.00

Prompt >= 200K

المدخلات
$4.00
المدخلات المخزنة مؤقتًا
$0.60
Output / reasoning
$12.00

Once the prompt reaches 200K tokens, long-context rates apply to all tokens in that request, including output.

The other listed Grok 4-family IDs are grok-4.20-0309-reasoning, grok-4.20-0309-non-reasoning و grok-4.20-multi-agent-0309. Each has a 1M-token context window and the same listed short/long token rates as Grok 4.3. The matching unit price does not imply matching total token consumption, especially for multi-agent work.

For a coding-specific alternative, grok-build-0.1 has a 256K context window and short-context input/cache/output rates of $1.00/$0.20/$2.00, rising to $2.00/$0.40/$4.00 at the 200K prompt threshold. For broader behavior and use cases, see our Grok 4.6 review.

Official xAI documentation listing Grok 4.6, its model ID, 500K context and configurable reasoning.
Official xAI model catalog, captured September 7 and rechecked September 8, 2026. The $2/$6 headline is Grok 4.6 short-context input/output pricing; cache and long-context rates are listed above.

What happened to the original $3 / $15 price?

Older references, including our Grok 4 API integration guide, quote $3 per million input tokens and $15 per million output tokens for the original Grok 4. Treat that as a historical quote, not today’s bill for a retired ID. The old official model URL now leads to the general model catalog, so this is not a newly verified archival price sheet.

إن original Grok 4 announcement describes a 256,000-token context window. That historical capacity, and older Fast-model prices or thresholds, must not be copied into a budget for the replacement. The precise rule for grok-4-0709 is now Grok 4.3 with low reasoning effort, billed at Grok 4.3 rates.

Official retirement notice listing grok-4-0709 and its redirect to grok-4.3
xAI retirement notice, captured September 7, 2026; text rechecked September 8. The listed original Grok 4 ID redirects to Grok 4.3. The full notice separately identifies exceptions for coding and image models.

Grok 4 is a model generation, while Grok is also the name of a consumer product. Our explanation of what Grok 4 is provides that product background. For new code, explicitly select a supported model instead of relying on a retirement redirect or assuming a provider’s alias stays fixed.

How input, cached input and reasoning affect the bill

One request, three token charges

المدخلات غير المخزنة في ذاكرة التخزين المؤقت

(I – C) × input rate

I = all prompt tokens; C = cached prompt tokens.

المدخلات المخزنة مؤقتًا

C × cache rate

Cached tokens are part of input, not extra input.

Billable output

O × output rate

O includes reasoning when the endpoint reports it inside output.

Token estimate in USD = [(I – C) × input rate + C × cached-input rate + O × output rate] / 1,000,000. Then add applicable tool, storage or other charges. Select the long-context rates using the total prompt, including cached tokens, before doing the arithmetic.

Input includes the messages, instructions and conversation history sent to the model. Caching reuses an identical starting prefix across requests; it is automatic, and xAI recommends a conversation identifier to improve reuse. A similar-looking prompt does not guarantee a cache hit. The prompt-caching documentation explains the matching behavior.

In Chat Completions, read prompt_tokens_details.cached_tokens; in Responses, read input_tokens_details.cached_tokens. . cache usage and pricing reference bills reasoning tokens at the full completion rate. If the output total already includes reasoning, adding reasoning_tokens again would double-count it.

Grok 4.6 supports low, medium, high and xhigh reasoning effort; its documented default is high, and reasoning cannot be disabled. Grok 4.3 supports none, low, medium and high. That makes Grok 4.3 with none worth evaluating for strict extraction jobs, while Grok 4.6 may spend more tokens even when its visible answer is short. See the reasoning settings and Grok 4.3’s model entry above.

Tool calls, batch work and priority requests

Per the official tool price table, Web Search, X Search and Code Execution each cost $5 per 1,000 calls, or $0.005 per call, plus token consumption. A request can invoke tools more than once. Ten search calls add $0.05 before model tokens; enabling a tool does not tell you how many times it will be used.

File-attachment search costs $10 per 1,000 calls; Collections Search costs $2.50 per 1,000. Stored files and collections also have daily storage and download charges. Images and video use their own price units, so keep those out of a text-only token estimate. Our Grok image and video workflow tutorial covers that separate generation route.

إن واجهة برمجة التطبيقات المجمعة offers a 20% token discount for Grok 4.3 and the three listed Grok 4.20 variants. The discount covers input, cached input, output and reasoning tokens. Grok 4.6’s model page marks Batch API as not supported. Do not apply a blanket 50% discount or assume every listed model supports batch processing.

أولوية المعالجة costs 2x standard token rates, including cached and reasoning tokens, when the returned service_tier confirms priority. A fallback to the default tier uses standard rates. Priority applies to Chat Completions and Responses, not Batch API.

Three transparent API cost examples

These are list-price estimates, not observed invoices. All requests below use standard processing, text only, no tools, no storage, no retries and no taxes. “Output” includes any billable reasoning. The first two workloads assume prompts below 200K tokens.

Cost per request and per 10,000 requests

Grok 4.3 · no cache

$0.005 / request

2,000 input × $1.25 + 1,000 output × $2.50, divided by 1M. 10,000 requests = $50.

Grok 4.6 · no cache

$0.010 / request

2,000 input × $2 + 1,000 output × $6, divided by 1M. 10,000 requests = $100.

Grok 4.6 · 90% input cached

$0.0073 / request

200 uncached × $2 + 1,800 cached × $0.50 + 1,000 output × $6, divided by 1M. 10,000 requests = $73.

A high cache-hit rate helps most when input dominates the workload. In that Grok 4.6 example, caching saves $0.0027 per call, or 27% of the total, even though 90% of input tokens are cached. The output charge stays at $0.006. Judge savings against the entire request, not only the cached portion.

The 200K prompt threshold can change the whole request

One more input token crosses the price threshold

199,999 prompt tokens

$0.459998

Grok 4.6: (199,999 × $2 + 10,000 output × $6) / 1M. No cache.

200,000 prompt tokens

$0.920000

Grok 4.6: (200,000 × $4 + 10,000 output × $12) / 1M. No cache.

The main pricing table explicitly uses “Long context >= 200k tokens” and says all tokens use the higher rate once the prompt reaches the threshold. Some model-detail text says “exceed” 200K. For budgeting at exactly 200,000, use the explicit pricing-table boundary; do not assume the cheaper rate still applies.

For a monthly forecast, estimate request volume separately for each workload, context band, cache-hit pattern and reasoning setting. Add expected retries and tool invocations. Then compare that estimate with your own returned cost data after a small pilot. A cents-per-call figure is only useful when its assumptions match production.

Context, output, rate limits and spending limits are different

Four limits to check before scaling

نافذة السياق

Per request

Grok 4.3: 1M tokens. Grok 4.6: 500K. This is not a monthly allowance.

Output budget

Per response

Set a supported output cap. Context capacity does not guarantee that much visible output.

RPS / TPM

Throughput

Requests per second and tokens per minute. Both must stay within the team tier.

Spend controls

Money

Prepaid balance, auto top-up and invoiced billing limits control separate funding behavior.

The public rate-limit table lists Tier 0 at 37 requests per second and 10 million tokens per minute for Grok 4.3; Grok 4.6 is listed at 150 requests per second and 50 million tokens per minute. These are dated published tier entries, not a promise that every key has the same usable capacity. Your team’s Console is the authority for its current model access and limits.

Tiers are based on cumulative API spend since January 1, 2026: $0, $50, $250, $1,000 and $5,000 for Tiers 0 through 4. Requests are throttled per second using the per-minute request budget divided by 60, so you cannot spend a full minute’s allocation in one burst. Input, output, reasoning and cached tokens all count toward TPM, even when some cost less.

The checked Grok 4.3 and 4.6 model pages give context sizes without a separate hard maximum-output figure. The current Responses endpoint reference defines الحد الأقصى_للإخراج_توكينز as the combined output-and-reasoning budget: it defaults to 128,000 when unset and accepts a larger value for longer generations. That default is not a guarantee of 128,000 visible answer tokens or an unlimited context allowance. Set an explicit budget and inspect incomplete responses.

xAI billing documentation separates prepaid credits from monthly invoiced billing, which is disabled by default. Auto top-up can replenish prepaid credits and has its own thresholds and monthly allowance. An invoiced billing limit controls postpaid usage; it is not the same thing as a single all-inclusive cap on prepaid purchases, top-ups and requests.

For your first integration, start with limited prepaid funding and review any auto top-up setting deliberately. For everyday chat access without writing an integration, the separate how to use Grok guide covers the product workflow. A chat subscription and an API team have different controls.

Two real Grok 4.6 tasks: what the usage records reveal

We reused two completed tests from September 7, 2026, through the Broly aggregation API at https://anywhere.broly.ai/v1, using Chat Completions. Both requested and returned grok-4.6; the upstream model identity was not independently verified. These are Grok 4.6 gateway results, not original Grok 4 tests or a comparison across models.

Each task ran once with temperature=0, max_tokens=2048 و stream=false. No tools or explicit reasoning-effort setting were sent. The same system instruction was used for both requests:

Shared system instruction

Expense extraction

The task converted five synthetic expense notes into ordered JSON with integer cents, including a negative refund. The response preserved every requested field and produced the correct $209.00 net total.

Exact prompt: Expense extraction

Complete returned output: Expense extraction

{
  "currency": "USD",
  "items": [
    {
      "label": "train",
      "amount_cents": 4680
    },
    {
      "label": "hotel",
      "amount_cents": 12800
    },
    {
      "label": "dinner",
      "amount_cents": 2745
    },
    {
      "label": "refund",
      "amount_cents": -1250
    },
    {
      "label": "taxi",
      "amount_cents": 1925
    }
  ],
  "net_total_cents": 20900
}

Reported usage · Expense extraction

Input / cached

364 / 192

Cached tokens are included in the input count.

Completion / reasoning

991 / 857

Reasoning is reported inside completion details.

Wall-clock time

22.753 seconds

Includes network and gateway overhead; one run.

Constrained scheduling

The task selected indivisible jobs under an eight-hour budget with prerequisites. The response chose A, B, C and E, totaling eight hours and value 24. We independently enumerated all 64 subsets: 17 were feasible, and this was the unique optimal set.

Exact prompt: Constrained scheduling

Complete returned output: Constrained scheduling

{
  "selected": ["A", "B", "C", "E"],
  "order": ["A", "B", "C", "E"],
  "total_hours": 8,
  "total_value": 24
}

Reported usage · Constrained scheduling

Input / cached

428 / 192

Cached tokens are included in the input count.

Completion / reasoning

4267 / 4217

Reasoning is reported inside completion details.

Wall-clock time

61.980 seconds

Includes network and gateway overhead; one run.

The scheduling answer is shorter than the expense JSON, yet its reported completion total is 4,267 tokens, including 4,217 reasoning tokens. That is the budgeting lesson: visible answer length is a poor proxy for reasoning-model consumption. These two tasks are useful examples of usage shape, not a latency benchmark or a general quality ranking.

Gateway usage excerpt: constrained scheduling

{
  "prompt_tokens": 428,
  "completion_tokens": 4267,
  "total_tokens": 4695,
  "prompt_tokens_details": {
    "cached_tokens": 192
  },
  "completion_tokens_details": {
    "reasoning_tokens": 4217
  }
}

The gateway also returned zero-valued input_tokens و output_tokens fields, despite nonzero Chat Completions counters. For these records, we used prompt_tokens و completion_tokens. We did not treat the zero aliases as a free request or infer visible-token counts from other zero fields.

Applying official rates without calling it an invoice

If these gateway counts were billed using Grok 4.6’s current short-context xAI list prices, the extraction task would be [(364 – 192) × $2 + 192 × $0.50 + 991 × $6] / 1M = $0.006386. Scheduling would be [(428 – 192) × $2 + 192 × $0.50 + 4,267 × $6] / 1M = $0.026170. These are hypothetical xAI-rate estimates, not charges observed at Broly.

The scheduling response reported 4,267 completion tokens even though the request sent max_tokens=2048. The gateway’s cap semantics were not verified. This discrepancy does not establish how xAI’s own output cap works, and the requested cap cannot be treated as a proven spending ceiling for this gateway.

Direct xAI responses have a more useful billing signal: cost_in_usd_ticks. The official documentation defines one USD as 10,000,000,000 ticks and says the field includes that request’s token charges, discounts and server-side tool calls. The reused gateway responses do not contain that field. For a conversation, sum the per-request tick values rather than assuming each response contains a session total.

What independent API users noticed

On August 21, 2026, Hacker News user mediaman pointed out that Grok 4.6’s $0.50-per-million cached-input rate is 25% of its $2 uncached-input rate. Their concern was repeated cached reads in agentic work. The two Grok rates match the current official table; the commenter’s wider comparisons and speculation are personal assessments.

mediaman on Hacker News discussing Grok API cache pricing
mediaman on Grok 4.6 cache pricing, August 21, 2026. Personal cost assessment; comparisons and speculation are the commenter’s. Captured September 8, 2026.

Earlier, on November 9, 2025, XCSme described using Grok 4 Fast via API for data parsing and extraction, calling it cheap and fast. That is a historical report about a now-retired Fast model. It does not establish today’s price, speed or quality for Grok 4.3 or Grok 4.6.

XCSme on Hacker News discussing Grok API data extraction
XCSme on using Grok 4 Fast for extraction, November 9, 2025. Historical personal experience with a now-retired model. Captured September 8, 2026.

These two individual experiences suggest useful pilot questions: how much of your bill comes from cached context, and how much from reasoning and retries? They do not establish a developer consensus. If you are also comparing the resulting work, our Grok versus ChatGPT work, search and coding comparison addresses that separate decision.

How to get started with the official xAI API

إن official xAI quickstart uses the Responses API at https://api.x.ai/v1/responses. This is a different endpoint and account from the aggregation venue used in our September 7 tests.

  1. Create or sign in to your xAI Console account and select the correct team.
  2. Add API credits and review spending settings. Confirm the selected model is available to your team.
  3. Create an API key and supply it to your server process as XAI_API_KEY. Keep it out of browser code, source control, screenshots and logs.
  4. Send a small request using an explicit current model ID, then record the returned model, usage, service tier and request identifier.

The example below uses Node.js 18 or later and its built-in fetch, so no SDK installation is required. Set XAI_API_KEY in your process environment before running it. It uses the current official Responses request shape and low reasoning effort; the code was checked locally without sending another paid API request.

First official request · Node.js

Look for a completed status and inspect the usage object before scaling up. This example budgets 2,048 output-and-reasoning tokens through the official Responses field. A timeout is a client-side deadline, not proof that server-side work was cancelled or unbilled. The example does not retry automatically; the token cap is not an all-inclusive dollar cap on an application that also sends input or invokes tools.

For an OpenAI-compatible SDK, the base URL is https://api.x.ai/v1 and the credential is still your xAI API key. The Responses API uses input و reasoning: { effort: "low" }; Chat Completions uses الرسائل and its own parameter names. Copying a gateway request unchanged into a different endpoint can fail even when both accept JSON.

Common integration errors and cost controls

  • 401 غير مصرح به: check the Bearer header, key and process environment. A 403 can indicate team permissions or access restrictions. Repeating the same invalid request does not repair it.
  • 404 Not Found: inspect the exact endpoint and model ID. Distinguish an invalid ID from a documented retired ID that still resolves through a redirect.
  • 400 or 422: validate the request schema and supported settings. For example, the current reasoning documentation rejects presence/frequency penalties and stop settings for reasoning models.
  • 429 Too Many Requests: queue work, smooth bursts and use bounded exponential backoff with jitter. Track both RPS and TPM, and include retries in the workload budget.
  • Unexpected output or incomplete status: inspect the response, reasoning setting and applicable output cap. Validate machine-readable output before consuming it; a successful HTTP response is not a task-quality guarantee.

For cost control, choose the least expensive model and reasoning setting that passes your own task checks, keep stable instructions at the start for cache reuse, remove irrelevant history, monitor the 200K prompt boundary and limit agent tool loops. Use batch only when that model supports it and the work can wait. Treat priority as a separate purchasing choice.

Keep token estimates for planning and returned cost ticks for reconciliation. Store integer ticks when aggregating many requests, and compare request totals with Console usage and invoices. A missing cost field means “unknown,” not zero; a small visible reply does not prove a small bill.

For Grok 4 API pricing today, build your budget around the model that actually serves the request, the prompt’s price band and total billable output. Start with a small official request, inspect its usage and cost field, then scale the workload that passes your own checks. For prompt exploration in a chat workspace, open Grok 4.6 on GlobalGPT.

Grok 4 API pricing FAQ

How much does the Grok 4 API cost now?

As of September 8, 2026, the retired grok-4-0709 ID redirects to Grok 4.3. Below 200K prompt tokens, its USD-per-million rates are $1.25 input, $0.20 cached input and $2.50 output. Long-context rates double.

Is the original Grok 4 API still available?

The original grok-4-0709 model was retired from the xAI API on May 15, 2026. Its ID continues to resolve, but requests are served by Grok 4.3 with low reasoning effort and billed at the replacement rates.

How much is the Grok 4.6 API?

Grok 4.6 costs $2 input, $0.50 cached input and $6 output per million tokens below 200K prompt tokens. At 200K or more, the rates are $4, $1 and $12. Tool calls and other applicable charges are separate.

Are reasoning tokens charged?

Yes. xAI bills reasoning tokens at the completion rate. When reasoning is already included in the reported output or completion total, do not add it a second time in your estimate.

Does cached input count toward the 200K threshold?

Yes. Count the full prompt, including cached tokens. The official pricing table puts a prompt of 200K tokens or more in the long-context band, and the higher rates apply to all tokens in that request.

Is there a free Grok API allowance with a chat subscription?

Do not assume a chat subscription includes xAI API credits. The official API quickstart uses a separate Console account and credits. Any promotion must be verified for that API team; consumer free access is a different offer.

What are the Grok API rate limits?

Limits depend on the model and team tier. The checked Tier 0 table lists Grok 4.3 at 37 RPS and 10M TPM, and Grok 4.6 at 150 RPS and 50M TPM. Use your team Console to confirm the limits that apply to your key.

Can I use Grok 4.6 on GlobalGPT?

Yes. GlobalGPT has a verified Grok 4.6 chat entry. That is a separate platform workflow; it does not replace an xAI API key, direct API billing or the controls in your xAI Console.

How do I check the actual cost of an xAI request?

Read usage.cost_in_usd_ticks from the official response and divide by 10,000,000,000 for USD. The field covers that request, including token discounts and server-side tools. Sum requests to track a conversation.

شارك المنشور:

منشورات ذات صلة

شرح حقوق ملكية مقاطع الفيديو التي تم إنتاجها باستخدام الذكاء الاصطناعي: الميزانية المخصصة للمقاطع النهائية

شرح تفاصيل حقوق ملكية مقاطع الفيديو التي تم إنتاجها باستخدام الذكاء الاصطناعي، مع ذكر الأسعار الحالية وقواعد انتهاء الصلاحية وميزانية تفصيلية للمقاطع النهائية. قارن التكاليف الفعلية واختر خطتك قبل الدفع.

قراءة المزيد

تصميم الحركة باستخدام الذكاء الاصطناعي: دمج الفيديو المُنتج مع كود قابل للتعديل

أنشئ مسار عمل لتصميم الحركة باستخدام الذكاء الاصطناعي، مع لقطات مُولَّدة ونصوص قابلة للتعديل وتوقيت دقيق ورسومات خاصة بالعلامة التجارية. احصل على توجيهات عملية وقائمة مراجعة للإنتاج.

قراءة المزيد