DaoXE fronts Zhipu's GLM family through the standard OpenAI shape: POST /v1/chat/completions with a GLM model ID, or /v1/responses where the ID supports it. Existing OpenAI SDK code works unchanged — only the base URL and key change. How the cost split works against official APIs: cheapest APIs guide.
Call GLM through DaoXE#
Chat path: /v1/chat/completions with Authorization: Bearer. Reasoning-capable GLM IDs spend tokens on thinking before the answer — give max_tokens enough headroom or the reply comes back empty with finish_reason: "length".
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."}]
}'# Reasoning-capable GLM IDs spend tokens on thinking BEFORE the answer.
# A small max_tokens returns empty content with finish_reason="length" -
# budget for the thinking, not just the answer.
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 glm-* id from GET /v1/models
max_tokens=2048, # room for thinking + answer
messages=[{"role": "user", "content": "2+2? Think briefly, then answer."}],
)
msg = r.choices[0].message
print(getattr(msg, "reasoning_content", None)) # thinking, if exposed
print(msg.content) # final answer
print(r.choices[0].finish_reason) # "stop" means it fitHow GLM exposes reasoning#
Reasoning-capable GLM IDs treat max_tokens as the budget for thinking and answer: the chain of thought runs inside the completion, tokens counted against the same cap. Undersize the cap and you get empty content with finish_reason: "length" — no error, just a blank. Size for the thinking first. Some IDs expose the trace via reasoning_content on the message; treat it as best-effort and read the catalogue notes rather than assuming.
GLM-specific notes#
- Reasoning models eat budget. Thinking tokens count toward
max_tokens; a small cap yields an empty content body, not an error. Size the budget for the thinking, not the answer. - No native Zhipu endpoint shape. There is no
ep-style ID here — use catalogue IDs fromGET /v1/models. - Exact IDs from the catalogue. GLM versions move fast; copy the ID from your account's live list rather than a blog post.
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:
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 Zhipu 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 a Zhipu account?
No — GLM models ride on your single DaoXE key with normal catalogue IDs from GET /v1/models.
Which endpoints work for GLM?
OpenAI-compatible chat (/v1/chat/completions) and /v1/responses on IDs that support it.
Why did my request return empty content?
A reasoning ID with too small a max_tokens spends the budget on thinking. Raise the cap and retry.
How much does GLM 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.