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