[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs-nav-en":3,"docs-en-models\u002Fchat\u002Funified":180,"$frtdsVwoDRU794LJrfL71HeTMjkaPETQWALXSWQmo__0":668},[4,26,43,105,155,172,176],{"title":5,"path":6,"stem":7,"children":8,"page":25},"Getting Started","\u002Fgetting-started","1.getting-started",[9,13,17,21],{"title":10,"path":11,"stem":12},"Your First SilvaMux API Call","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F1.quick-start",{"title":14,"path":15,"stem":16},"Model Selection","\u002Fgetting-started\u002Fmodel-selection","1.getting-started\u002F2.model-selection",{"title":18,"path":19,"stem":20},"Rate Limits","\u002Fgetting-started\u002Frate-limits","1.getting-started\u002F3.rate-limits",{"title":22,"path":23,"stem":24},"FAQ","\u002Fgetting-started\u002Ffaq","1.getting-started\u002F4.faq",false,{"title":27,"path":28,"stem":29,"children":30,"page":25},"Billing","\u002Fbilling","2.billing",[31,35,39],{"title":32,"path":33,"stem":34},"Billing Overview","\u002Fbilling\u002Foverview","2.billing\u002F1.overview",{"title":36,"path":37,"stem":38},"Online Top-up","\u002Fbilling\u002Frecharge","2.billing\u002F2.recharge",{"title":40,"path":41,"stem":42},"Bills, Usage & Exports","\u002Fbilling\u002Fusage-export","2.billing\u002F3.usage-export",{"title":44,"path":45,"stem":46,"children":47,"page":25},"Coding Plan","\u002Fcoding-plan","3.coding-plan",[48,52,56,60,67,102],{"title":49,"path":50,"stem":51},"Coding Plan Overview","\u002Fcoding-plan\u002Foverview","3.coding-plan\u002F1.overview",{"title":53,"path":54,"stem":55},"Quick Start","\u002Fcoding-plan\u002Fquick-start","3.coding-plan\u002F2.quick-start",{"title":57,"path":58,"stem":59},"Usage Notes","\u002Fcoding-plan\u002Fusage-notes","3.coding-plan\u002F3.usage-notes",{"title":61,"path":62,"stem":63,"children":64},"Personal","\u002Fcoding-plan\u002Fpersonal","3.coding-plan\u002F4.personal\u002Findex",[65],{"title":66,"path":62,"stem":63},"Pricing & Benefits",{"title":68,"path":69,"stem":70,"children":71,"page":-1},"Developer Guide","\u002Fcoding-plan\u002Fguide","3.coding-plan\u002F5.guide\u002Findex",[72,74,78,82,86,90,94,98],{"title":73,"path":69,"stem":70},"Endpoints & Protocols",{"title":75,"path":76,"stem":77},"Claude Code","\u002Fcoding-plan\u002Fguide\u002Fclaude-code","3.coding-plan\u002F5.guide\u002F1.claude-code",{"title":79,"path":80,"stem":81},"OpenCode","\u002Fcoding-plan\u002Fguide\u002Fopencode","3.coding-plan\u002F5.guide\u002F2.opencode",{"title":83,"path":84,"stem":85},"Cursor","\u002Fcoding-plan\u002Fguide\u002Fcursor","3.coding-plan\u002F5.guide\u002F3.cursor",{"title":87,"path":88,"stem":89},"Codex","\u002Fcoding-plan\u002Fguide\u002Fcodex","3.coding-plan\u002F5.guide\u002F4.codex",{"title":91,"path":92,"stem":93},"ZCode","\u002Fcoding-plan\u002Fguide\u002Fzcode","3.coding-plan\u002F5.guide\u002F5.zcode",{"title":95,"path":96,"stem":97},"TRAE","\u002Fcoding-plan\u002Fguide\u002Ftrae","3.coding-plan\u002F5.guide\u002F6.trae",{"title":99,"path":100,"stem":101},"CodeBuddy","\u002Fcoding-plan\u002Fguide\u002Fcodebuddy","3.coding-plan\u002F5.guide\u002F7.codebuddy",{"title":22,"path":103,"stem":104},"\u002Fcoding-plan\u002Ffaq","3.coding-plan\u002F6.faq",{"title":106,"path":107,"stem":108,"children":109,"page":25},"Model APIs","\u002Fmodels","4.models",[110,143],{"title":111,"path":112,"stem":113,"children":114,"page":25},"Text Generation Model API","\u002Fmodels\u002Fchat","4.models\u002F1.chat",[115,119,123,127,131,135,139],{"title":116,"path":117,"stem":118},"Overview","\u002Fmodels\u002Fchat\u002Foverview","4.models\u002F1.chat\u002F1.overview",{"title":120,"path":121,"stem":122},"OpenAI Compatible API","\u002Fmodels\u002Fchat\u002Fopenai","4.models\u002F1.chat\u002F2.openai",{"title":124,"path":125,"stem":126},"Anthropic Compatible","\u002Fmodels\u002Fchat\u002Fanthropic","4.models\u002F1.chat\u002F3.anthropic",{"title":128,"path":129,"stem":130},"Volcengine Compatible","\u002Fmodels\u002Fchat\u002Fvolcengine","4.models\u002F1.chat\u002F4.volcengine",{"title":132,"path":133,"stem":134},"Zhipu Compatible","\u002Fmodels\u002Fchat\u002Fzhipu","4.models\u002F1.chat\u002F5.zhipu",{"title":136,"path":137,"stem":138},"SilvaMux Unified Entry","\u002Fmodels\u002Fchat\u002Funified","4.models\u002F1.chat\u002F6.unified",{"title":140,"path":141,"stem":142},"Multimodal Input","\u002Fmodels\u002Fchat\u002Fmultimodal","4.models\u002F1.chat\u002F7.multimodal",{"title":144,"path":145,"stem":146,"children":147,"page":25},"Image Generation Model API","\u002Fmodels\u002Fimages","4.models\u002F2.images",[148,151],{"title":116,"path":149,"stem":150},"\u002Fmodels\u002Fimages\u002Foverview","4.models\u002F2.images\u002F1.overview",{"title":152,"path":153,"stem":154},"Image Generation API","\u002Fmodels\u002Fimages\u002Fgeneration","4.models\u002F2.images\u002F2.generation",{"title":156,"path":157,"stem":158,"children":159,"page":25},"Usage & Balance","\u002Fusage-and-balance","5.usage-and-balance",[160,164,168],{"title":161,"path":162,"stem":163},"Query Balance","\u002Fusage-and-balance\u002Fbalance","5.usage-and-balance\u002F1.balance",{"title":165,"path":166,"stem":167},"Query Usage","\u002Fusage-and-balance\u002Fusage","5.usage-and-balance\u002F2.usage",{"title":169,"path":170,"stem":171},"Query Request Usage","\u002Fusage-and-balance\u002Frequest-usage","5.usage-and-balance\u002F3.request-usage",{"title":173,"path":174,"stem":175},"Error Codes","\u002Ferrors","6.errors",{"title":177,"path":178,"stem":179},"Getting Started with SilvaMux","\u002F","index",{"id":181,"title":136,"body":182,"description":661,"extension":662,"meta":663,"navigation":325,"path":137,"rawbody":664,"requiredFlags":665,"seo":666,"stem":138,"__hash__":667},"docs_en\u002F4.models\u002F1.chat\u002F6.unified.md",{"type":183,"value":184,"toc":658},"minimark",[185,189,198,203,208,647,654],[186,187,136],"h1",{"id":188},"silvamux-unified-entry",[190,191,192,193,197],"p",{},"An optional cross-protocol unified entry. It accepts the OpenAI Chat format, picks the upstream automatically based on ",[194,195,196],"code",{},"model",", and normalizes responses, SSE, and errors into the OpenAI Chat format. Useful when you want to call models across protocols through a single endpoint.",[199,200],"api-endpoint",{"method":201,"path":202},"POST","\u002Fapi\u002Fv0\u002Fchat\u002Fcompletions",[204,205,207],"h2",{"id":206},"examples","Examples",[209,210,211,296,387,463],"code-tabs",{},[212,213,215],"code-tab",{"label":214},"cURL",[216,217,222],"pre",{"className":218,"code":219,"language":220,"meta":221,"style":221},"language-bash shiki shiki-themes github-light github-dark","curl https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\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\": \"Hello\"}]\n  }'\n","bash","",[194,223,224,241,259,269,278,284,290],{"__ignoreMap":221},[225,226,229,233,237],"span",{"class":227,"line":228},"line",1,[225,230,232],{"class":231},"sScJk","curl",[225,234,236],{"class":235},"sZZnC"," https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\u002Fchat\u002Fcompletions",[225,238,240],{"class":239},"sj4cs"," \\\n",[225,242,244,247,250,254,257],{"class":227,"line":243},2,[225,245,246],{"class":239},"  -H",[225,248,249],{"class":235}," \"Authorization: Bearer ",[225,251,253],{"class":252},"sVt8B","$SILVAMUX_API_KEY",[225,255,256],{"class":235},"\"",[225,258,240],{"class":239},[225,260,262,264,267],{"class":227,"line":261},3,[225,263,246],{"class":239},[225,265,266],{"class":235}," \"Content-Type: application\u002Fjson\"",[225,268,240],{"class":239},[225,270,272,275],{"class":227,"line":271},4,[225,273,274],{"class":239},"  -d",[225,276,277],{"class":235}," '{\n",[225,279,281],{"class":227,"line":280},5,[225,282,283],{"class":235},"    \"model\": \"minimax-m2.5\",\n",[225,285,287],{"class":227,"line":286},6,[225,288,289],{"class":235},"    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n",[225,291,293],{"class":227,"line":292},7,[225,294,295],{"class":235},"  }'\n",[212,297,299],{"label":298},"Python",[216,300,304],{"className":301,"code":302,"language":303,"meta":221,"style":221},"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\u002Fv0\",\n)\n\nresponse = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n)\n\nprint(response.choices[0].message.content)\n","python",[194,305,306,311,316,321,327,332,337,342,348,353,359,365,371,376,381],{"__ignoreMap":221},[225,307,308],{"class":227,"line":228},[225,309,310],{},"# pip install openai\n",[225,312,313],{"class":227,"line":243},[225,314,315],{},"import os\n",[225,317,318],{"class":227,"line":261},[225,319,320],{},"from openai import OpenAI\n",[225,322,323],{"class":227,"line":271},[225,324,326],{"emptyLinePlaceholder":325},true,"\n",[225,328,329],{"class":227,"line":280},[225,330,331],{},"client = OpenAI(\n",[225,333,334],{"class":227,"line":286},[225,335,336],{},"    api_key=os.environ[\"SILVAMUX_API_KEY\"],\n",[225,338,339],{"class":227,"line":292},[225,340,341],{},"    base_url=\"https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\",\n",[225,343,345],{"class":227,"line":344},8,[225,346,347],{},")\n",[225,349,351],{"class":227,"line":350},9,[225,352,326],{"emptyLinePlaceholder":325},[225,354,356],{"class":227,"line":355},10,[225,357,358],{},"response = client.chat.completions.create(\n",[225,360,362],{"class":227,"line":361},11,[225,363,364],{},"    model=\"minimax-m2.5\",\n",[225,366,368],{"class":227,"line":367},12,[225,369,370],{},"    messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n",[225,372,374],{"class":227,"line":373},13,[225,375,347],{},[225,377,379],{"class":227,"line":378},14,[225,380,326],{"emptyLinePlaceholder":325},[225,382,384],{"class":227,"line":383},15,[225,385,386],{},"print(response.choices[0].message.content)\n",[212,388,390],{"label":389},"JavaScript",[216,391,395],{"className":392,"code":393,"language":394,"meta":221,"style":221},"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\u002Fv0\",\n});\n\nconst response = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Hello\" }],\n});\n\nconsole.log(response.choices[0].message.content);\n","javascript",[194,396,397,402,407,411,416,421,426,431,435,440,445,450,454,458],{"__ignoreMap":221},[225,398,399],{"class":227,"line":228},[225,400,401],{},"\u002F\u002F npm install openai\n",[225,403,404],{"class":227,"line":243},[225,405,406],{},"import OpenAI from \"openai\";\n",[225,408,409],{"class":227,"line":261},[225,410,326],{"emptyLinePlaceholder":325},[225,412,413],{"class":227,"line":271},[225,414,415],{},"const client = new OpenAI({\n",[225,417,418],{"class":227,"line":280},[225,419,420],{},"  apiKey: process.env.SILVAMUX_API_KEY,\n",[225,422,423],{"class":227,"line":286},[225,424,425],{},"  baseURL: \"https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\",\n",[225,427,428],{"class":227,"line":292},[225,429,430],{},"});\n",[225,432,433],{"class":227,"line":344},[225,434,326],{"emptyLinePlaceholder":325},[225,436,437],{"class":227,"line":350},[225,438,439],{},"const response = await client.chat.completions.create({\n",[225,441,442],{"class":227,"line":355},[225,443,444],{},"  model: \"minimax-m2.5\",\n",[225,446,447],{"class":227,"line":361},[225,448,449],{},"  messages: [{ role: \"user\", content: \"Hello\" }],\n",[225,451,452],{"class":227,"line":367},[225,453,430],{},[225,455,456],{"class":227,"line":373},[225,457,326],{"emptyLinePlaceholder":325},[225,459,460],{"class":227,"line":378},[225,461,462],{},"console.log(response.choices[0].message.content);\n",[212,464,466],{"label":465},"Go",[216,467,471],{"className":468,"code":469,"language":470,"meta":221,"style":221},"language-go shiki shiki-themes github-light github-dark","\u002F\u002F Standard library only\npackage main\n\nimport (\n    \"bytes\"\n    \"fmt\"\n    \"io\"\n    \"net\u002Fhttp\"\n    \"os\"\n)\n\nfunc main() {\n    payload := []byte(`{\n        \"model\": \"minimax-m2.5\",\n        \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n    }`)\n\n    req, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\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    body, _ := io.ReadAll(resp.Body)\n    fmt.Println(string(body))\n}\n","go",[194,472,473,478,483,487,492,497,502,507,512,517,521,525,530,535,540,545,551,556,562,568,574,580,586,592,597,603,608,613,618,624,629,635,641],{"__ignoreMap":221},[225,474,475],{"class":227,"line":228},[225,476,477],{},"\u002F\u002F Standard library only\n",[225,479,480],{"class":227,"line":243},[225,481,482],{},"package main\n",[225,484,485],{"class":227,"line":261},[225,486,326],{"emptyLinePlaceholder":325},[225,488,489],{"class":227,"line":271},[225,490,491],{},"import (\n",[225,493,494],{"class":227,"line":280},[225,495,496],{},"    \"bytes\"\n",[225,498,499],{"class":227,"line":286},[225,500,501],{},"    \"fmt\"\n",[225,503,504],{"class":227,"line":292},[225,505,506],{},"    \"io\"\n",[225,508,509],{"class":227,"line":344},[225,510,511],{},"    \"net\u002Fhttp\"\n",[225,513,514],{"class":227,"line":350},[225,515,516],{},"    \"os\"\n",[225,518,519],{"class":227,"line":355},[225,520,347],{},[225,522,523],{"class":227,"line":361},[225,524,326],{"emptyLinePlaceholder":325},[225,526,527],{"class":227,"line":367},[225,528,529],{},"func main() {\n",[225,531,532],{"class":227,"line":373},[225,533,534],{},"    payload := []byte(`{\n",[225,536,537],{"class":227,"line":378},[225,538,539],{},"        \"model\": \"minimax-m2.5\",\n",[225,541,542],{"class":227,"line":383},[225,543,544],{},"        \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n",[225,546,548],{"class":227,"line":547},16,[225,549,550],{},"    }`)\n",[225,552,554],{"class":227,"line":553},17,[225,555,326],{"emptyLinePlaceholder":325},[225,557,559],{"class":227,"line":558},18,[225,560,561],{},"    req, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\u002Fchat\u002Fcompletions\", bytes.NewReader(payload))\n",[225,563,565],{"class":227,"line":564},19,[225,566,567],{},"    if err != nil {\n",[225,569,571],{"class":227,"line":570},20,[225,572,573],{},"        panic(err)\n",[225,575,577],{"class":227,"line":576},21,[225,578,579],{},"    }\n",[225,581,583],{"class":227,"line":582},22,[225,584,585],{},"    req.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"SILVAMUX_API_KEY\"))\n",[225,587,589],{"class":227,"line":588},23,[225,590,591],{},"    req.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n",[225,593,595],{"class":227,"line":594},24,[225,596,326],{"emptyLinePlaceholder":325},[225,598,600],{"class":227,"line":599},25,[225,601,602],{},"    resp, err := http.DefaultClient.Do(req)\n",[225,604,606],{"class":227,"line":605},26,[225,607,567],{},[225,609,611],{"class":227,"line":610},27,[225,612,573],{},[225,614,616],{"class":227,"line":615},28,[225,617,579],{},[225,619,621],{"class":227,"line":620},29,[225,622,623],{},"    defer resp.Body.Close()\n",[225,625,627],{"class":227,"line":626},30,[225,628,326],{"emptyLinePlaceholder":325},[225,630,632],{"class":227,"line":631},31,[225,633,634],{},"    body, _ := io.ReadAll(resp.Body)\n",[225,636,638],{"class":227,"line":637},32,[225,639,640],{},"    fmt.Println(string(body))\n",[225,642,644],{"class":227,"line":643},33,[225,645,646],{},"}\n",[648,649,651],"alert",{"type":650},"warning",[190,652,653],{},"The unified entry normalizes request and response structures. When you need vendor-specific fields, events, or response shapes, prefer the corresponding vendor protocol compatible entry.",[655,656,657],"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":221,"searchDepth":243,"depth":243,"links":659},[660],{"id":206,"depth":243,"text":207},"Cross-protocol unified entry — OpenAI Chat format in and out, automatic upstream selection.","md",{},"---\ntitle: SilvaMux Unified Entry\ndescription: Cross-protocol unified entry — OpenAI Chat format in and out, automatic upstream selection.\n---\n\n# SilvaMux Unified Entry\n\nAn optional cross-protocol unified entry. It accepts the OpenAI Chat format, picks the upstream automatically based on `model`, and normalizes responses, SSE, and errors into the OpenAI Chat format. Useful when you want to call models across protocols through a single endpoint.\n\n::api-endpoint{path=\"\u002Fapi\u002Fv0\u002Fchat\u002Fcompletions\" method=\"POST\"}\n::\n\n## Examples\n\n::code-tabs\n:::code-tab{label=\"cURL\"}\n```bash\ncurl https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\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\": \"Hello\"}]\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\u002Fv0\",\n)\n\nresponse = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello\"}],\n)\n\nprint(response.choices[0].message.content)\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\u002Fv0\",\n});\n\nconst response = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Hello\" }],\n});\n\nconsole.log(response.choices[0].message.content);\n```\n:::\n:::code-tab{label=\"Go\"}\n```go\n\u002F\u002F Standard library only\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\u002Fhttp\"\n\t\"os\"\n)\n\nfunc main() {\n\tpayload := []byte(`{\n\t\t\"model\": \"minimax-m2.5\",\n\t\t\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n\t}`)\n\n\treq, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fsilvamux.io\u002Fapi\u002Fv0\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\tbody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(string(body))\n}\n```\n:::\n::\n\n::alert{type=\"warning\"}\nThe unified entry normalizes request and response structures. When you need vendor-specific fields, events, or response shapes, prefer the corresponding vendor protocol compatible entry.\n::\n",[],{"title":136,"description":661},"_dufHaTcoDqs1ywG5XRBHDFqaxG49MC4KutBv19C0oo",{"found":325,"operationId":669,"summary":670,"description":671,"method":201,"path":202,"publiclyDiscoverable":325,"security":672,"parameters":676,"requestBody":677,"responses":771},"createUnifiedChatCompletion","SilvaMux 统一入口","可选的跨协议统一入口。按 model 选择上游，并将响应、SSE 和错误统一为 OpenAI Chat 格式。",{"schemes":673,"optional":25},[674,675],"BearerAuth","ApiKeyAuth",[],{"present":325,"required":325,"description":221,"contentType":678,"type":679,"fields":680,"variants":770},"application\u002Fjson","OpenAIChatRequest",[681,685,689,693,697,701,704,708,711,714,717,720,723,725,728,731,735,740,744,748,752,754,757,759,762,764,767],{"name":682,"type":683,"required":25,"description":684},"max_tokens","integer","生成的最大 token 数；达到限制时输出可能被截断。",{"name":686,"type":687,"required":325,"description":688},"messages","array\u003CMessage>","对话消息列表（按时间顺序，至少一条），提供完整上下文。",{"name":690,"type":691,"required":325,"description":692},"messages.content","string | array\u003CContentPart>","消息内容：纯文本字符串或多模态分段数组（图片 \u002F 音频）。不能只包含 system 或 assistant 消息。",{"name":694,"type":695,"required":25,"description":696},"messages.name","string","参与者名称（可选）。",{"name":698,"type":699,"required":325,"description":700},"messages.role","string (system | user | assistant | tool)","消息角色：system 设定行为与人设，user 用户输入，assistant 模型回复，tool 工具执行结果。",{"name":702,"type":695,"required":25,"description":703},"messages.tool_call_id","role=tool 时对应的工具调用 ID。",{"name":705,"type":706,"required":25,"description":707},"messages.tool_calls","array\u003CToolCall>","模型发起的工具调用（出现在 assistant 历史消息中）。",{"name":709,"type":710,"required":325,"description":221},"messages.tool_calls.function","object",{"name":712,"type":695,"required":325,"description":713},"messages.tool_calls.function.arguments","JSON 编码的函数参数。",{"name":715,"type":695,"required":325,"description":716},"messages.tool_calls.function.name","函数名。",{"name":718,"type":695,"required":325,"description":719},"messages.tool_calls.id","工具调用 ID。",{"name":721,"type":722,"required":325,"description":221},"messages.tool_calls.type","string (function)",{"name":196,"type":695,"required":325,"description":724},"SilvaMux 模型调用名（id 或 alias）。从模型广场模型详情页复制；账号最终可用范围还受组织权限影响。",{"name":726,"type":710,"required":25,"description":727},"response_format","输出格式：text（默认，普通文本）或 json_object（JSON 模式）。",{"name":729,"type":730,"required":25,"description":221},"response_format.type","string (text | json_object)",{"name":732,"type":733,"required":25,"description":734},"stop","string | array\u003Cstring>","停止词：生成文本出现这些字符串时立即停止，最多 4 个。",{"name":736,"type":737,"required":25,"description":738,"defaultValue":739},"stream","boolean","是否启用流式输出（SSE）。false：完整生成后一次性返回；true：实时返回生成内容，结束时以 data: [DONE] 标记（客户端不应仅依赖该标记判断完成）。","false",{"name":741,"type":742,"required":25,"description":743},"temperature","number","采样温度，控制输出随机性：值越高越发散，越低越稳定。建议只调整 temperature 或 top_p 之一。",{"name":745,"type":746,"required":25,"description":747},"tool_choice","string (auto | none) | object","工具选择策略：auto（默认，模型自行决定）\u002F none（禁用）\u002F 指定函数对象。",{"name":749,"type":750,"required":25,"description":751},"tools","array\u003CTool>","可供模型调用的函数定义列表（Function Calling）。",{"name":753,"type":710,"required":325,"description":221},"tools.function",{"name":755,"type":695,"required":25,"description":756},"tools.function.description","函数用途描述，帮助模型决定是否调用。",{"name":758,"type":695,"required":325,"description":716},"tools.function.name",{"name":760,"type":710,"required":25,"description":761},"tools.function.parameters","函数参数的 JSON Schema。",{"name":763,"type":722,"required":325,"description":221},"tools.type",{"name":765,"type":742,"required":25,"description":766},"top_p","核采样参数，temperature 的替代方案。",{"name":768,"type":695,"required":25,"description":769},"user","终端用户标识符，用于滥用检测。",[],[772,832],{"status":773,"description":774,"contentType":678,"type":775,"fields":776},"200","OpenAI Chat JSON 或 SSE 响应。","OpenAIChatResponse",[777,781,785,788,791,794,797,800,803,805,807,809,812,815,817,819,823,826,829],{"name":778,"type":779,"required":325,"description":780},"choices","array\u003COpenAIChatChoice>","候选响应列表。",{"name":782,"type":783,"required":325,"description":784},"choices.finish_reason","string (stop | length | tool_calls | content_filter)","结束原因：stop 自然结束；length 达到 max_tokens；tool_calls 需执行工具；content_filter 触发内容过滤。",{"name":786,"type":683,"required":325,"description":787},"choices.index","候选序号。",{"name":789,"type":710,"required":325,"description":790},"choices.message","助手消息。",{"name":792,"type":695,"required":325,"description":793},"choices.message.content","生成的文本内容；仅工具调用时可为空。",{"name":795,"type":695,"required":25,"description":796},"choices.message.reasoning_content","思考过程内容（支持思考模式的模型返回）。",{"name":798,"type":799,"required":325,"description":221},"choices.message.role","string (assistant | tool)",{"name":801,"type":706,"required":25,"description":802},"choices.message.tool_calls","模型发起的工具调用。",{"name":804,"type":710,"required":325,"description":221},"choices.message.tool_calls.function",{"name":806,"type":695,"required":325,"description":719},"choices.message.tool_calls.id",{"name":808,"type":722,"required":325,"description":221},"choices.message.tool_calls.type",{"name":810,"type":683,"required":25,"description":811},"created","创建时间（Unix 秒）。",{"name":813,"type":695,"required":325,"description":814},"id","请求 ID。",{"name":196,"type":695,"required":25,"description":816},"实际使用的模型名。",{"name":710,"type":695,"required":25,"description":818},"对象类型（如 chat.completion）。",{"name":820,"type":821,"required":25,"description":822},"usage","Usage","Token 用量统计；兼容入口可能透传厂商扩展字段。",{"name":824,"type":683,"required":325,"description":825},"usage.completion_tokens","输出 token 数。",{"name":827,"type":683,"required":325,"description":828},"usage.prompt_tokens","输入 token 数。",{"name":830,"type":683,"required":325,"description":831},"usage.total_tokens","总 token 数。",{"status":833,"description":834,"contentType":678,"type":835,"fields":836},"default","OpenAI 兼容错误。","OpenAIError",[837,839,842,844],{"name":838,"type":710,"required":325,"description":221},"error",{"name":840,"type":841,"required":25,"description":221},"error.code","string | integer",{"name":843,"type":695,"required":325,"description":221},"error.message",{"name":845,"type":695,"required":25,"description":221},"error.type"]