Blog

Grok AI API Pricing (2026): Tokens, Video Costs and Code

Unicorn API Team · · 11 min read

Diagram of Grok AI API pricing showing token billing for chat and per-second billing for video feeding one credit meter

Grok AI API pricing has two parts that people often mix up: xAI’s per-token rates for the Grok chat models, and per-second rates for Grok Imagine video. This guide explains how each one is metered, why your Grok app subscription has nothing to do with your API bill, what Grok video costs in practice, and how to estimate a monthly budget before you write a line of production code.

The short version: chat is billed by how much text goes in and comes out, video is billed by how many seconds you render and at what resolution, and the cheapest bill is the one you check before you send the request.

How Grok AI API Pricing Works

Like every major model provider, xAI meters its API by usage instead of charging a flat fee. What gets counted depends on the type of model.

Chat models: tokens in, tokens out

A token is a small chunk of text, usually a fragment of a word. Your prompt, system instructions and any conversation history you send count as input tokens. Everything the model writes back counts as output tokens. Rates are quoted per million tokens, and output always costs several times more than input, because generating text is more expensive than reading it.

Three details matter more than the headline rate:

  • Cached input. If many requests start with the same long prefix (a system prompt, a policy document, a codebase summary), the provider can serve that prefix from a cache and bill it at a much lower rate. Structuring prompts so the stable part comes first is the easiest saving available.
  • Reasoning tokens. Reasoning models “think” before answering. On most reasoning models that hidden thinking is billed as output, so a short visible answer can still produce a large output count.
  • Context window. The context window is the maximum number of tokens a model can read at once. A large window is useful, but filling it on every call multiplies your input bill.

Why chat rates go stale so quickly

xAI releases new Grok versions often, and each version can arrive with different per-token rates, a different context window and different caching discounts. That is why pages about Grok AI API pricing disagree with each other: they are describing different snapshots captured on different days. Treat any per-token figure you read in an article, including comparison sites, as a starting point and confirm the live rate for the exact model ID on xAI’s console when you build your budget.

Media models: seconds and resolution

Grok Imagine, xAI’s video model family, is priced differently. You pay per second of output video, and the per-second rate depends on resolution. Prompt length barely matters. This is the part of Grok AI API pricing that is easy to pin down, and the part covered in detail below.

Grok Subscriptions vs the Grok API

The most common confusion behind searches for Grok AI API pricing is the difference between the Grok app and the Grok API. They are two products with two bills.

  • The Grok app and X subscriptions give a person access to Grok in a chat interface. There is a free tier with limits and several paid tiers with higher limits and extra features. You pay a flat monthly or yearly fee regardless of how much you use it.
  • The Grok API gives software access to Grok models. You authenticate with an API key, send HTTP requests and pay for exactly what you use. There is no monthly fee from xAI for the API itself.

Paying for a top-tier Grok subscription does not give you API credit, and buying API credit does not unlock features in the app. If you want to chat with Grok yourself, a subscription is the right tool. If you are building a product, a script or an agent that calls Grok, you need API access, and the subscription is irrelevant to your costs.

The same split applies elsewhere. ChatGPT Plus is not the OpenAI API, and a Claude subscription is not the Claude API. Developers comparing open ai api pricing or claude ai api pricing run into the same distinction.

Grok app subscription compared with metered Grok API billing
App subscriptions and API usage are billed separately: one does not pay for the other.

What Grok Imagine Video Costs per Second

On Unicorn API you can call two Grok video models with the same key and credit balance you use for everything else. Credits cost $0.01 each on a monthly plan and $0.015 each as a top-up.

  • Grok Imagine Video 1.5 is image-to-video only: you give it a start frame and it animates that frame for 1 to 15 seconds at 480p, 720p or 1080p. It has very low cost per second with strong motion quality, and it can be busy at peak times.
  • Grok Imagine Video 1.0 does text-to-video or image-to-video for 6 to 30 seconds at the same three resolutions and the same per-second rate.

Both models charge 2.4 credits per second at 480p, 4.5 credits per second at 720p and 8 credits per second at 1080p. Each clip’s total is rounded up to whole credits.

ResolutionCredits per second5 s clip10 s clip15 s clip15 s clip on a plan
480p2.4122436$0.36
720p4.523 (22.5 rounded up)4568 (67.5 rounded up)$0.68
1080p84080120$1.20

Version 1.0 extends to 30 seconds, so its longest clip is 72 credits at 480p, 135 at 720p and 240 at 1080p.

Choosing between 1.5 and 1.0

Pick 1.5 when you already have a start image and want clips under 15 seconds, especially very short ones: it is the only one of the two that goes below 6 seconds. Pick 1.0 when you want to start from text alone, or when you need clips longer than 15 seconds. Since the per-second rate is identical, the choice is about input type and duration, not price.

If you need audio baked into the clip or a 1440p output, LTX 2.5 Fast Image to Video produces MP4 video with synchronized stereo audio at 10.8, 15.6 or 22.8 credits per second for 720p, 1080p and 1440p. It costs more per second than Grok, so it earns its place only when you need those features.

How Grok Compares With OpenAI, Claude and Google API Pricing

Every major provider uses the same basic structure for chat: per-million-token rates, a higher output rate, a discount for cached input, and a consumer subscription that is billed separately. The differences are in the rates themselves, which change with each model release, and in how many separate accounts you need to manage.

That second point is where costs quietly add up. If your product uses Grok for video, an OpenAI model for images and a Gemini model for chat, going direct means three accounts, three API keys, three invoices and three sets of rate limits. Comparing open ai api pricing, google ai api pricing and Grok AI API pricing side by side is hard when each one uses its own units.

Unicorn API puts them in one unit. Here is what a selection of models costs, all in credits on one bill:

ModelMakerTypePrice on Unicorn API
Grok Imagine Video 1.5xAIImage-to-video, 1-15 s2.4 / 4.5 / 8 credits per second (480p / 720p / 1080p)
Grok Imagine Video 1.0xAIText or image to video, 6-30 s2.4 / 4.5 / 8 credits per second
GPT Image 1.5OpenAIImage3 / 4 / 22 credits per image (low / medium / high)
Nano Banana 2 LiteGoogleImage4 credits per image
Gemini 4 NeonGoogleChat, 1M context240 credits per 1M input tokens, 1,200 per 1M output, 12 per 1M cached input
LTX 2.5 Fast Image to VideoLightricksImage-to-video with audio10.8 / 15.6 / 22.8 credits per second (720p / 1080p / 1440p)

At the plan rate, Gemini 4 Neon works out to $2.40 per million input tokens and $12 per million output tokens, with cached input at $0.12 per million. That is the same token structure you will see on Grok, OpenAI and Claude price sheets, so it makes a useful yardstick. If you prefer the OpenAI chat completions format with streaming, tools and Google Search grounding, Gemini 4 Neon OpenAI has the same rates.

For image pricing in more depth, see our breakdown of GPT Image 2 API pricing. The full list of available models and their current rates is in the model catalog.

Bar chart of Grok Imagine video cost per second at 480p, 720p and 1080p
Grok Imagine video cost scales with resolution: 1080p costs about 3x as much per second as 480p.

Worked Example: Estimating a Monthly Bill

Abstract rates are hard to reason about, so here is a realistic budget. Say you run a small app that turns product photos into short social clips with a one-line caption. You expect 300 clips a month.

Per clip, at 720p

  1. Start frame: generate a clean product shot with Nano Banana 2 Lite. 4 credits.
  2. Video: animate it for 6 seconds at 720p with Grok Imagine Video 1.5. 6 x 4.5 = 27 credits.
  3. Caption: a Gemini 4 Neon call with about 1,500 input tokens and 300 output tokens.

Video and image: 31 credits per clip, so 9,300 credits for 300 clips.

Captions: 300 calls x 1,500 input tokens is 450,000 input tokens, which is 0.45 x 240 = 108 credits. 300 calls x 300 output tokens is 90,000 output tokens, which is 0.09 x 1,200 = 108 credits. Chat costs are debited from the usage the model reports, so this is an estimate, but it puts captions at roughly 216 credits a month.

Total: about 9,516 credits. The Studio plan ($100 a month) includes 10,000 credits, so this workload fits with a little headroom.

The same app at 480p

Drop the video to 480p and a 6-second clip costs 14.4 credits, rounded up to 15. Per clip that is 19 credits, or 5,700 for 300 clips. Add 216 for captions and you are at about 5,916 credits. The Creator plan ($50) covers 5,000; the remaining 916 as a top-up at $0.015 each costs about $13.74, so roughly $64 total. Or take the Studio plan and keep spare credits for experiments.

The lesson: in this workload, video resolution drives almost the entire bill. The chat side of Grok AI API pricing debates (which model has the cheapest tokens) matters far less than whether you render at 480p or 720p. Run the numbers for your own mix before arguing about token rates.

Code: Check the Price, Then Run a Grok Imagine Job

The safest habit is to ask for the exact price first. Unicorn API exposes POST /v1/models/price, which returns the cost of a request before you run it. Create a key at /keys and export it as UNICORN_API_KEY.

This Python script prices a 6-second 720p Grok Imagine Video 1.5 job, submits it, polls until it finishes and prints the video URL. Replace the image URL with your own start frame.

import os
import time
import requests

BASE = "https://api.unicornapi.net"
HEADERS = {
    "Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
    "Content-Type": "application/json",
}

body = {
    "model": "grok-imagine-video-1-5-preview",
    "input": {
        "prompt": "Slow push-in on the product, soft studio light, gentle reflections",
        "image": "https://example.com/start-frame.jpg",
        "duration": 6,
        "resolution": "720p",
        "aspect_ratio": "9:16",
    },
}

# 1. Check the price before spending anything
price = requests.post(f"{BASE}/v1/models/price", json=body, headers=HEADERS)
price.raise_for_status()
print("Price:", price.json())

# 2. Submit the job
resp = requests.post(f"{BASE}/v1/jobs", json=body, headers=HEADERS)
resp.raise_for_status()
job = resp.json()
job_id = job["id"]

# 3. Poll until it finishes
while True:
    r = requests.get(f"{BASE}/v1/jobs/{job_id}", headers=HEADERS)
    r.raise_for_status()
    job = r.json()
    if job["status"] == "succeeded":
        print("Video:", job["outputs"][0]["url"])
        break
    if job["status"] in ("failed", "canceled"):
        raise RuntimeError(f"Job ended with status {job['status']}: {job}")
    time.sleep(5)

For the caption step, the chat endpoint is OpenAI-compatible, so any OpenAI client works by changing the base URL. With curl:

curl https://api.unicornapi.net/v1/chat/completions \
  -H "Authorization: Bearer $UNICORN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-4-neon",
    "messages": [
      {"role": "system", "content": "Write one short, punchy social caption. No hashtags."},
      {"role": "user", "content": "Product: matte black insulated water bottle, keeps drinks cold for a day."}
    ],
    "max_tokens": 200
  }'

Setting max_tokens caps the output side of the bill on every call. The response includes the usage the model reports, which is what gets debited. Full request and response shapes are in the API documentation, and if you work from Cursor or Claude Code you can call the same models through the MCP integration. To try prompts before writing code, use the browser playground.

Mistakes That Inflate Your Grok API Bill

Most surprise bills come from a handful of habits, not from the rate card. Watch for these.

Iterating at final resolution

1080p costs about 3x as much per second as 480p. Test prompts and motion at 480p, then render only the keepers at 720p or 1080p. A 10-second test at 480p is 24 credits; the same test at 1080p is 80.

Ignoring rounding on very short clips

Each clip rounds up to whole credits. A 1-second 480p clip is 2.4 credits, billed as 3, which is a 25% overhead. A 5-second 480p clip is exactly 12 with no overhead. If you need many tiny clips, render fewer, longer ones and cut them yourself.

Using version 1.0 for short clips

Grok Imagine Video 1.0 starts at 6 seconds. If you only need 3 seconds, version 1.5 costs 7.2 credits (billed as 8) at 480p, against 14.4 (billed as 15) for the shortest 1.0 clip.

Resubmitting during peak times

Grok Imagine Video 1.5 can be busy at peak times. If a job is slow, keep polling the job you already have instead of submitting a duplicate. Duplicate submissions are the fastest way to double a video bill without noticing.

Paying for the wrong product

Upgrading your Grok app subscription does nothing for an API integration. Teams sometimes buy a higher tier expecting API access and then pay again for API usage.

Letting chat context grow unchecked

Every chat request resends the history you include. A long-running conversation that keeps all previous turns grows its input cost with every message. Trim history, summarise old turns, and put stable instructions first so cached input pricing can apply. Higher reasoning effort also produces more output tokens, so raise it only where answers actually improve.

Skipping the content rules

A rejected or moderated request still wastes time, and some uses carry legal risk regardless of cost. Grok’s image and video tools have drawn scrutiny over misuse; see our report on the Oregon and Virginia lawsuits. Build for clearly permitted uses and you avoid both problems.

Getting Started

The practical approach to Grok AI API pricing is simple: confirm chat token rates for the exact model you will call, work out your video seconds and resolution, and run a budget like the one above before committing. If you want Grok video alongside OpenAI and Google models without juggling accounts, Unicorn API gives you one key and one credit balance for all of them. Compare plans on the pricing page, create a key at /keys, and call /v1/models/price on your first request so the number on your bill is never a surprise.

Frequently asked questions

Does Grok AI cost money?

The Grok app has a free tier with limits and paid subscription plans for heavier use. The Grok API is separate: it is metered, so you pay for the tokens or video seconds you actually use, with no flat monthly fee from xAI. A consumer subscription does not include API usage, and API credit does not unlock app features. Decide which one you need before paying.

How much does the Google AI API cost?

Google bills its Gemini chat models per million tokens, with output costing more than input and cached input costing much less. On Unicorn API, Gemini 4 Neon costs 240 credits per million input tokens, 1,200 credits per million output tokens and 12 credits per million cached input tokens. At the plan rate of $0.01 per credit, that is $2.40 and $12 per million.

How much does the OpenAI API cost?

OpenAI bills chat models per million input and output tokens and image models per generated image, with the rate depending on the model and quality setting. On Unicorn API, GPT Image 1.5 costs 3 credits per image at low quality, 4 at medium and 22 at high. You can call POST /v1/models/price to see the exact cost of any request before running it.

Is the ChatGPT API cheaper than ChatGPT Plus?

It depends on volume. The API charges per token, so light or occasional use often costs less than a flat monthly subscription. Heavy daily use with long conversations can cost more through the API, because every message resends the conversation history as input tokens. The API also gives you programmatic access the subscription does not, so the choice is usually about what you are building.

Can I use Grok models through Unicorn API?

Yes, for video. Unicorn API offers Grok Imagine Video 1.5, which animates a start image for 1 to 15 seconds, and Grok Imagine Video 1.0, which does text-to-video or image-to-video for 6 to 30 seconds. Both cost 2.4 credits per second at 480p, 4.5 at 720p and 8 at 1080p, billed with the same key as every other model.

Why do Grok API prices change so often?

xAI ships new Grok versions frequently, and each release can come with new per-token rates, context limits and caching discounts. Older snapshots may keep their old price or be retired. That is why figures copied into blog posts go stale within months. Always confirm the live rate for the exact model ID you plan to call on the day you build your budget.