one-api.ai

Grok 4.7 API pricing

As of 2026-10-31, Grok 4.7 API costs $2.421 per 1M input and $7.263 per 1M output tokens on one-api.ai (source: Cloudflare model page list price, checked 2026-10-22, plus our posted margin).

Information only: Grok 4.7 is not part of one-api.ai early access, and access to it is not sold today. The rates are published for comparison. What early access covers →

Grok 4.7 is xAI's flagship model, which xAI recommends for both code and chat. Model id: xai/grok-4.7.

Price comparison

Cloudflare's list price is what the provider charges through Cloudflare; one-api.ai is what a call debits here. xAI models and pricing lists $2.00 input, $0.50 cached input and $6.00 output per 1M tokens for the standard tier.

Under 200k input tokens, per 1M

PriceInputCached inputOutput
Cloudflare list$2.000$0.500$6.000
xAI models and pricing$2.00$0.50$6.00
one-api.ai$2.421$0.605$7.263

At or above 200k input tokens, per 1M

PriceInputCached inputOutput
Cloudflare list$4.000$1.000$12.000
one-api.ai$4.842$1.211$14.526

Sources: Cloudflare model page, checked 2026-10-22; xAI models and pricing, checked 2026-10-31.

What a month costs

Three example workloads. "Monthly cost" multiplies the tokens by the one-api.ai price per 1M, and that is what billing debits: usage is metered to a millionth of a credit, with no rounding up per call. A credit is a tenth of a cent.

WorkloadRequestsTokens in / out per requestMonthly costPer request
Support chatbot10,0001,500 / 300$58.1045.8104 credits
RAG answers5,0006,000 / 400$87.15617.4312 credits
Batch summaries1,00020,000 / 1,000$55.68355.683 credits

Prompts that reuse a long prefix can cost less where the model has a cached-input rate, shown in the price comparison above.

Context and cache tiers

xAI models page lists a context window of 500,000 tokens. Prompts of 200,000 tokens or more, counting cached tokens, are billed at the long-context tier for the whole request. Cached input is billed at the cached rate only when the provider reports a cache hit; the cost examples above assume no cache hits. one-api.ai sets max_tokens to 4,096 when a request leaves it out and clamps it to 16,384.

Request examples

Python

import os
from openai import OpenAI

client = OpenAI(base_url="https://one-api.ai/v1/launch", api_key=os.environ["ONE_API_TOKEN"])
resp = client.chat.completions.create(
    model="xai/grok-4.7",
    messages=[{"role": "user", "content": "Summarise RDAP in one sentence."}],
    max_tokens=512,
)
print(resp.choices[0].message.content)
print(resp.usage)

JavaScript

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://one-api.ai/v1/launch", apiKey: process.env.ONE_API_TOKEN });
const resp = await client.chat.completions.create({
  model: "xai/grok-4.7",
  messages: [{ role: "user", content: "Summarise RDAP in one sentence." }],
  max_tokens: 512,
});
console.log(resp.choices[0].message.content, resp.usage);

curl

curl https://one-api.ai/v1/launch/chat/completions \
  -H "Authorization: Bearer $ONE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"xai/grok-4.7","messages":[{"role":"user","content":"Say hello in one sentence."}],"max_tokens":512}'

Notes on Grok 4.7

This page is information only. Grok 4.7 is not part of one-api.ai early access, and we do not sell access to it today. The rates are published for comparison and are what the endpoint is configured to debit.

xAI bills the higher tier when a prompt reaches 200,000 tokens, and then for all tokens in that request. one-api.ai uses the same threshold, counting cached tokens toward it.

xAI lists a 500,000 token context window and a knowledge cut-off of May 2026. Grok has no live data unless search tools are enabled, and those tools are not exposed through one-api.ai.

Cached input on Grok 4.7 costs a quarter of plain input. Output is three times input, so long answers drive the bill more than long prompts until the 200,000 token tier starts.

FAQ

Can I buy Grok 4.7 access from one-api.ai?

Not today. The page documents prices only. Early access covers the DeepSeek and GLM models and the four lookups.

Does Grok 4.7 know about recent events?

Only up to its May 2026 knowledge cut-off, according to xAI. Web and X search tools are not available through this endpoint.

How is the long-context tier applied?

Per request. A prompt of 200,000 tokens or more pays the higher input, cached input and output rates for the whole request.

Related

Last updated 2026-10-31.