API quickstart
Send your first request to BigModel.io, the global model API platform: choose a model, create an API key and call it through the OpenAI- or Anthropic-compatible API.
On this page
BigModel.io gives you one API key for leading AI models. The API speaks two protocols, OpenAI and Anthropic, and most SDKs and tools use one of them, so you usually only change the base URL and the key. Models available today include GLM, DeepSeek, Kimi, MiniMax and Doubao; see the model catalog.
| Protocol | Base URL to configure | Endpoints the client calls |
|---|---|---|
| OpenAI-compatible | https://bigmodel.io/v1 |
/v1/chat/completions, /v1/responses, /v1/models |
| Anthropic-compatible | https://bigmodel.io |
/v1/messages (the client adds /v1) |
Authentication is Authorization: Bearer $BIGMODEL_API_KEY. Anthropic clients that send x-api-key work too.
#1. Choose a model
Open the model's page in the catalog and note its model ID, price and supported endpoints. Model IDs are lowercase and keep their dots, for example glm-5.3 or deepseek-v4-pro. Chat, image and video APIs use different request formats.
#2. Create an API key
Sign in and create a key in API Keys, selecting a group that serves your model. The group decides which models and endpoints the key can use and the rate multiplier on its charges; keys from different groups are not interchangeable.
You can view and copy the full key in API Keys at any time, so there is no need to save it the moment it is created. Store it in a server-side environment variable and keep it out of browser code and public repositories.
export BIGMODEL_API_KEY="sk-..."#3. Add balance
Requests are charged in USD from your balance, and a request to a paid model is only accepted while the balance is above zero. GET /v1/models also needs a positive balance: with a zero balance it returns 403 INSUFFICIENT_BALANCE. New accounts get free trial credit; the amount is shown in the console. Models priced at $0 can be called even at a zero balance. Top up in Billing, or use a plan if your key's group is a plan group. See Billing & top-ups and Trial credit & free models.
#4. Send a request
Replace glm-5.3 with a model ID your key's group serves.
curl https://bigmodel.io/v1/chat/completions \
-H "Authorization: Bearer $BIGMODEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3","messages":[{"role":"user","content":"Hello!"}]}'import os
from openai import OpenAI
client = OpenAI(base_url="https://bigmodel.io/v1", api_key=os.environ["BIGMODEL_API_KEY"])
resp = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://bigmodel.io/v1", apiKey: process.env.BIGMODEL_API_KEY });
const resp = await client.chat.completions.create({
model: "glm-5.3",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);The Anthropic Messages protocol works the same way, on groups that serve /v1/messages:
curl https://bigmodel.io/v1/messages \
-H "Authorization: Bearer $BIGMODEL_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3","max_tokens":64,"messages":[{"role":"user","content":"Hello!"}]}'If your client asks for a base URL, OpenAI-style clients need the /v1 suffix (https://bigmodel.io/v1). If it asks for a full request URL, use the complete endpoint. Avoid adding /v1 twice. Anthropic clients are the exception: they take https://bigmodel.io and add /v1/messages themselves.
For SDK code, see OpenAI SDK and LangChain. For coding tools, see Claude Code, Cursor, Codex CLI, OpenCode and Cline. Video generation is asynchronous and covered in the video API guide.
#Verify the setup
List the models your key can call. An empty or 403 response points to the group or the balance.
curl https://bigmodel.io/v1/models \
-H "Authorization: Bearer $BIGMODEL_API_KEY"Then open Usage: your test request should appear with its model, tokens and actual charge. GET /v1/usage returns the same totals and your remaining balance for the key.
#Troubleshooting
401 API_KEY_REQUIRED or INVALID_API_KEY. The key is missing or mistyped. Send it as Authorization: Bearer sk-... (or x-api-key), not in the URL; a key in ?key= returns 400 api_key_in_query_deprecated.
401 API_KEY_DISABLED or 403 API_KEY_EXPIRED. Enable the key or extend its expiry in API Keys.
403 INSUFFICIENT_BALANCE. The balance is zero or below. Top up and retry. This also affects GET /v1/models.
503 No available accounts: no available accounts supporting model: .... The model ID is mistyped, or the key's group does not serve that model. BigModel.io returns this 503 instead of a 404 for unknown models. Copy the ID from /models and check it in GET /v1/models.
404 ... platform only supports /v1/chat/completions. The key's group serves only Chat Completions. Use /v1/chat/completions, or a key from a group that serves Messages or Responses.
429. A key quota, spend window, plan limit or rate limit was hit. The error code says which; see Limits & rate limits.
Timeout or 5xx. Retry with backoff. Keep the X-Request-ID response header and the time. A video task may still be running after a timeout; check its status before submitting again. Full list: Errors.
#Still need help?
Open Support and include the model ID, endpoint, request time, HTTP status, error message and X-Request-ID. Remove API keys and sensitive input first. You can also email support@bigmodel.io.
#Related
Updated · View as Markdown