Zhipu Compatible

Reuses the unified entry with model-based routing and stays compatible with the Zhipu official SDK: set base_url="https://www.silvamux.com/api/paas/v4" and you can migrate without code changes, using Zhipu official model names (e.g. glm-5).

POST/api/paas/v4/chat/completions

智谱兼容

复用统一入口按 model 选路。

Bearer API KeyUse the Authorization: Bearer sk_live_... header; x-api-key is also supported.
Confirm the model call name firstFirst filter models that support this endpoint format on the Models page, then open a model detail page to copy its call name. Your account's final availability also depends on organization permissions.

Request structure

The section below confirms the method, URL and authentication scheme. It is an HTTP structure snippet, not a standalone runnable example.

HTTP
POST https://www.silvamux.com/api/paas/v4/chat/completions
Authorization: Bearer $SILVAMUX_API_KEY
Content-Type: application/json

Request body

application/json · OpenAIChatRequest · Required

FieldTypeRequiredDescription
max_tokensintegerNo
messagesarray<Message>Yes
messages.contentstring | array<FreeFormObject>Yes
messages.rolestring (system | user | assistant | tool)Yes
modelstringYesSilvaMux 模型 id 或 alias。
streambooleanNoDefault: false
temperaturenumberNo
toolsarray<FreeFormObject>No

Response

200OpenAI Chat JSON 或 SSE 响应。

application/json · OpenAIChatResponse

FieldTypeRequiredDescription
choicesarray<FreeFormObject>Yes
idstringYes
modelstringNo
objectstringNo
usageFreeFormObjectNo

defaultOpenAI 兼容错误。

application/json · OpenAIError

FieldTypeRequiredDescription
errorobjectYes
error.codestring | integerNo
error.messagestringYes
error.typestringNo

Examples

The Zhipu entry's request format is OpenAI Chat compatible, so you can also point the OpenAI SDK at it directly (the Zhipu official SDK works too after configuring base_url):

curl https://www.silvamux.com/api/paas/v4/chat/completions \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5",
    "messages": [{"role": "user", "content": "Hello"}]
  }'