[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"docs-nav-en":3,"docs-en-getting-started\u002Fquick-start\u002Ffirst-request":163},[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":27,"body":165,"description":813,"extension":814,"meta":815,"navigation":328,"path":28,"rawbody":816,"requiredFlags":817,"seo":818,"stem":29,"__hash__":819},"docs_en\u002F1.getting-started\u002F1.quick-start\u002F4.first-request.md",{"type":166,"value":167,"toc":808},"minimark",[168,172,194,199,648,652,659,716,731,735,738,796,804],[169,170,27],"h1",{"id":171},"first-request",[173,174,175],"blockquote",{},[176,177,178,187,188,193],"p",{},[179,180,181,182,186],"strong",{},"About the ",[183,184,185],"code",{},"model"," field",": use the call name shown on the ",[189,190,192],"a",{"href":191},"\u002Fen\u002Fmodels","Model Plaza"," detail page, preferring the stable alias. Do not assemble it from display names yourself.",[195,196,198],"h2",{"id":197},"call-examples","Call Examples",[200,201,202,299,388,464],"code-tabs",{},[203,204,206],"code-tab",{"label":205},"cURL",[207,208,213],"pre",{"className":209,"code":210,"language":211,"meta":212,"style":212},"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\": [\n      {\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}\n    ]\n  }'\n","bash","",[183,214,215,232,250,260,269,275,281,287,293],{"__ignoreMap":212},[216,217,220,224,228],"span",{"class":218,"line":219},"line",1,[216,221,223],{"class":222},"sScJk","curl",[216,225,227],{"class":226},"sZZnC"," https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions",[216,229,231],{"class":230},"sj4cs"," \\\n",[216,233,235,238,241,245,248],{"class":218,"line":234},2,[216,236,237],{"class":230},"  -H",[216,239,240],{"class":226}," \"Authorization: Bearer ",[216,242,244],{"class":243},"sVt8B","$SILVAMUX_API_KEY",[216,246,247],{"class":226},"\"",[216,249,231],{"class":230},[216,251,253,255,258],{"class":218,"line":252},3,[216,254,237],{"class":230},[216,256,257],{"class":226}," \"Content-Type: application\u002Fjson\"",[216,259,231],{"class":230},[216,261,263,266],{"class":218,"line":262},4,[216,264,265],{"class":230},"  -d",[216,267,268],{"class":226}," '{\n",[216,270,272],{"class":218,"line":271},5,[216,273,274],{"class":226},"    \"model\": \"minimax-m2.5\",\n",[216,276,278],{"class":218,"line":277},6,[216,279,280],{"class":226},"    \"messages\": [\n",[216,282,284],{"class":218,"line":283},7,[216,285,286],{"class":226},"      {\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}\n",[216,288,290],{"class":218,"line":289},8,[216,291,292],{"class":226},"    ]\n",[216,294,296],{"class":218,"line":295},9,[216,297,298],{"class":226},"  }'\n",[203,300,302],{"label":301},"Python",[207,303,307],{"className":304,"code":305,"language":306,"meta":212,"style":212},"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\nresponse = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}],\n)\n\nprint(response.choices[0].message.content)\n","python",[183,308,309,314,319,324,330,335,340,345,350,354,360,366,372,377,382],{"__ignoreMap":212},[216,310,311],{"class":218,"line":219},[216,312,313],{},"# pip install openai\n",[216,315,316],{"class":218,"line":234},[216,317,318],{},"import os\n",[216,320,321],{"class":218,"line":252},[216,322,323],{},"from openai import OpenAI\n",[216,325,326],{"class":218,"line":262},[216,327,329],{"emptyLinePlaceholder":328},true,"\n",[216,331,332],{"class":218,"line":271},[216,333,334],{},"client = OpenAI(\n",[216,336,337],{"class":218,"line":277},[216,338,339],{},"    api_key=os.environ[\"SILVAMUX_API_KEY\"],\n",[216,341,342],{"class":218,"line":283},[216,343,344],{},"    base_url=\"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n",[216,346,347],{"class":218,"line":289},[216,348,349],{},")\n",[216,351,352],{"class":218,"line":295},[216,353,329],{"emptyLinePlaceholder":328},[216,355,357],{"class":218,"line":356},10,[216,358,359],{},"response = client.chat.completions.create(\n",[216,361,363],{"class":218,"line":362},11,[216,364,365],{},"    model=\"minimax-m2.5\",\n",[216,367,369],{"class":218,"line":368},12,[216,370,371],{},"    messages=[{\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}],\n",[216,373,375],{"class":218,"line":374},13,[216,376,349],{},[216,378,380],{"class":218,"line":379},14,[216,381,329],{"emptyLinePlaceholder":328},[216,383,385],{"class":218,"line":384},15,[216,386,387],{},"print(response.choices[0].message.content)\n",[203,389,391],{"label":390},"JavaScript",[207,392,396],{"className":393,"code":394,"language":395,"meta":212,"style":212},"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 response = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Introduce yourself in one sentence\" }],\n});\n\nconsole.log(response.choices[0].message.content);\n","javascript",[183,397,398,403,408,412,417,422,427,432,436,441,446,451,455,459],{"__ignoreMap":212},[216,399,400],{"class":218,"line":219},[216,401,402],{},"\u002F\u002F npm install openai\n",[216,404,405],{"class":218,"line":234},[216,406,407],{},"import OpenAI from \"openai\";\n",[216,409,410],{"class":218,"line":252},[216,411,329],{"emptyLinePlaceholder":328},[216,413,414],{"class":218,"line":262},[216,415,416],{},"const client = new OpenAI({\n",[216,418,419],{"class":218,"line":271},[216,420,421],{},"  apiKey: process.env.SILVAMUX_API_KEY,\n",[216,423,424],{"class":218,"line":277},[216,425,426],{},"  baseURL: \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n",[216,428,429],{"class":218,"line":283},[216,430,431],{},"});\n",[216,433,434],{"class":218,"line":289},[216,435,329],{"emptyLinePlaceholder":328},[216,437,438],{"class":218,"line":295},[216,439,440],{},"const response = await client.chat.completions.create({\n",[216,442,443],{"class":218,"line":356},[216,444,445],{},"  model: \"minimax-m2.5\",\n",[216,447,448],{"class":218,"line":362},[216,449,450],{},"  messages: [{ role: \"user\", content: \"Introduce yourself in one sentence\" }],\n",[216,452,453],{"class":218,"line":368},[216,454,431],{},[216,456,457],{"class":218,"line":374},[216,458,329],{"emptyLinePlaceholder":328},[216,460,461],{"class":218,"line":379},[216,462,463],{},"console.log(response.choices[0].message.content);\n",[203,465,467],{"label":466},"Go",[207,468,472],{"className":469,"code":470,"language":471,"meta":212,"style":212},"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\": \"Introduce yourself in one sentence\"}]\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    body, _ := io.ReadAll(resp.Body)\n    fmt.Println(string(body))\n}\n","go",[183,473,474,479,484,488,493,498,503,508,513,518,522,526,531,536,541,546,552,557,563,569,575,581,587,593,598,604,609,614,619,625,630,636,642],{"__ignoreMap":212},[216,475,476],{"class":218,"line":219},[216,477,478],{},"\u002F\u002F Standard library only\n",[216,480,481],{"class":218,"line":234},[216,482,483],{},"package main\n",[216,485,486],{"class":218,"line":252},[216,487,329],{"emptyLinePlaceholder":328},[216,489,490],{"class":218,"line":262},[216,491,492],{},"import (\n",[216,494,495],{"class":218,"line":271},[216,496,497],{},"    \"bytes\"\n",[216,499,500],{"class":218,"line":277},[216,501,502],{},"    \"fmt\"\n",[216,504,505],{"class":218,"line":283},[216,506,507],{},"    \"io\"\n",[216,509,510],{"class":218,"line":289},[216,511,512],{},"    \"net\u002Fhttp\"\n",[216,514,515],{"class":218,"line":295},[216,516,517],{},"    \"os\"\n",[216,519,520],{"class":218,"line":356},[216,521,349],{},[216,523,524],{"class":218,"line":362},[216,525,329],{"emptyLinePlaceholder":328},[216,527,528],{"class":218,"line":368},[216,529,530],{},"func main() {\n",[216,532,533],{"class":218,"line":374},[216,534,535],{},"    payload := []byte(`{\n",[216,537,538],{"class":218,"line":379},[216,539,540],{},"        \"model\": \"minimax-m2.5\",\n",[216,542,543],{"class":218,"line":384},[216,544,545],{},"        \"messages\": [{\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}]\n",[216,547,549],{"class":218,"line":548},16,[216,550,551],{},"    }`)\n",[216,553,555],{"class":218,"line":554},17,[216,556,329],{"emptyLinePlaceholder":328},[216,558,560],{"class":218,"line":559},18,[216,561,562],{},"    req, err := http.NewRequest(\"POST\", \"https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fchat\u002Fcompletions\", bytes.NewReader(payload))\n",[216,564,566],{"class":218,"line":565},19,[216,567,568],{},"    if err != nil {\n",[216,570,572],{"class":218,"line":571},20,[216,573,574],{},"        panic(err)\n",[216,576,578],{"class":218,"line":577},21,[216,579,580],{},"    }\n",[216,582,584],{"class":218,"line":583},22,[216,585,586],{},"    req.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"SILVAMUX_API_KEY\"))\n",[216,588,590],{"class":218,"line":589},23,[216,591,592],{},"    req.Header.Set(\"Content-Type\", \"application\u002Fjson\")\n",[216,594,596],{"class":218,"line":595},24,[216,597,329],{"emptyLinePlaceholder":328},[216,599,601],{"class":218,"line":600},25,[216,602,603],{},"    resp, err := http.DefaultClient.Do(req)\n",[216,605,607],{"class":218,"line":606},26,[216,608,568],{},[216,610,612],{"class":218,"line":611},27,[216,613,574],{},[216,615,617],{"class":218,"line":616},28,[216,618,580],{},[216,620,622],{"class":218,"line":621},29,[216,623,624],{},"    defer resp.Body.Close()\n",[216,626,628],{"class":218,"line":627},30,[216,629,329],{"emptyLinePlaceholder":328},[216,631,633],{"class":218,"line":632},31,[216,634,635],{},"    body, _ := io.ReadAll(resp.Body)\n",[216,637,639],{"class":218,"line":638},32,[216,640,641],{},"    fmt.Println(string(body))\n",[216,643,645],{"class":218,"line":644},33,[216,646,647],{},"}\n",[195,649,651],{"id":650},"streaming","Streaming",[176,653,654,655,658],{},"Set ",[183,656,657],{},"stream: true"," to get a streaming response (SSE):",[207,660,662],{"className":209,"code":661,"language":211,"meta":212,"style":212},"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",[183,663,664,672,684,692,698,702,707,712],{"__ignoreMap":212},[216,665,666,668,670],{"class":218,"line":219},[216,667,223],{"class":222},[216,669,227],{"class":226},[216,671,231],{"class":230},[216,673,674,676,678,680,682],{"class":218,"line":234},[216,675,237],{"class":230},[216,677,240],{"class":226},[216,679,244],{"class":243},[216,681,247],{"class":226},[216,683,231],{"class":230},[216,685,686,688,690],{"class":218,"line":252},[216,687,237],{"class":230},[216,689,257],{"class":226},[216,691,231],{"class":230},[216,693,694,696],{"class":218,"line":262},[216,695,265],{"class":230},[216,697,268],{"class":226},[216,699,700],{"class":218,"line":271},[216,701,274],{"class":226},[216,703,704],{"class":218,"line":277},[216,705,706],{"class":226},"    \"messages\": [{\"role\": \"user\", \"content\": \"Write a short poem\"}],\n",[216,708,709],{"class":218,"line":283},[216,710,711],{"class":226},"    \"stream\": true\n",[216,713,714],{"class":218,"line":289},[216,715,298],{"class":226},[176,717,718,719,722,723,726,727,730],{},"The streaming response is Server-Sent Events: each event's ",[183,720,721],{},"data"," field carries one JSON chunk. You may eventually receive a usage chunk with an empty ",[183,724,725],{},"choices",", after which the server closes the connection. Treat the stream end as completion — do not rely solely on ",[183,728,729],{},"data: [DONE]",".",[195,732,734],{"id":733},"using-the-anthropic-format","Using the Anthropic Format",[176,736,737],{},"If you are more familiar with the Anthropic Messages API, SilvaMux supports it as well:",[207,739,741],{"className":209,"code":740,"language":211,"meta":212,"style":212},"curl https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fmessages \\\n  -H \"Authorization: Bearer $SILVAMUX_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"minimax-m2.5\",\n    \"max_tokens\": 1024,\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n  }'\n",[183,742,743,752,764,772,778,782,787,792],{"__ignoreMap":212},[216,744,745,747,750],{"class":218,"line":219},[216,746,223],{"class":222},[216,748,749],{"class":226}," https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fmessages",[216,751,231],{"class":230},[216,753,754,756,758,760,762],{"class":218,"line":234},[216,755,237],{"class":230},[216,757,240],{"class":226},[216,759,244],{"class":243},[216,761,247],{"class":226},[216,763,231],{"class":230},[216,765,766,768,770],{"class":218,"line":252},[216,767,237],{"class":230},[216,769,257],{"class":226},[216,771,231],{"class":230},[216,773,774,776],{"class":218,"line":262},[216,775,265],{"class":230},[216,777,268],{"class":226},[216,779,780],{"class":218,"line":271},[216,781,274],{"class":226},[216,783,784],{"class":218,"line":277},[216,785,786],{"class":226},"    \"max_tokens\": 1024,\n",[216,788,789],{"class":218,"line":283},[216,790,791],{"class":226},"    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n",[216,793,794],{"class":218,"line":289},[216,795,298],{"class":226},[176,797,798,799,803],{},"See ",[189,800,802],{"href":801},"\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Foverview","Text Generation Models"," for more API formats.",[805,806,807],"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":212,"searchDepth":234,"depth":234,"links":809},[810,811,812],{"id":197,"depth":234,"text":198},{"id":650,"depth":234,"text":651},{"id":733,"depth":234,"text":734},"Make your first model call with cURL, Python, JavaScript, or Go, and try streaming.","md",{},"---\ntitle: First Request\ndescription: Make your first model call with cURL, Python, JavaScript, or Go, and try streaming.\n---\n\n# First Request\n\n> **About the `model` field**: use the call name shown on the [Model Plaza](\u002Fen\u002Fmodels) detail page, preferring the stable alias. Do not assemble it from display names yourself.\n\n## Call Examples\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\": [\n      {\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}\n    ]\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\nresponse = client.chat.completions.create(\n    model=\"minimax-m2.5\",\n    messages=[{\"role\": \"user\", \"content\": \"Introduce yourself in one sentence\"}],\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\u002Fwww.silvamux.com\u002Fapi\u002Fv1\",\n});\n\nconst response = await client.chat.completions.create({\n  model: \"minimax-m2.5\",\n  messages: [{ role: \"user\", content: \"Introduce yourself in one sentence\" }],\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\": \"Introduce yourself in one sentence\"}]\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\tbody, _ := io.ReadAll(resp.Body)\n\tfmt.Println(string(body))\n}\n```\n:::\n::\n\n## Streaming\n\nSet `stream: true` to get a streaming response (SSE):\n\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\nThe streaming response is Server-Sent Events: each event's `data` field carries one JSON chunk. You may eventually receive a usage chunk with an empty `choices`, after which the server closes the connection. Treat the stream end as completion — do not rely solely on `data: [DONE]`.\n\n## Using the Anthropic Format\n\nIf you are more familiar with the Anthropic Messages API, SilvaMux supports it as well:\n\n```bash\ncurl https:\u002F\u002Fwww.silvamux.com\u002Fapi\u002Fv1\u002Fmessages \\\n  -H \"Authorization: Bearer $SILVAMUX_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"minimax-m2.5\",\n    \"max_tokens\": 1024,\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n  }'\n```\n\nSee [Text Generation Models](\u002Fen\u002Fdocs\u002Fmodels\u002Fchat\u002Foverview) for more API formats.\n",[],{"title":27,"description":813},"491Dd7hiRv0PN0w9Kfpc3OlM5I7zTvLxcDEzdTS4mMI"]