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