Grok 4.7 (2026): Release Date, Pricing and API Code
Unicorn API Team · · 10 min read
Grok 4.7 is xAI’s current large language model for coding, agents and long-running knowledge work, and this guide covers what it is, when it shipped, what it costs per token, how it compares to Claude Opus 5.5, and how to call it from your own code in a few lines. If you only need the numbers: on Unicorn API it costs 160 credits per million input tokens and 480 credits per million output tokens, and it uses the same OpenAI-compatible request shape as every other chat model on the platform.
The rest of the article is for people who want to decide whether the model belongs in their stack: the trade-offs, a worked cost example, and the mistakes that make cheap models expensive.
What is Grok 4.7?
Grok 4.7 is a chat model from xAI, the company behind the Grok assistant. A large language model (LLM) is a neural network trained on large amounts of text that predicts the next piece of text, called a token, given everything before it. A token is roughly a word fragment; English averages a bit under one word per token. Chat models like this one take a list of messages and return a reply, and you pay for both the tokens you send and the tokens you get back.
xAI aimed this release at two kinds of work:
- Coding. Writing, editing and reviewing code, often inside an editor or a coding agent.
- Long-running agent work. An agent is a loop where the model plans a step, calls a tool (search, a shell, a database query), reads the result and decides what to do next. These loops can run for dozens of steps.
At launch xAI said the model improves long-running work and self-checking, meaning the model is better at reviewing its own intermediate output and catching mistakes before it hands back an answer. xAI also said it kept the base price and speed of its predecessor, Grok 4.6. That positioning matters: the model is not pitched as the most powerful model at any cost, but as strong, fast and cheap enough to run at high volume.
On Unicorn API the model id is grok-4-7, and you can open its page at Grok 4.7 to see the current price and try it.
Grok 4.7 release date and where you can use it
xAI released Grok 4.7 on September 21, 2026. At launch it was available in three places: inside Cursor, inside xAI’s Grok Build product, and through the xAI API. It sits in a fast-moving line of models: Grok 4 was followed by Grok 4.5 earlier in 2026, then Grok 4.6, then this release.
Unicorn API added the model on November 11, 2026. The practical difference is billing and integration, not the model itself:
- One key, many models. The same API key calls Grok, Claude, GPT, Gemini and DeepSeek models, plus image, video and audio models. You can create one at /keys.
- One bill in credits. Every model is priced in credits, so comparing a Grok request with a Claude request is a matter of comparing two numbers.
- Same request shape. Every chat model uses the OpenAI-compatible
/v1/chat/completionsendpoint, so switching models is a one-string change. - Agent tools. If you work in Cursor, Claude Code or another agent client, you can reach the same models through MCP; see /agents.
If you want to try it before writing any code, the browser playground at /studio/chat lets you send prompts to the model and compare its replies side by side with other models.

How much does Grok 4.7 cost?
Chat models charge separately for three kinds of tokens:
- Input tokens: everything you send, including the system prompt, chat history, tool definitions and any documents.
- Output tokens: everything the model writes back, including tool calls.
- Cached input tokens: input the provider has seen recently and can reuse, such as a long system prompt that repeats on every request. These are billed at a much lower rate.
Here is Grok 4.7 pricing on Unicorn API. Monthly plans give credits at $0.01 each (Starter $25, Creator $50, Studio $100, Pro $200 per month); top-up credits cost $0.015 each and never expire. Full details are on the pricing page.
| Token type | Credits per 1M tokens | Dollars on a monthly plan | Dollars with top-up credits |
|---|---|---|---|
| Input | 160 | $1.60 | $2.40 |
| Output | 480 | $4.80 | $7.20 |
| Cached input | 40 | $0.40 | $0.60 |
You are billed from the token usage the model reports for each request, so there is no rounding up to a minimum request size. For media models you can ask for the exact price before running a job with POST /v1/models/price; for chat, the cost depends on how much the model writes, so the usage numbers in each response are your source of truth.
A worked example
Take a typical coding-agent step: the model receives 50,000 input tokens (system prompt, repo context, the conversation so far) and writes 5,000 output tokens (a plan plus a patch).
- Input: 50,000 × 160 / 1,000,000 = 8 credits
- Output: 5,000 × 480 / 1,000,000 = 2.4 credits
- Total: 10.4 credits, about $0.10 on a monthly plan
Now suppose 40,000 of those input tokens are a stable prefix that gets cached. The input cost becomes 10,000 × 160 / 1M (1.6 credits) plus 40,000 × 40 / 1M (1.6 credits), so the step costs 5.6 credits instead of 10.4. Caching nearly halves the bill for this shape of request, which is why agent builders care about it so much.
Grok 4.7 vs Claude Opus 5.5 and other models
A lot of people search “grok 4.7 vs opus 5”. The Anthropic flagship available on Unicorn API today is Claude Opus 5.5, so that is the comparison below. Here is how the per-token prices line up against it and three other chat models on the platform.
| Model | Input (credits / 1M) | Output (credits / 1M) | Cached input (credits / 1M) | Example step cost* |
|---|---|---|---|---|
| DeepSeek V4.1 Flash | 24 | 95 | 0.5 | 1.7 credits |
| Gemini 3.8 Flash OpenAI | 45 | 225 | n/a | 3.4 credits |
| Grok 4.7 | 160 | 480 | 40 | 10.4 credits |
| Claude Opus 5.5 | 320 | 1600 | 32 | 24 credits |
| GPT 6 Astra | 560 | 2800 | 56 | 42 credits |
*Same example as above: 50,000 input tokens and 5,000 output tokens, no caching.
The headline: Claude Opus 5.5 costs twice as much per input token and about 3.3x as much per output token. GPT 6 Astra costs 3.5x as much per input token and about 5.8x as much per output token. At the other end, DeepSeek V4.1 Flash is roughly a sixth of the price of Grok 4.7 for the same request.
One detail flips part of that picture: cached input on Claude Opus 5.5 is 32 credits per million, slightly below Grok’s 40. If your workload is dominated by a huge, stable cached prefix with short outputs, the gap between the two narrows considerably. Most agent and coding workloads still produce enough output that the output price decides the bill.
Price is not the whole answer
Per-token price tells you what one attempt costs. It does not tell you what a finished task costs. The more useful number is cost per accepted task: total spend divided by the number of results you would actually ship.
A hypothetical to show why: if Grok 4.7 solves 7 of 10 tickets at 10.4 credits each, you spend 104 credits for 7 accepted results, about 14.9 credits each. If Opus 5.5 solves 9 of 10 at 24 credits each, you spend 240 credits for 9, about 26.7 credits each. Grok still wins here, but if retries also cost you engineer time to review failed patches, the calculation can tip the other way. These numbers are illustrative, not benchmarks; your own success rates are the only ones that matter.
How to choose
- High-volume agents and bulk coding work: Grok 4.7 is the natural default. It is built for that work and priced for it.
- The hardest, highest-stakes tasks: test Claude Opus 5.5 or GPT 6 Astra alongside it, and only pay the premium where it measurably raises acceptance.
- Simple, very high-volume calls (classification, extraction, short summaries): DeepSeek V4.1 Flash or Gemini 3.8 Flash will usually do the job for far less. Our Gemini 3.8 Flash guide covers that tier.
A common pattern is routing: send every request to a cheap model first, escalate to Grok 4.7 when the task needs real reasoning or code, and reserve a premium model for the few cases that fail twice. With one key and one request shape, routing is just an if statement around the model string. The full list is in the model catalog.

How to call Grok 4.7 with the API
Every chat model on Unicorn API uses the OpenAI-compatible endpoint POST https://api.unicornapi.net/v1/chat/completions. Set your key as an environment variable first:
export UNICORN_API_KEY="your-key-here"
curl
curl https://api.unicornapi.net/v1/chat/completions \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4-7",
"messages": [
{"role": "system", "content": "You are a careful senior Python reviewer."},
{"role": "user", "content": "Review this function and list any bugs:\n\ndef avg(xs):\n return sum(xs) / len(xs)"}
],
"max_tokens": 600,
"temperature": 0.2
}'
The reply follows the OpenAI format: the text is in choices[0].message.content, and usage holds the token counts you are billed for.
Python with tool calling
This example gives the model one tool, lets it decide to call it, runs the tool locally and sends the result back. It uses only the requests library.
import os, json, requests
URL = "https://api.unicornapi.net/v1/chat/completions"
HEADERS = {
"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
"Content-Type": "application/json",
}
tools = [{
"type": "function",
"function": {
"name": "get_open_issues",
"description": "Return open issue titles for a repository.",
"parameters": {
"type": "object",
"properties": {"repo": {"type": "string"}},
"required": ["repo"],
},
},
}]
def get_open_issues(repo):
# Replace with a real lookup
return ["Login fails on Safari", "Typo in README"]
messages = [{"role": "user", "content": "Which open issue in acme/web should I fix first, and why?"}]
def call(msgs):
body = {"model": "grok-4-7", "messages": msgs, "tools": tools, "max_tokens": 800}
r = requests.post(URL, headers=HEADERS, json=body, timeout=120)
r.raise_for_status()
return r.json()
resp = call(messages)
msg = resp["choices"][0]["message"]
if msg.get("tool_calls"):
messages.append(msg)
for tc in msg["tool_calls"]:
args = json.loads(tc["function"]["arguments"])
result = get_open_issues(**args)
messages.append({
"role": "tool",
"tool_call_id": tc["id"],
"content": json.dumps(result),
})
resp = call(messages)
print(resp["choices"][0]["message"]["content"])
print("usage:", resp["usage"])
JavaScript with streaming
Streaming sends the reply as it is generated, which matters for chat interfaces where people watch the text appear. Responses arrive as server-sent events, one JSON chunk per data: line.
const res = await fetch("https://api.unicornapi.net/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.UNICORN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "grok-4-7",
messages: [{ role: "user", content: "Explain database indexes in three short paragraphs." }],
max_tokens: 500,
stream: true,
}),
});
const reader = res.body.getReader();
const decoder = new TextDecoder();
let buffer = "";
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const lines = buffer.split("\n");
buffer = lines.pop();
for (const line of lines) {
if (!line.startsWith("data: ")) continue;
const data = line.slice(6).trim();
if (data === "[DONE]") continue;
const delta = JSON.parse(data).choices[0]?.delta?.content;
if (delta) process.stdout.write(delta);
}
}
Because the endpoint is OpenAI-compatible, you can also use the official OpenAI SDKs by setting the base URL to https://api.unicornapi.net/v1. Full reference is in the API docs.
Getting better results from Grok 4.7
The endpoint accepts these fields: model, messages, tools, tool_choice, stream, max_tokens, temperature, top_p, stop, response_format and reasoning_effort. A few of them do most of the work.
reasoning_effort
Reasoning models can spend extra tokens thinking before they answer. reasoning_effort controls how much. More effort usually helps on multi-step problems and costs more output tokens; less effort is faster and cheaper for routine requests. Check the docs for the accepted values, then test two levels on your own tasks rather than defaulting to the maximum.
Prompt caching
Put everything stable at the start of the message list: the system prompt, tool definitions, style guides, reference files. Put the changing parts (the user’s question, the latest tool result) at the end. That ordering lets the stable prefix be served from cache at 40 credits per million instead of 160, as the worked example showed.
response_format
When code consumes the output, request structured JSON with response_format instead of asking nicely in the prompt and parsing free text. It removes a whole class of parsing failures in agent loops.
max_tokens
Always set it. It caps the output, which is the expensive half of the bill, and it stops a confused agent from writing a novel. Set it generously enough that real answers are not cut off; a truncated patch costs a full retry.
Common mistakes with Grok 4.7
- Comparing models on per-token price alone. A cheap model that needs three attempts is not cheap. Measure cost per accepted task on 20 to 50 real examples before committing.
- Testing on toy prompts. “Write a haiku” tells you nothing about how a model handles your 40-file repository. Evaluate on the work you actually run.
- Resending the whole history every step without caching in mind. Agent loops grow their context each turn. If the stable parts move around, you pay full input price every time.
- Ignoring the usage field. Log
usagefrom every response. It is how you find the one prompt that quietly costs ten times more than the rest. - Hard-coding one model. Models change monthly. Keep the model id in config so moving between Grok 4.7, Claude Opus 5.5 or a Flash model is a deploy, not a rewrite.
- Treating self-checking as verification. Better self-review reduces errors; it does not replace tests. Run the code the model writes.
Should you use Grok 4.7?
If you run coding agents, internal tools that process a lot of text, or any workload where volume makes premium pricing hurt, Grok 4.7 is worth a serious trial. It was designed for long-running work, it is priced well below the top-tier models, and on Unicorn API it slots into existing OpenAI-style code by changing one string.
If your work is a small number of very hard problems where one wrong answer is costly, keep a premium model in the comparison and let your acceptance rate decide. And if your requests are simple, a Flash-tier model will save you most of the bill.
The fastest way to find out is to run the same prompts through several models: create a key at /keys, try Grok 4.7 next to Claude Opus 5.5 in the playground, then move the winner into code with the examples above.
Frequently asked questions
When was Grok 4.7 released?
xAI launched Grok 4.7 on September 21, 2026, with access through Cursor, Grok Build and xAI's own API. It became available on Unicorn API on November 11, 2026, under the model id grok-4-7, so you can call it with the same key and credit balance you use for every other chat, image, video and audio model on the platform.
How much does Grok 4.7 cost per million tokens?
On Unicorn API, Grok 4.7 costs 160 credits per million input tokens, 480 credits per million output tokens and 40 credits per million cached input tokens. On a monthly plan a credit is $0.01, so that is $1.60 input and $4.80 output per million. Top-up credits cost $0.015 each and never expire. You are billed from the token usage the model reports.
Is Grok 4.7 better than Claude Opus 5.5?
It depends on the task, and no single benchmark settles it. On price, Grok 4.7 is clearly cheaper: Claude Opus 5.5 costs twice as much per input token and about 3.3x as much per output token. The useful test is cost per accepted task: run both on 20 to 50 of your real tasks, count how many results you would ship, and divide total spend by that number.
Is Grok 4.7 good at coding?
xAI built and positioned Grok 4.7 for coding and long-running agent work, with improvements to self-checking, and it shipped inside coding tools such as Cursor at launch. Whether it is good enough for your codebase is something to test directly: give it real tickets with real tests, track how often the patches pass, and compare that pass rate and cost against a pricier model.
Can I use Grok 4.7 with the OpenAI SDK?
Yes. Unicorn API exposes Grok 4.7 through an OpenAI-compatible POST /v1/chat/completions endpoint. Point the OpenAI SDK or any compatible client at https://api.unicornapi.net/v1, use your Unicorn API key as the bearer token, and set model to grok-4-7. Messages, tools, streaming, response_format and max_tokens work in the usual shape.
Does Grok 4.7 support tool calling?
Yes. The Grok 4.7 endpoint on Unicorn API accepts tools and tool_choice fields in the OpenAI function-calling format. You describe each function with a name, description and JSON Schema parameters; the model returns a tool call, your code runs it, and you send the result back as a tool message so the model can continue.