[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs-nav-en":3,"docs-en-models\u002Fchat\u002Foverview":163,"$fMfNGmlyCdNoDCVQ7TgrfnLxKMln4u_bAZVPHPJkuObA":1184},[4,52,69,92,142,155,159],{"title":5,"path":6,"stem":7,"children":8,"page":-1},"Getting Started","\u002Fgetting-started","1.getting-started",[9,12,30,44,48],{"title":10,"path":6,"stem":11},"About SilvaMux","1.getting-started\u002Findex",{"title":13,"path":14,"stem":15,"children":16,"page":-1},"Your First SilvaMux API Call","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F1.quick-start\u002Findex",[17,18,22,26],{"title":13,"path":14,"stem":15},{"title":19,"path":20,"stem":21},"Projects & Account Setup","\u002Fgetting-started\u002Fquick-start\u002Fproject-and-account","1.getting-started\u002F1.quick-start\u002F2.project-and-account",{"title":23,"path":24,"stem":25},"Get an API Key","\u002Fgetting-started\u002Fquick-start\u002Fapi-key","1.getting-started\u002F1.quick-start\u002F3.api-key",{"title":27,"path":28,"stem":29},"First Request","\u002Fgetting-started\u002Fquick-start\u002Ffirst-request","1.getting-started\u002F1.quick-start\u002F4.first-request",{"title":31,"path":32,"stem":33,"children":34,"page":43},"Models & Experience","\u002Fgetting-started\u002Fmodels-and-experience","1.getting-started\u002F2.models-and-experience",[35,39],{"title":36,"path":37,"stem":38},"Model Selection","\u002Fgetting-started\u002Fmodels-and-experience\u002Fmodel-selection","1.getting-started\u002F2.models-and-experience\u002F1.model-selection",{"title":40,"path":41,"stem":42},"Playground","\u002Fgetting-started\u002Fmodels-and-experience\u002Fplayground","1.getting-started\u002F2.models-and-experience\u002F2.playground",false,{"title":45,"path":46,"stem":47},"Rate Limits","\u002Fgetting-started\u002Frate-limits","1.getting-started\u002F3.rate-limits",{"title":49,"path":50,"stem":51},"FAQ","\u002Fgetting-started\u002Ffaq","1.getting-started\u002F4.faq",{"title":53,"path":54,"stem":55,"children":56,"page":43},"Billing","\u002Fbilling","2.billing",[57,61,65],{"title":58,"path":59,"stem":60},"Billing Overview","\u002Fbilling\u002Foverview","2.billing\u002F1.overview",{"title":62,"path":63,"stem":64},"Online Top-up","\u002Fbilling\u002Frecharge","2.billing\u002F2.recharge",{"title":66,"path":67,"stem":68},"Bills, Usage & Exports","\u002Fbilling\u002Fusage-export","2.billing\u002F3.usage-export",{"title":70,"path":71,"stem":72,"children":73,"page":43},"Coding Plan","\u002Fcoding-plan","3.coding-plan",[74,78],{"title":75,"path":76,"stem":77},"Coding Plan Overview","\u002Fcoding-plan\u002Foverview","3.coding-plan\u002F1.overview",{"title":79,"path":80,"stem":81,"children":82,"page":-1},"Personal","\u002Fcoding-plan\u002Fpersonal","3.coding-plan\u002F2.personal\u002Findex",[83,85,89],{"title":84,"path":80,"stem":81},"Pricing & Benefits",{"title":86,"path":87,"stem":88},"Quick Start","\u002Fcoding-plan\u002Fpersonal\u002Fquick-start","3.coding-plan\u002F2.personal\u002F2.quick-start",{"title":49,"path":90,"stem":91},"\u002Fcoding-plan\u002Fpersonal\u002Ffaq","3.coding-plan\u002F2.personal\u002F3.faq",{"title":93,"path":94,"stem":95,"children":96,"page":43},"Model APIs","\u002Fmodels","4.models",[97,130],{"title":98,"path":99,"stem":100,"children":101,"page":43},"Text Generation","\u002Fmodels\u002Fchat","4.models\u002F1.chat",[102,106,110,114,118,122,126],{"title":103,"path":104,"stem":105},"Overview","\u002Fmodels\u002Fchat\u002Foverview","4.models\u002F1.chat\u002F1.overview",{"title":107,"path":108,"stem":109},"OpenAI Compatible API","\u002Fmodels\u002Fchat\u002Fopenai","4.models\u002F1.chat\u002F2.openai",{"title":111,"path":112,"stem":113},"Anthropic Compatible","\u002Fmodels\u002Fchat\u002Fanthropic","4.models\u002F1.chat\u002F3.anthropic",{"title":115,"path":116,"stem":117},"Volcengine Compatible","\u002Fmodels\u002Fchat\u002Fvolcengine","4.models\u002F1.chat\u002F4.volcengine",{"title":119,"path":120,"stem":121},"Zhipu Compatible","\u002Fmodels\u002Fchat\u002Fzhipu","4.models\u002F1.chat\u002F5.zhipu",{"title":123,"path":124,"stem":125},"SilvaMux Unified Entry","\u002Fmodels\u002Fchat\u002Funified","4.models\u002F1.chat\u002F6.unified",{"title":127,"path":128,"stem":129},"Multimodal Input","\u002Fmodels\u002Fchat\u002Fmultimodal","4.models\u002F1.chat\u002F7.multimodal",{"title":131,"path":132,"stem":133,"children":134,"page":43},"Image Generation","\u002Fmodels\u002Fimages","4.models\u002F2.images",[135,138],{"title":103,"path":136,"stem":137},"\u002Fmodels\u002Fimages\u002Foverview","4.models\u002F2.images\u002F1.overview",{"title":139,"path":140,"stem":141},"Image Generation API","\u002Fmodels\u002Fimages\u002Fgeneration","4.models\u002F2.images\u002F2.generation",{"title":143,"path":144,"stem":145,"children":146,"page":43},"Usage & Balance","\u002Fusage-and-balance","5.usage-and-balance",[147,151],{"title":148,"path":149,"stem":150},"Query Balance","\u002Fusage-and-balance\u002Fbalance","5.usage-and-balance\u002F1.balance",{"title":152,"path":153,"stem":154},"Query Usage","\u002Fusage-and-balance\u002Fusage","5.usage-and-balance\u002F2.usage",{"title":156,"path":157,"stem":158},"Error Codes","\u002Ferrors","6.errors",{"title":160,"path":161,"stem":162},"Documentation","\u002F","index",{"id":164,"title":103,"body":165,"description":1177,"extension":1178,"meta":1179,"navigation":639,"path":104,"rawbody":1180,"requiredFlags":1181,"seo":1182,"stem":105,"__hash__":1183},"docs_en\u002F4.models\u002F1.chat\u002F1.overview.md",{"type":166,"value":167,"toc":1168},"minimark",[168,173,186,191,194,324,335,340,343,348,352,355,463,477,481,489,493,516,1154,1158,1164],[169,170,172],"h1",{"id":171},"text-generation-models","Text Generation Models",[174,175,176,177,181,182,185],"p",{},"SilvaMux supports multiple ",[178,179,180],"strong",{},"vendor-protocol compatible entries"," plus an optional ",[178,183,184],{},"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.",[187,188,190],"h2",{"id":189},"vendor-protocol-compatible-entries-recommended","Vendor Protocol Compatible Entries (Recommended)",[174,192,193],{},"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.",[195,196,197,213],"table",{},[198,199,200],"thead",{},[201,202,203,207,210],"tr",{},[204,205,206],"th",{},"Compatible format",[204,208,209],{},"Endpoint",[204,211,212],{},"Docs",[214,215,216,234,249,264,279,294,307],"tbody",{},[201,217,218,222,228],{},[219,220,221],"td",{},"OpenAI Chat Completions",[219,223,224],{},[225,226,227],"code",{},"POST \u002Fapi\u002Fv1\u002Fchat\u002Fcompletions",[219,229,230],{},[231,232,107],"a",{"href":233},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fopenai",[201,235,236,239,244],{},[219,237,238],{},"Anthropic",[219,240,241],{},[225,242,243],{},"POST \u002Fapi\u002Fv1\u002Fmessages",[219,245,246],{},[231,247,111],{"href":248},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fanthropic",[201,250,251,254,259],{},[219,252,253],{},"Volcengine v3",[219,255,256],{},[225,257,258],{},"POST \u002Fapi\u002Fv3\u002Fchat\u002Fcompletions",[219,260,261],{},[231,262,115],{"href":263},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fvolcengine",[201,265,266,269,274],{},[219,267,268],{},"Zhipu",[219,270,271],{},[225,272,273],{},"POST \u002Fapi\u002Fpaas\u002Fv4\u002Fchat\u002Fcompletions",[219,275,276],{},[231,277,119],{"href":278},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fzhipu",[201,280,281,284,289],{},[219,282,283],{},"SilvaMux unified entry",[219,285,286],{},[225,287,288],{},"POST \u002Fapi\u002Fv0\u002Fchat\u002Fcompletions",[219,290,291],{},[231,292,123],{"href":293},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Funified",[201,295,296,299,304],{},[219,297,298],{},"Responses",[219,300,301],{},[225,302,303],{},"POST \u002Fapi\u002Fv1\u002Fresponses",[219,305,306],{},"Compatible with the OpenAI Responses API; for supported models (e.g. the codex series)",[201,308,309,312,317],{},[219,310,311],{},"Gemini",[219,313,314],{},[225,315,316],{},"POST \u002Fapi\u002Fv1beta\u002Fmodels\u002F{model}:generateContent",[219,318,319,320,323],{},"Compatible with the Gemini ",[225,321,322],{},"generateContent"," format; no publicly discoverable models currently, so no executable example",[174,325,326,327,330,331,334],{},"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 ",[225,328,329],{},"\u002Fapi\u002Fanthropic\u002Fv1\u002Fmessages"," and ",[225,332,333],{},"\u002Fapi\u002Fv1\u002Fgemini\u002Fv1beta\u002Fmodels\u002F{model}:generateContent"," remain only for existing projects and should not be used by new ones.",[336,337,339],"h3",{"id":338},"openai-responses","OpenAI Responses",[174,341,342],{},"Compatible with the OpenAI Responses API; for supported models (e.g. the codex series):",[344,345],"api-endpoint",{"method":346,"path":347},"POST","\u002Fapi\u002Fv1\u002Fresponses",[187,349,351],{"id":350},"common-parameters","Common Parameters",[174,353,354],{},"Common parameters for OpenAI Chat and the unified entry:",[195,356,357,370],{},[198,358,359],{},[201,360,361,364,367],{},[204,362,363],{},"Parameter",[204,365,366],{},"Type",[204,368,369],{},"Description",[214,371,372,400,421,437,450],{},[201,373,374,379,382],{},[219,375,376],{},[225,377,378],{},"model",[219,380,381],{},"string",[219,383,384,385,388,389,392,393,396,397],{},"Required. Model call name (",[225,386,387],{},"id"," or ",[225,390,391],{},"alias","), e.g. ",[225,394,395],{},"minimax-m2.5",", ",[225,398,399],{},"doubao-seed-2.0-pro",[201,401,402,407,410],{},[219,403,404],{},[225,405,406],{},"messages",[219,408,409],{},"array",[219,411,412,413,416,417,420],{},"Required. Message list, same shape as OpenAI (",[225,414,415],{},"role"," + ",[225,418,419],{},"content",")",[201,422,423,428,431],{},[219,424,425],{},[225,426,427],{},"stream",[219,429,430],{},"boolean",[219,432,433,434],{},"Whether to stream the response; default ",[225,435,436],{},"false",[201,438,439,444,447],{},[219,440,441],{},[225,442,443],{},"temperature",[219,445,446],{},"number",[219,448,449],{},"Sampling temperature; default 1.0",[201,451,452,457,460],{},[219,453,454],{},[225,455,456],{},"max_tokens",[219,458,459],{},"integer",[219,461,462],{},"Maximum generated tokens",[464,465,466],"blockquote",{},[174,467,468,469,473,474,476],{},"Field structures differ per vendor protocol. First filter the ",[231,470,472],{"href":471},"\u002Fen\u002Fmodels","Model Plaza"," for models supporting your target format, then copy the call name from the detail page into ",[225,475,378],{},".",[187,478,480],{"id":479},"authentication","Authentication",[174,482,483,388,486,476],{},[225,484,485],{},"Authorization: Bearer \u003CAPI_KEY>",[225,487,488],{},"x-api-key: \u003CAPI_KEY>",[187,490,492],{"id":491},"streaming","Streaming",[174,494,495,496,499,500,503,504,507,508,511,512,515],{},"Set ",[225,497,498],{},"stream: true"," to get a streaming response (SSE). The response is ",[225,501,502],{},"text\u002Fevent-stream",", each event starting with ",[225,505,506],{},"data: ",". You may eventually receive a usage chunk with an empty ",[225,509,510],{},"choices",", after which the server closes the connection; do not rely solely on ",[225,513,514],{},"data: [DONE]"," to detect completion. Anthropic-format streaming follows the Anthropic SSE specification.",[517,518,519,610,737,833],"code-tabs",{},[520,521,523],"code-tab",{"label":522},"cURL",[524,525,530],"pre",{"className":526,"code":527,"language":528,"meta":529,"style":529},"language-bash shiki shiki-themes github-light github-dark","curl https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $SILVAMUX_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"minimax-m2.5\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n    \"stream\": true\n  }'\n","bash","",[225,531,532,549,567,577,586,592,598,604],{"__ignoreMap":529},[533,534,537,541,545],"span",{"class":535,"line":536},"line",1,[533,538,540],{"class":539},"sScJk","curl",[533,542,544],{"class":543},"sZZnC"," https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions",[533,546,548],{"class":547},"sj4cs"," \\\n",[533,550,552,555,558,562,565],{"class":535,"line":551},2,[533,553,554],{"class":547},"  -H",[533,556,557],{"class":543}," \"Authorization: Bearer ",[533,559,561],{"class":560},"sVt8B","$SILVAMUX_API_KEY",[533,563,564],{"class":543},"\"",[533,566,548],{"class":547},[533,568,570,572,575],{"class":535,"line":569},3,[533,571,554],{"class":547},[533,573,574],{"class":543}," \"Content-Type: application\u002Fjson\"",[533,576,548],{"class":547},[533,578,580,583],{"class":535,"line":579},4,[533,581,582],{"class":547},"  -d",[533,584,585],{"class":543}," '{\n",[533,587,589],{"class":535,"line":588},5,[533,590,591],{"class":543},"    \"model\": \"minimax-m2.5\",\n",[533,593,595],{"class":535,"line":594},6,[533,596,597],{"class":543},"    \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n",[533,599,601],{"class":535,"line":600},7,[533,602,603],{"class":543},"    \"stream\": true\n",[533,605,607],{"class":535,"line":606},8,[533,608,609],{"class":543},"  }'\n",[520,611,613],{"label":612},"Python",[524,614,618],{"className":615,"code":616,"language":617,"meta":529,"style":529},"language-python shiki shiki-themes github-light github-dark","# pip install openai\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"SILVAMUX_API_KEY\"],\n    base_url=\"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n)\n\nstream = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n    stream=True,\n)\nfor chunk in stream:\n    if chunk.choices:\n        delta = chunk.choices[0].delta.content\n        if delta:\n            print(delta, end=\"\", flush=True)\n    if chunk.usage:\n        print(f\"\\nUsage: {chunk.usage}\")\n","python",[225,619,620,625,630,635,641,646,651,656,661,666,672,678,684,690,695,701,707,713,719,725,731],{"__ignoreMap":529},[533,621,622],{"class":535,"line":536},[533,623,624],{},"# pip install openai\n",[533,626,627],{"class":535,"line":551},[533,628,629],{},"import os\n",[533,631,632],{"class":535,"line":569},[533,633,634],{},"from openai import OpenAI\n",[533,636,637],{"class":535,"line":579},[533,638,640],{"emptyLinePlaceholder":639},true,"\n",[533,642,643],{"class":535,"line":588},[533,644,645],{},"client = OpenAI(\n",[533,647,648],{"class":535,"line":594},[533,649,650],{},"    api_key=os.environ[\"SILVAMUX_API_KEY\"],\n",[533,652,653],{"class":535,"line":600},[533,654,655],{},"    base_url=\"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n",[533,657,658],{"class":535,"line":606},[533,659,660],{},")\n",[533,662,664],{"class":535,"line":663},9,[533,665,640],{"emptyLinePlaceholder":639},[533,667,669],{"class":535,"line":668},10,[533,670,671],{},"stream = client.chat.completions.create(\n",[533,673,675],{"class":535,"line":674},11,[533,676,677],{},"    model=\"minimax-m2.5\",\n",[533,679,681],{"class":535,"line":680},12,[533,682,683],{},"    messages=[{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n",[533,685,687],{"class":535,"line":686},13,[533,688,689],{},"    stream=True,\n",[533,691,693],{"class":535,"line":692},14,[533,694,660],{},[533,696,698],{"class":535,"line":697},15,[533,699,700],{},"for chunk in stream:\n",[533,702,704],{"class":535,"line":703},16,[533,705,706],{},"    if chunk.choices:\n",[533,708,710],{"class":535,"line":709},17,[533,711,712],{},"        delta = chunk.choices[0].delta.content\n",[533,714,716],{"class":535,"line":715},18,[533,717,718],{},"        if delta:\n",[533,720,722],{"class":535,"line":721},19,[533,723,724],{},"            print(delta, end=\"\", flush=True)\n",[533,726,728],{"class":535,"line":727},20,[533,729,730],{},"    if chunk.usage:\n",[533,732,734],{"class":535,"line":733},21,[533,735,736],{},"        print(f\"\\nUsage: {chunk.usage}\")\n",[520,738,740],{"label":739},"JavaScript",[524,741,745],{"className":742,"code":743,"language":744,"meta":529,"style":529},"language-javascript shiki shiki-themes github-light github-dark","\u002F\u002F npm install openai\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  apiKey: process.env.SILVAMUX_API_KEY,\n  baseURL: \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n});\n\nconst stream = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Write a short poem\" }],\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  const delta = chunk.choices[0]?.delta?.content;\n  if (delta) process.stdout.write(delta);\n}\n","javascript",[225,746,747,752,757,761,766,771,776,781,785,790,795,800,805,809,813,818,823,828],{"__ignoreMap":529},[533,748,749],{"class":535,"line":536},[533,750,751],{},"\u002F\u002F npm install openai\n",[533,753,754],{"class":535,"line":551},[533,755,756],{},"import OpenAI from \"openai\";\n",[533,758,759],{"class":535,"line":569},[533,760,640],{"emptyLinePlaceholder":639},[533,762,763],{"class":535,"line":579},[533,764,765],{},"const client = new OpenAI({\n",[533,767,768],{"class":535,"line":588},[533,769,770],{},"  apiKey: process.env.SILVAMUX_API_KEY,\n",[533,772,773],{"class":535,"line":594},[533,774,775],{},"  baseURL: \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n",[533,777,778],{"class":535,"line":600},[533,779,780],{},"});\n",[533,782,783],{"class":535,"line":606},[533,784,640],{"emptyLinePlaceholder":639},[533,786,787],{"class":535,"line":663},[533,788,789],{},"const stream = await client.chat.completions.create({\n",[533,791,792],{"class":535,"line":668},[533,793,794],{},"  model: \"minimax-m2.5\",\n",[533,796,797],{"class":535,"line":674},[533,798,799],{},"  messages: [{ role: \"user\", content: \"Write a short poem\" }],\n",[533,801,802],{"class":535,"line":680},[533,803,804],{},"  stream: true,\n",[533,806,807],{"class":535,"line":686},[533,808,780],{},[533,810,811],{"class":535,"line":692},[533,812,640],{"emptyLinePlaceholder":639},[533,814,815],{"class":535,"line":697},[533,816,817],{},"for await (const chunk of stream) {\n",[533,819,820],{"class":535,"line":703},[533,821,822],{},"  const delta = chunk.choices[0]?.delta?.content;\n",[533,824,825],{"class":535,"line":709},[533,826,827],{},"  if (delta) process.stdout.write(delta);\n",[533,829,830],{"class":535,"line":715},[533,831,832],{},"}\n",[520,834,836],{"label":835},"Go",[524,837,841],{"className":838,"code":839,"language":840,"meta":529,"style":529},"language-go shiki shiki-themes github-light github-dark","\u002F\u002F Standard library only\npackage main\n\nimport (\n    \"bufio\"\n    \"bytes\"\n    \"encoding\u002Fjson\"\n    \"fmt\"\n    \"net\u002Fhttp\"\n    \"os\"\n    \"strings\"\n)\n\nfunc main() {\n    payload := []byte(`{\n        \"model\": \"minimax-m2.5\",\n        \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n        \"stream\": true\n    }`)\n\n    req, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions\", bytes.NewReader(payload))\n    if err != nil {\n        panic(err)\n    }\n    req.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"SILVAMUX_API_KEY\"))\n    req.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n\n    resp, err := http.DefaultClient.Do(req)\n    if err != nil {\n        panic(err)\n    }\n    defer resp.Body.Close()\n\n    scanner := bufio.NewScanner(resp.Body)\n    for scanner.Scan() {\n        line := scanner.Text()\n        if !strings.HasPrefix(line, \"data: \") {\n            continue\n        }\n        data := strings.TrimPrefix(line, \"data: \")\n        if data == \"[DONE]\" {\n            break\n        }\n        var chunk struct {\n            Choices []struct {\n                Delta struct {\n                    Content string `json:\"content\"`\n                } `json:\"delta\"`\n            } `json:\"choices\"`\n        }\n        if err := json.Unmarshal([]byte(data), &chunk); err != nil {\n            continue\n        }\n        if len(chunk.Choices) > 0 {\n            fmt.Print(chunk.Choices[0].Delta.Content)\n        }\n    }\n}\n","go",[225,842,843,848,853,857,862,867,872,877,882,887,892,897,901,905,910,915,920,925,930,935,939,944,950,956,962,968,974,979,985,990,995,1000,1006,1011,1017,1023,1029,1035,1041,1047,1053,1059,1065,1070,1076,1082,1088,1094,1100,1106,1111,1117,1122,1127,1133,1139,1144,1149],{"__ignoreMap":529},[533,844,845],{"class":535,"line":536},[533,846,847],{},"\u002F\u002F Standard library only\n",[533,849,850],{"class":535,"line":551},[533,851,852],{},"package main\n",[533,854,855],{"class":535,"line":569},[533,856,640],{"emptyLinePlaceholder":639},[533,858,859],{"class":535,"line":579},[533,860,861],{},"import (\n",[533,863,864],{"class":535,"line":588},[533,865,866],{},"    \"bufio\"\n",[533,868,869],{"class":535,"line":594},[533,870,871],{},"    \"bytes\"\n",[533,873,874],{"class":535,"line":600},[533,875,876],{},"    \"encoding\u002Fjson\"\n",[533,878,879],{"class":535,"line":606},[533,880,881],{},"    \"fmt\"\n",[533,883,884],{"class":535,"line":663},[533,885,886],{},"    \"net\u002Fhttp\"\n",[533,888,889],{"class":535,"line":668},[533,890,891],{},"    \"os\"\n",[533,893,894],{"class":535,"line":674},[533,895,896],{},"    \"strings\"\n",[533,898,899],{"class":535,"line":680},[533,900,660],{},[533,902,903],{"class":535,"line":686},[533,904,640],{"emptyLinePlaceholder":639},[533,906,907],{"class":535,"line":692},[533,908,909],{},"func main() {\n",[533,911,912],{"class":535,"line":697},[533,913,914],{},"    payload := []byte(`{\n",[533,916,917],{"class":535,"line":703},[533,918,919],{},"        \"model\": \"minimax-m2.5\",\n",[533,921,922],{"class":535,"line":709},[533,923,924],{},"        \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n",[533,926,927],{"class":535,"line":715},[533,928,929],{},"        \"stream\": true\n",[533,931,932],{"class":535,"line":721},[533,933,934],{},"    }`)\n",[533,936,937],{"class":535,"line":727},[533,938,640],{"emptyLinePlaceholder":639},[533,940,941],{"class":535,"line":733},[533,942,943],{},"    req, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions\", bytes.NewReader(payload))\n",[533,945,947],{"class":535,"line":946},22,[533,948,949],{},"    if err != nil {\n",[533,951,953],{"class":535,"line":952},23,[533,954,955],{},"        panic(err)\n",[533,957,959],{"class":535,"line":958},24,[533,960,961],{},"    }\n",[533,963,965],{"class":535,"line":964},25,[533,966,967],{},"    req.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"SILVAMUX_API_KEY\"))\n",[533,969,971],{"class":535,"line":970},26,[533,972,973],{},"    req.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n",[533,975,977],{"class":535,"line":976},27,[533,978,640],{"emptyLinePlaceholder":639},[533,980,982],{"class":535,"line":981},28,[533,983,984],{},"    resp, err := http.DefaultClient.Do(req)\n",[533,986,988],{"class":535,"line":987},29,[533,989,949],{},[533,991,993],{"class":535,"line":992},30,[533,994,955],{},[533,996,998],{"class":535,"line":997},31,[533,999,961],{},[533,1001,1003],{"class":535,"line":1002},32,[533,1004,1005],{},"    defer resp.Body.Close()\n",[533,1007,1009],{"class":535,"line":1008},33,[533,1010,640],{"emptyLinePlaceholder":639},[533,1012,1014],{"class":535,"line":1013},34,[533,1015,1016],{},"    scanner := bufio.NewScanner(resp.Body)\n",[533,1018,1020],{"class":535,"line":1019},35,[533,1021,1022],{},"    for scanner.Scan() {\n",[533,1024,1026],{"class":535,"line":1025},36,[533,1027,1028],{},"        line := scanner.Text()\n",[533,1030,1032],{"class":535,"line":1031},37,[533,1033,1034],{},"        if !strings.HasPrefix(line, \"data: \") {\n",[533,1036,1038],{"class":535,"line":1037},38,[533,1039,1040],{},"            continue\n",[533,1042,1044],{"class":535,"line":1043},39,[533,1045,1046],{},"        }\n",[533,1048,1050],{"class":535,"line":1049},40,[533,1051,1052],{},"        data := strings.TrimPrefix(line, \"data: \")\n",[533,1054,1056],{"class":535,"line":1055},41,[533,1057,1058],{},"        if data == \"[DONE]\" {\n",[533,1060,1062],{"class":535,"line":1061},42,[533,1063,1064],{},"            break\n",[533,1066,1068],{"class":535,"line":1067},43,[533,1069,1046],{},[533,1071,1073],{"class":535,"line":1072},44,[533,1074,1075],{},"        var chunk struct {\n",[533,1077,1079],{"class":535,"line":1078},45,[533,1080,1081],{},"            Choices []struct {\n",[533,1083,1085],{"class":535,"line":1084},46,[533,1086,1087],{},"                Delta struct {\n",[533,1089,1091],{"class":535,"line":1090},47,[533,1092,1093],{},"                    Content string `json:\"content\"`\n",[533,1095,1097],{"class":535,"line":1096},48,[533,1098,1099],{},"                } `json:\"delta\"`\n",[533,1101,1103],{"class":535,"line":1102},49,[533,1104,1105],{},"            } `json:\"choices\"`\n",[533,1107,1109],{"class":535,"line":1108},50,[533,1110,1046],{},[533,1112,1114],{"class":535,"line":1113},51,[533,1115,1116],{},"        if err := json.Unmarshal([]byte(data), &chunk); err != nil {\n",[533,1118,1120],{"class":535,"line":1119},52,[533,1121,1040],{},[533,1123,1125],{"class":535,"line":1124},53,[533,1126,1046],{},[533,1128,1130],{"class":535,"line":1129},54,[533,1131,1132],{},"        if len(chunk.Choices) > 0 {\n",[533,1134,1136],{"class":535,"line":1135},55,[533,1137,1138],{},"            fmt.Print(chunk.Choices[0].Delta.Content)\n",[533,1140,1142],{"class":535,"line":1141},56,[533,1143,1046],{},[533,1145,1147],{"class":535,"line":1146},57,[533,1148,961],{},[533,1150,1152],{"class":535,"line":1151},58,[533,1153,832],{},[187,1155,1157],{"id":1156},"multimodal","Multimodal",[174,1159,1160,1161,476],{},"For image, audio, and other multimodal input formats, see ",[231,1162,127],{"href":1163},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fmultimodal",[1165,1166,1167],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":529,"searchDepth":551,"depth":551,"links":1169},[1170,1173,1174,1175,1176],{"id":189,"depth":551,"text":190,"children":1171},[1172],{"id":338,"depth":569,"text":339},{"id":350,"depth":551,"text":351},{"id":479,"depth":551,"text":480},{"id":491,"depth":551,"text":492},{"id":1156,"depth":551,"text":1157},"Unified entry and OpenAI, Anthropic, Volcengine, Responses, and Zhipu compatible entries.","md",{},"---\ntitle: Overview\ndescription: Unified entry and OpenAI, Anthropic, Volcengine, Responses, and Zhipu compatible entries.\n---\n\n# Text Generation Models\n\nSilvaMux 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.\n\n## Vendor Protocol Compatible Entries (Recommended)\n\nThe 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.\n\n| Compatible format | Endpoint | Docs |\n| --- | --- | --- |\n| OpenAI Chat Completions | `POST \u002Fapi\u002Fv1\u002Fchat\u002Fcompletions` | [OpenAI Compatible API](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fopenai) |\n| Anthropic | `POST \u002Fapi\u002Fv1\u002Fmessages` | [Anthropic Compatible](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fanthropic) |\n| Volcengine v3 | `POST \u002Fapi\u002Fv3\u002Fchat\u002Fcompletions` | [Volcengine Compatible](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fvolcengine) |\n| Zhipu | `POST \u002Fapi\u002Fpaas\u002Fv4\u002Fchat\u002Fcompletions` | [Zhipu Compatible](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fzhipu) |\n| SilvaMux unified entry | `POST \u002Fapi\u002Fv0\u002Fchat\u002Fcompletions` | [SilvaMux Unified Entry](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Funified) |\n| Responses | `POST \u002Fapi\u002Fv1\u002Fresponses` | Compatible with the OpenAI Responses API; for supported models (e.g. the codex series) |\n| Gemini | `POST \u002Fapi\u002Fv1beta\u002Fmodels\u002F{model}:generateContent` | Compatible with the Gemini `generateContent` format; no publicly discoverable models currently, so no executable example |\n\nThese 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 `\u002Fapi\u002Fanthropic\u002Fv1\u002Fmessages` and `\u002Fapi\u002Fv1\u002Fgemini\u002Fv1beta\u002Fmodels\u002F{model}:generateContent` remain only for existing projects and should not be used by new ones.\n\n### OpenAI Responses\n\nCompatible with the OpenAI Responses API; for supported models (e.g. the codex series):\n\n::api-endpoint{path=\"\u002Fapi\u002Fv1\u002Fresponses\" method=\"POST\"}\n::\n\n## Common Parameters\n\nCommon parameters for OpenAI Chat and the unified entry:\n\n| Parameter | Type | Description |\n| --- | --- | --- |\n| `model` | string | Required. Model call name (`id` or `alias`), e.g. `minimax-m2.5`, `doubao-seed-2.0-pro` |\n| `messages` | array | Required. Message list, same shape as OpenAI (`role` + `content`) |\n| `stream` | boolean | Whether to stream the response; default `false` |\n| `temperature` | number | Sampling temperature; default 1.0 |\n| `max_tokens` | integer | Maximum generated tokens |\n\n> Field structures differ per vendor protocol. First filter the [Model Plaza](\u002Fen\u002Fmodels) for models supporting your target format, then copy the call name from the detail page into `model`.\n\n## Authentication\n\n`Authorization: Bearer \u003CAPI_KEY>` or `x-api-key: \u003CAPI_KEY>`.\n\n## Streaming\n\nSet `stream: true` to get a streaming response (SSE). The response is `text\u002Fevent-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.\n\n::code-tabs\n:::code-tab{label=\"cURL\"}\n```bash\ncurl https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer $SILVAMUX_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"minimax-m2.5\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n    \"stream\": true\n  }'\n```\n:::\n:::code-tab{label=\"Python\"}\n```python\n# pip install openai\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"SILVAMUX_API_KEY\"],\n    base_url=\"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n)\n\nstream = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n    stream=True,\n)\nfor chunk in stream:\n    if chunk.choices:\n        delta = chunk.choices[0].delta.content\n        if delta:\n            print(delta, end=\"\", flush=True)\n    if chunk.usage:\n        print(f\"\\nUsage: {chunk.usage}\")\n```\n:::\n:::code-tab{label=\"JavaScript\"}\n```javascript\n\u002F\u002F npm install openai\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({\n  apiKey: process.env.SILVAMUX_API_KEY,\n  baseURL: \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n});\n\nconst stream = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Write a short poem\" }],\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  const delta = chunk.choices[0]?.delta?.content;\n  if (delta) process.stdout.write(delta);\n}\n```\n:::\n:::code-tab{label=\"Go\"}\n```go\n\u002F\u002F Standard library only\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding\u002Fjson\"\n\t\"fmt\"\n\t\"net\u002Fhttp\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tpayload := []byte(`{\n\t\t\"model\": \"minimax-m2.5\",\n\t\t\"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n\t\t\"stream\": true\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions\", bytes.NewReader(payload))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"SILVAMUX_API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tscanner := bufio.NewScanner(resp.Body)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tif !strings.HasPrefix(line, \"data: \") {\n\t\t\tcontinue\n\t\t}\n\t\tdata := strings.TrimPrefix(line, \"data: \")\n\t\tif data == \"[DONE]\" {\n\t\t\tbreak\n\t\t}\n\t\tvar chunk struct {\n\t\t\tChoices []struct {\n\t\t\t\tDelta struct {\n\t\t\t\t\tContent string `json:\"content\"`\n\t\t\t\t} `json:\"delta\"`\n\t\t\t} `json:\"choices\"`\n\t\t}\n\t\tif err := json.Unmarshal([]byte(data), &chunk); err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif len(chunk.Choices) > 0 {\n\t\t\tfmt.Print(chunk.Choices[0].Delta.Content)\n\t\t}\n\t}\n}\n```\n:::\n::\n\n## Multimodal\n\nFor image, audio, and other multimodal input formats, see [Multimodal Input](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Fmultimodal).\n",[],{"title":103,"description":1177},"dKCYCB7GsLejZ4aqYQEUYQOvf7BkK6Hv4ydhXULinRs",{"found":639,"operationId":1185,"summary":339,"description":529,"method":346,"path":347,"publiclyDiscoverable":639,"security":1186,"parameters":1190,"requestBody":1191,"responses":1202},"createOpenAIResponse",{"schemes":1187,"optional":43},[1188,1189],"BearerAuth","ApiKeyAuth",[],{"present":639,"required":639,"description":529,"contentType":1192,"type":1193,"fields":1194,"variants":1201},"application\u002Fjson","ResponsesRequest",[1195,1198,1200],{"name":1196,"type":1197,"required":639,"description":529},"input","string | array\u003CFreeFormObject>",{"name":378,"type":381,"required":639,"description":1199},"从模型广场选择标注支持 OpenAI Responses 的模型并复制调用名。",{"name":427,"type":430,"required":43,"description":529,"defaultValue":436},[],[1203,1208],{"status":1204,"description":1205,"contentType":1192,"type":1206,"fields":1207},"200","Responses JSON 或 SSE 响应。","FreeFormObject",[],{"status":1209,"description":1210,"contentType":1192,"type":1211,"fields":1212},"default","OpenAI 兼容错误。","OpenAIError",[1213,1216,1219,1221],{"name":1214,"type":1215,"required":639,"description":529},"error","object",{"name":1217,"type":1218,"required":43,"description":529},"error.code","string | integer",{"name":1220,"type":381,"required":639,"description":529},"error.message",{"name":1222,"type":381,"required":43,"description":529},"error.type"]