Text Generation Models

SilvaMux supports multiple vendor-protocol compatible entries plus an optional unified entry. New projects should integrate via the vendor protocol their target model supports; projects using the OpenAI SDK should default to the OpenAI Chat Completions compatible entry.

The endpoints below accept the corresponding vendor's request format and preserve the matching response and error structures — ideal for official SDKs, existing code migration, or field-level pass-through.

Compatible formatEndpointDocs
OpenAI Chat CompletionsPOST /api/v1/chat/completionsOpenAI Compatible API
AnthropicPOST /api/v1/messagesAnthropic Compatible
Volcengine v3POST /api/v3/chat/completionsVolcengine Compatible
ZhipuPOST /api/paas/v4/chat/completionsZhipu Compatible
SilvaMux unified entryPOST /api/v0/chat/completionsSilvaMux Unified Entry
ResponsesPOST /api/v1/responsesCompatible with the OpenAI Responses API; for supported models (e.g. the codex series)
GeminiPOST /api/v1beta/models/{model}:generateContentCompatible with the Gemini generateContent format; no publicly discoverable models currently, so no executable example

These paths are SilvaMux compatible entries, not the vendors' official service addresses. Calls use SilvaMux-issued API keys. The public OpenAPI treats the standard paths above as the contract for new integrations; the historical addresses /api/anthropic/v1/messages and /api/v1/gemini/v1beta/models/{model}:generateContent remain only for existing projects and should not be used by new ones.

OpenAI Responses

Compatible with the OpenAI Responses API; for supported models (e.g. the codex series):

POST/api/v1/responses

OpenAI Responses

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/v1/responses
Authorization: Bearer $SILVAMUX_API_KEY
Content-Type: application/json

Request body

application/json · ResponsesRequest · Required

FieldTypeRequiredDescription
inputstring | array<FreeFormObject>Yes
modelstringYes从模型广场选择标注支持 OpenAI Responses 的模型并复制调用名。
streambooleanNoDefault: false

Response

200Responses JSON 或 SSE 响应。

application/json · FreeFormObject

defaultOpenAI 兼容错误。

application/json · OpenAIError

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

Common Parameters

Common parameters for OpenAI Chat and the unified entry:

ParameterTypeDescription
modelstringRequired. Model call name (id or alias), e.g. minimax-m2.5, doubao-seed-2.0-pro
messagesarrayRequired. Message list, same shape as OpenAI (role + content)
streambooleanWhether to stream the response; default false
temperaturenumberSampling temperature; default 1.0
max_tokensintegerMaximum generated tokens

Field structures differ per vendor protocol. First filter the Model Plaza for models supporting your target format, then copy the call name from the detail page into model.

Authentication

Authorization: Bearer <API_KEY> or x-api-key: <API_KEY>.

Streaming

Set stream: true to get a streaming response (SSE). The response is text/event-stream, each event starting with data: . You may eventually receive a usage chunk with an empty choices, after which the server closes the connection; do not rely solely on data: [DONE] to detect completion. Anthropic-format streaming follows the Anthropic SSE specification.

curl https://www.silvamux.com/api/v1/chat/completions \
  -H "Authorization: Bearer $SILVAMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.5",
    "messages": [{"role": "user", "content": "Write a short poem"}],
    "stream": true
  }'

Multimodal

For image, audio, and other multimodal input formats, see Multimodal Input.