Grok API access — OpenAI-compatible, one key

Grok models from xAI ride the same OpenAI-compatible base URL as everything else on DaoXE — no xAI console account, no separate SDK. One key, catalogue IDs, verifiable.

Updated 2026-09-15

DaoXE fronts xAI's Grok family in the standard OpenAI shape: POST /v1/chat/completions with a Grok model ID; /v1/responses is available on IDs that support it. Existing OpenAI SDK code works unchanged — only the base URL and key change. Where the real cost split comes from: cheapest APIs guide.

Call Grok through DaoXE#

Chat path: /v1/chat/completions with Authorization: Bearer. Grok reasoning IDs account for thinking at the usage level: usage.completion_tokens_details.reasoning_tokens reports how many completion tokens went to thinking.

bash
curl --fail-with-body --show-error --silent \
  https://daoxe.com/v1/chat/completions \
  -H "Authorization: Bearer ${DAOXE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_EXACT_MODEL_ID",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'
python
# xAI reasoning IDs report thinking at the USAGE level, not the message
# level: reasoning_tokens appear in usage.completion_tokens_details. If your
# billing dashboards ignore that detail, cache tokens and thinking tokens both
# look like ordinary completion spend.
from openai import OpenAI

client = OpenAI(base_url="https://daoxe.com/v1", api_key="YOUR_DAOXE_KEY")
r = client.chat.completions.create(
    model="YOUR_EXACT_MODEL_ID",   # a grok-* id from GET /v1/models
    messages=[{"role": "user", "content": "2+2? Think briefly, then answer."}],
)
print(r.choices[0].message.content)
details = r.usage.completion_tokens_details
print(getattr(details, "reasoning_tokens", None))   # thinking, counted here

How Grok exposes reasoning#

xAI reports thinking as an accounting detail, not a message field: usage.completion_tokens_details.reasoning_tokens counts the completion tokens consumed by reasoning. The chain of thought itself is not returned. That makes Grok the cheapest of the three shapes to log — the numbers are already in your usage stream — and the least inspectable, since there is nothing to read, only to count.

Grok-specific notes#

  • Reasoning shows in usage, not in the message. Unlike APIs that add a separate thinking field on the message, xAI reports reasoning_tokens inside usage.completion_tokens_details — if your billing or audit tooling only reads top-level usage numbers, thinking spend is invisible to it.
  • Responses surface exists. xAI exposes an OpenAI Responses-compatible endpoint; check whether the specific ID you pin declares it before routing Responses-shaped traffic.
  • Exact IDs from the live list. Grok versions move; copy IDs from GET /v1/models, not from launch posts.

What it costs#

One balance, one top-up rate

Top-up runs at a flat 1 RMB = $1 of credit on every payment method, and each model then bills at its own USD rate — live per-model rates are on the live pricing page. That rate is the same on Alipay, WeChat Pay, USDT, bank card (Visa · Mastercard), Apple Pay and Google Pay — one balance, shared by every model in the catalog, with no plan to choose and no monthly minimum. Rates are account-scoped and do change, so confirm with one small top-up rather than trusting a number in a guide.

Verify you actually get the model#

Prove the endpoint works before blaming the client — if this fails, no setting will fix it:

bash
export DAOXE_API_KEY="your_api_key"

# List the exact model IDs your account can call
curl --fail-with-body --show-error --silent \
  https://daoxe.com/v1/models \
  -H "Authorization: Bearer ${DAOXE_API_KEY}"

Confirm connectivity, then diff a fixed prompt at temperature 0 against the official xAI API to make sure the tier matches:

Verify us — don't trust us

Point the open benchmark at DaoXE and at the official API and compare at temperature 0. Then learn to detect model swapping so a cheaper endpoint can't quietly swap you to a smaller model.

Frequently asked questions#

Do I need an xAI console account?

No — Grok models ride on your single DaoXE key with normal catalogue IDs from GET /v1/models.

Where did the thinking tokens go?

Into usage.completion_tokens_details.reasoning_tokens. Read them there for cost attribution.

Which endpoints work for Grok?

OpenAI-compatible chat (/v1/chat/completions) and the Responses surface on supporting IDs.

How much does Grok cost here?

Per-model, account-scoped — see live pricing. Top-up is a flat 1 RMB = $1 of credit on every payment method.

Try DaoXE — and benchmark it yourself

One key for GPT, Claude, Gemini, DeepSeek and more. Point the open benchmark at us and compare — don't take our word for it.