[{"data":1,"prerenderedAt":1353},["ShallowReactive",2],{"navigation_docs_en":3,"-en-guide-isv-api-model-calls":69,"-en-guide-isv-api-model-calls-surround":1349},[4],{"title":5,"path":6,"stem":7,"children":8,"page":33},"Developer Guide","\u002Fen\u002Fguide","en\u002F01.guide",[9,12,34],{"title":5,"path":10,"stem":11},"\u002Fen\u002Fguide\u002Foverview","en\u002F01.guide\u002F01.overview",{"title":13,"path":14,"stem":15,"children":16,"page":33},"Model Provider","\u002Fen\u002Fguide\u002Fmodel-provider","en\u002F01.guide\u002F02.model-provider",[17,21,25,29],{"title":18,"path":19,"stem":20},"Overview","\u002Fen\u002Fguide\u002Fmodel-provider\u002Foverview","en\u002F01.guide\u002F02.model-provider\u002F01.overview",{"title":22,"path":23,"stem":24},"Deploy fine-tuned model","\u002Fen\u002Fguide\u002Fmodel-provider\u002Fdeploy-fine-tuned-model","en\u002F01.guide\u002F02.model-provider\u002F02.deploy-fine-tuned-model",{"title":26,"path":27,"stem":28},"Prepare model template","\u002Fen\u002Fguide\u002Fmodel-provider\u002Fprepare-model-template","en\u002F01.guide\u002F02.model-provider\u002F03.prepare-model-template",{"title":30,"path":31,"stem":32},"Official shipping channel","\u002Fen\u002Fguide\u002Fmodel-provider\u002Fshipping-channel","en\u002F01.guide\u002F02.model-provider\u002F04.shipping-channel",false,{"title":35,"path":36,"stem":37,"children":38,"page":33},"ISV","\u002Fen\u002Fguide\u002Fisv","en\u002F01.guide\u002F03.isv",[39,42,46,50,54,58,61,65],{"title":18,"path":40,"stem":41},"\u002Fen\u002Fguide\u002Fisv\u002Foverview","en\u002F01.guide\u002F03.isv\u002F01.overview",{"title":43,"path":44,"stem":45},"Prepare app template","\u002Fen\u002Fguide\u002Fisv\u002Fprepare-app-template","en\u002F01.guide\u002F03.isv\u002F02.prepare-app-template",{"title":47,"path":48,"stem":49},"Prepare arx.yaml","\u002Fen\u002Fguide\u002Fisv\u002Fprepare-arx-yaml","en\u002F01.guide\u002F03.isv\u002F03.prepare-arx-yaml",{"title":51,"path":52,"stem":53},"Prepare Helm chart","\u002Fen\u002Fguide\u002Fisv\u002Fprepare-helm-chart","en\u002F01.guide\u002F03.isv\u002F04.prepare-helm-chart",{"title":55,"path":56,"stem":57},"Publish for testing","\u002Fen\u002Fguide\u002Fisv\u002Fpublish-to-app-market","en\u002F01.guide\u002F03.isv\u002F05.publish-to-app-market",{"title":30,"path":59,"stem":60},"\u002Fen\u002Fguide\u002Fisv\u002Fshipping-channel","en\u002F01.guide\u002F03.isv\u002F06.shipping-channel",{"title":62,"path":63,"stem":64},"API model calls","\u002Fen\u002Fguide\u002Fisv\u002Fapi-model-calls","en\u002F01.guide\u002F03.isv\u002F07.api-model-calls",{"title":66,"path":67,"stem":68},"Mount Remote Storage","\u002Fen\u002Fguide\u002Fisv\u002Fmount-remote-storage","en\u002F01.guide\u002F03.isv\u002F08.mount-remote-storage",{"id":70,"title":71,"body":72,"description":1342,"extension":1343,"links":1344,"meta":1345,"navigation":1346,"path":63,"seo":1347,"stem":64,"__hash__":1348},"docs_en\u002Fen\u002F01.guide\u002F03.isv\u002F07.api-model-calls.md","Call on-premises models on ARX through the API",{"type":73,"value":74,"toc":1319},"minimark",[75,79,83,86,89,93,106,112,116,121,125,137,148,152,155,238,242,247,256,271,275,296,307,310,328,332,335,461,464,468,481,485,488,541,544,547,641,647,910,913,919,1013,1017,1020,1023,1039,1130,1133,1155,1158,1160,1174,1273,1292,1296,1299,1315],[76,77,18],"h2",{"id":78},"overview",[80,81,82],"p",{},"ARX runs on a server with GPU resources, so you can deploy models quickly and give your generative AI applications local inference.",[80,84,85],{},"The ARX model gateway speaks two formats: the OpenAI API and the Claude API. Your applications keep using the mainstream API format they already use, which also makes switching between cloud and on-premises models straightforward.",[80,87,88],{},"This article covers where to find the three values a call needs, with examples in cURL and Python.",[76,90,92],{"id":91},"what-youll-learn","What you'll learn",[94,95,96,100,103],"ul",{},[97,98,99],"li",{},"Get the model API endpoint, API key, and model ID",[97,101,102],{},"Tell the OpenAI and Claude API formats apart",[97,104,105],{},"Call an on-premises model with cURL and the Python SDKs",[80,107,108],{},[109,110,111],"strong",{},"Estimated time: about 10 minutes",[76,113,115],{"id":114},"applies-to","Applies to",[94,117,118],{},[97,119,120],{},"ARX OS 1.0 and later",[76,122,124],{"id":123},"before-you-begin","Before you begin",[94,126,127],{},[97,128,129,130,133,134],{},"You have deployed a model in AI Model Center, and its status on the ",[109,131,132],{},"Model Instance"," page reads ",[109,135,136],{},"Running",[80,138,139,140,147],{},"If you haven't deployed one yet, see ",[141,142,146],"a",{"href":143,"rel":144},"https:\u002F\u002Fdocs.ardge.com\u002Fen\u002Fguide\u002Fuse-ai\u002Fai-model-center",[145],"nofollow","AI Model Center"," for the download and deploy walkthrough.",[76,149,151],{"id":150},"what-youll-need","What you'll need",[80,153,154],{},"A call needs these three values:",[156,157,158,174],"table",{},[159,160,161],"thead",{},[162,163,164,168,171],"tr",{},[165,166,167],"th",{},"Value",[165,169,170],{},"What it is",[165,172,173],{},"Where to find it",[175,176,177,198,213],"tbody",{},[162,178,179,185,188],{},[180,181,182],"td",{},[109,183,184],{},"Model API Endpoint",[180,186,187],{},"The URL of the ARX model gateway",[180,189,190,191,194,195],{},"The ",[109,192,193],{},"Home"," page in AI Model Center, or ",[109,196,197],{},"API Key › API Endpoint",[162,199,200,205,208],{},[180,201,202],{},[109,203,204],{},"API Key",[180,206,207],{},"The credential that authenticates the call",[180,209,190,210,212],{},[109,211,204],{}," page in AI Model Center — you create it yourself",[162,214,215,220,228],{},[180,216,217],{},[109,218,219],{},"Model ID",[180,221,222,223,227],{},"The identifier you pass in the request's ",[224,225,226],"code",{},"model"," field",[180,229,190,230,232,233,235,236],{},[109,231,193],{}," page, ",[109,234,197],{},", or ",[109,237,132],{},[76,239,241],{"id":240},"step-1-get-the-three-values","Step 1: Get the three values",[243,244,246],"h3",{"id":245},"model-api-endpoint","Model API endpoint",[80,248,249,250,252,253,255],{},"Look on the ",[109,251,193],{}," page in AI Model Center, or on ",[109,254,197],{},".",[257,258,259,262,263,266,267,270],"note",{},[224,260,261],{},"\u003CAPI_ENDPOINT>",": the endpoint the ARX interface shows already ends in ",[224,264,265],{},"\u002Fai\u002Fv1",", for example ",[224,268,269],{},"http:\u002F\u002F192.168.1.100\u002Fai\u002Fv1",". Each example appends its own path.",[243,272,274],{"id":273},"api-key","API key",[276,277,278,284,290,293],"ol",{},[97,279,280,281,283],{},"Go to the ",[109,282,204],{}," page in AI Model Center",[97,285,286,287],{},"Click ",[109,288,289],{},"Add API Key",[97,291,292],{},"Follow the fields to finish the setup — you can set an expiry date for the key and choose which models it can reach",[97,294,295],{},"Copy the generated key",[297,298,299,304],"tip",{},[80,300,301],{},[109,302,303],{},"API keys double as access control:",[80,305,306],{},"The set of models you pick at creation time is that key's permission boundary. Create a separate key per application so that revoking one doesn't affect the others.",[243,308,219],{"id":309},"model-id",[80,311,190,312,314,315,317,318,320,321,324,325,327],{},[109,313,193],{}," page, the ",[109,316,197],{}," page, and the ",[109,319,132],{}," page all show the model's ",[109,322,323],{},"Instance Name",". That string is the model ID you pass in the request's ",[224,326,226],{}," field.",[76,329,331],{"id":330},"how-the-two-api-formats-differ","How the two API formats differ",[80,333,334],{},"The same endpoint and key work with both formats. Here's what changes:",[156,336,337,349],{},[159,338,339],{},[162,340,341,343,346],{},[165,342],{},[165,344,345],{},"OpenAI API format",[165,347,348],{},"Claude API format",[175,350,351,366,381,394,419,438],{},[162,352,353,356,361],{},[180,354,355],{},"Request path",[180,357,358],{},[224,359,360],{},"\u003CAPI_ENDPOINT>\u002Fchat\u002Fcompletions",[180,362,363],{},[224,364,365],{},"\u003CAPI_ENDPOINT>\u002Fmessages",[162,367,368,371,376],{},[180,369,370],{},"Auth header",[180,372,373],{},[224,374,375],{},"Authorization: Bearer \u003CYOUR_API_KEY>",[180,377,378],{},[224,379,380],{},"x-api-key: \u003CYOUR_API_KEY>",[162,382,383,388,391],{},[180,384,385],{},[224,386,387],{},"max_tokens",[180,389,390],{},"Optional",[180,392,393],{},"Required",[162,395,396,399,414],{},[180,397,398],{},"Where the system prompt goes",[180,400,401,402,405,406,409,410,413],{},"An item with ",[224,403,404],{},"role"," ",[224,407,408],{},"system"," in the ",[224,411,412],{},"messages"," array",[180,415,416,417,227],{},"A separate ",[224,418,408],{},[162,420,421,424,429],{},[180,422,423],{},"Where the reply text sits",[180,425,426],{},[224,427,428],{},"choices[0].message.content",[180,430,190,431,434,435,413],{},[224,432,433],{},"text"," block in the ",[224,436,437],{},"content",[162,439,440,446,452],{},[180,441,442,443],{},"SDK ",[224,444,445],{},"base_url",[180,447,448,449],{},"The endpoint ",[109,450,451],{},"as shown",[180,453,448,454,457,458],{},[109,455,456],{},"without"," the trailing ",[224,459,460],{},"\u002Fv1",[80,462,463],{},"Pick the format your application's existing SDK already uses: if it calls OpenAI, stay on the OpenAI format; if it calls Claude, stay on the Claude format. Either way, your application logic doesn't change.",[76,465,467],{"id":466},"step-2-make-your-first-request-with-curl","Step 2: Make your first request with cURL",[80,469,470,471,473,474,477,478,255],{},"Before you start, replace the three placeholders with the values from Step 1: ",[224,472,261],{},", ",[224,475,476],{},"\u003CYOUR_API_KEY>",", and ",[224,479,480],{},"\u003CMODEL_ID>",[243,482,484],{"id":483},"list-the-available-models","List the available models",[80,486,487],{},"Run this first to confirm the key and the endpoint are both correct:",[489,490,495],"pre",{"className":491,"code":492,"language":493,"meta":494,"style":494},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \u003CAPI_ENDPOINT>\u002Fmodels \\\n  -H \"Authorization: Bearer \u003CYOUR_API_KEY>\"\n","bash","",[224,496,497,527],{"__ignoreMap":494},[498,499,502,506,510,514,518,521,524],"span",{"class":500,"line":501},"line",1,[498,503,505],{"class":504},"sBMFI","curl",[498,507,509],{"class":508},"sMK4o"," \u003C",[498,511,513],{"class":512},"sfazB","API_ENDPOIN",[498,515,517],{"class":516},"sTEyZ","T",[498,519,520],{"class":508},">",[498,522,523],{"class":512},"\u002Fmodels",[498,525,526],{"class":516}," \\\n",[498,528,530,533,536,538],{"class":500,"line":529},2,[498,531,532],{"class":512},"  -H",[498,534,535],{"class":508}," \"",[498,537,375],{"class":512},[498,539,540],{"class":508},"\"\n",[80,542,543],{},"The deployed model should appear in the returned list.",[243,545,345],{"id":546},"openai-api-format",[489,548,550],{"className":491,"code":549,"language":493,"meta":494,"style":494},"curl \u003CAPI_ENDPOINT>\u002Fchat\u002Fcompletions \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Authorization: Bearer \u003CYOUR_API_KEY>\" \\\n  -d '{\n    \"model\": \"\u003CMODEL_ID>\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"}\n    ]\n  }'\n",[224,551,552,569,583,596,608,614,620,626,632],{"__ignoreMap":494},[498,553,554,556,558,560,562,564,567],{"class":500,"line":501},[498,555,505],{"class":504},[498,557,509],{"class":508},[498,559,513],{"class":512},[498,561,517],{"class":516},[498,563,520],{"class":508},[498,565,566],{"class":512},"\u002Fchat\u002Fcompletions",[498,568,526],{"class":516},[498,570,571,573,575,578,581],{"class":500,"line":529},[498,572,532],{"class":512},[498,574,535],{"class":508},[498,576,577],{"class":512},"Content-Type: application\u002Fjson",[498,579,580],{"class":508},"\"",[498,582,526],{"class":516},[498,584,586,588,590,592,594],{"class":500,"line":585},3,[498,587,532],{"class":512},[498,589,535],{"class":508},[498,591,375],{"class":512},[498,593,580],{"class":508},[498,595,526],{"class":516},[498,597,599,602,605],{"class":500,"line":598},4,[498,600,601],{"class":512},"  -d",[498,603,604],{"class":508}," '",[498,606,607],{"class":512},"{\n",[498,609,611],{"class":500,"line":610},5,[498,612,613],{"class":512},"    \"model\": \"\u003CMODEL_ID>\",\n",[498,615,617],{"class":500,"line":616},6,[498,618,619],{"class":512},"    \"messages\": [\n",[498,621,623],{"class":500,"line":622},7,[498,624,625],{"class":512},"      {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"}\n",[498,627,629],{"class":500,"line":628},8,[498,630,631],{"class":512},"    ]\n",[498,633,635,638],{"class":500,"line":634},9,[498,636,637],{"class":512},"  }",[498,639,640],{"class":508},"'\n",[80,642,643,644,646],{},"A successful call returns something like the following, with the model's output in ",[224,645,428],{},":",[489,648,652],{"className":649,"code":650,"language":651,"meta":494,"style":494},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"id\": \"chatcmpl-...\",\n  \"object\": \"chat.completion\",\n  \"model\": \"\u003CMODEL_ID>\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"On-premises model deployment means running an AI model on your own hardware, so your data never leaves for the cloud.\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": { \"prompt_tokens\": 21, \"completion_tokens\": 35, \"total_tokens\": 56 }\n}\n","json",[224,653,654,658,681,701,719,733,738,756,770,790,808,814,833,839,845,904],{"__ignoreMap":494},[498,655,656],{"class":500,"line":501},[498,657,607],{"class":508},[498,659,660,663,667,669,671,673,676,678],{"class":500,"line":529},[498,661,662],{"class":508},"  \"",[498,664,666],{"class":665},"spNyl","id",[498,668,580],{"class":508},[498,670,646],{"class":508},[498,672,535],{"class":508},[498,674,675],{"class":512},"chatcmpl-...",[498,677,580],{"class":508},[498,679,680],{"class":508},",\n",[498,682,683,685,688,690,692,694,697,699],{"class":500,"line":585},[498,684,662],{"class":508},[498,686,687],{"class":665},"object",[498,689,580],{"class":508},[498,691,646],{"class":508},[498,693,535],{"class":508},[498,695,696],{"class":512},"chat.completion",[498,698,580],{"class":508},[498,700,680],{"class":508},[498,702,703,705,707,709,711,713,715,717],{"class":500,"line":598},[498,704,662],{"class":508},[498,706,226],{"class":665},[498,708,580],{"class":508},[498,710,646],{"class":508},[498,712,535],{"class":508},[498,714,480],{"class":512},[498,716,580],{"class":508},[498,718,680],{"class":508},[498,720,721,723,726,728,730],{"class":500,"line":610},[498,722,662],{"class":508},[498,724,725],{"class":665},"choices",[498,727,580],{"class":508},[498,729,646],{"class":508},[498,731,732],{"class":508}," [\n",[498,734,735],{"class":500,"line":616},[498,736,737],{"class":508},"    {\n",[498,739,740,743,746,748,750,754],{"class":500,"line":622},[498,741,742],{"class":508},"      \"",[498,744,745],{"class":504},"index",[498,747,580],{"class":508},[498,749,646],{"class":508},[498,751,753],{"class":752},"sbssI"," 0",[498,755,680],{"class":508},[498,757,758,760,763,765,767],{"class":500,"line":628},[498,759,742],{"class":508},[498,761,762],{"class":504},"message",[498,764,580],{"class":508},[498,766,646],{"class":508},[498,768,769],{"class":508}," {\n",[498,771,772,775,777,779,781,783,786,788],{"class":500,"line":634},[498,773,774],{"class":508},"        \"",[498,776,404],{"class":752},[498,778,580],{"class":508},[498,780,646],{"class":508},[498,782,535],{"class":508},[498,784,785],{"class":512},"assistant",[498,787,580],{"class":508},[498,789,680],{"class":508},[498,791,793,795,797,799,801,803,806],{"class":500,"line":792},10,[498,794,774],{"class":508},[498,796,437],{"class":752},[498,798,580],{"class":508},[498,800,646],{"class":508},[498,802,535],{"class":508},[498,804,805],{"class":512},"On-premises model deployment means running an AI model on your own hardware, so your data never leaves for the cloud.",[498,807,540],{"class":508},[498,809,811],{"class":500,"line":810},11,[498,812,813],{"class":508},"      },\n",[498,815,817,819,822,824,826,828,831],{"class":500,"line":816},12,[498,818,742],{"class":508},[498,820,821],{"class":504},"finish_reason",[498,823,580],{"class":508},[498,825,646],{"class":508},[498,827,535],{"class":508},[498,829,830],{"class":512},"stop",[498,832,540],{"class":508},[498,834,836],{"class":500,"line":835},13,[498,837,838],{"class":508},"    }\n",[498,840,842],{"class":500,"line":841},14,[498,843,844],{"class":508},"  ],\n",[498,846,848,850,853,855,857,860,862,865,867,869,872,875,877,880,882,884,887,889,891,894,896,898,901],{"class":500,"line":847},15,[498,849,662],{"class":508},[498,851,852],{"class":665},"usage",[498,854,580],{"class":508},[498,856,646],{"class":508},[498,858,859],{"class":508}," {",[498,861,535],{"class":508},[498,863,864],{"class":504},"prompt_tokens",[498,866,580],{"class":508},[498,868,646],{"class":508},[498,870,871],{"class":752}," 21",[498,873,874],{"class":508},",",[498,876,535],{"class":508},[498,878,879],{"class":504},"completion_tokens",[498,881,580],{"class":508},[498,883,646],{"class":508},[498,885,886],{"class":752}," 35",[498,888,874],{"class":508},[498,890,535],{"class":508},[498,892,893],{"class":504},"total_tokens",[498,895,580],{"class":508},[498,897,646],{"class":508},[498,899,900],{"class":752}," 56",[498,902,903],{"class":508}," }\n",[498,905,907],{"class":500,"line":906},16,[498,908,909],{"class":508},"}\n",[243,911,348],{"id":912},"claude-api-format",[80,914,915,916,918],{},"The auth header and the request path both differ from the OpenAI format, and ",[224,917,387],{}," is required:",[489,920,922],{"className":491,"code":921,"language":493,"meta":494,"style":494},"curl \u003CAPI_ENDPOINT>\u002Fmessages \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"x-api-key: \u003CYOUR_API_KEY>\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -d '{\n    \"model\": \"\u003CMODEL_ID>\",\n    \"max_tokens\": 1024,\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"}\n    ]\n  }'\n",[224,923,924,941,953,965,978,986,990,995,999,1003,1007],{"__ignoreMap":494},[498,925,926,928,930,932,934,936,939],{"class":500,"line":501},[498,927,505],{"class":504},[498,929,509],{"class":508},[498,931,513],{"class":512},[498,933,517],{"class":516},[498,935,520],{"class":508},[498,937,938],{"class":512},"\u002Fmessages",[498,940,526],{"class":516},[498,942,943,945,947,949,951],{"class":500,"line":529},[498,944,532],{"class":512},[498,946,535],{"class":508},[498,948,577],{"class":512},[498,950,580],{"class":508},[498,952,526],{"class":516},[498,954,955,957,959,961,963],{"class":500,"line":585},[498,956,532],{"class":512},[498,958,535],{"class":508},[498,960,380],{"class":512},[498,962,580],{"class":508},[498,964,526],{"class":516},[498,966,967,969,971,974,976],{"class":500,"line":598},[498,968,532],{"class":512},[498,970,535],{"class":508},[498,972,973],{"class":512},"anthropic-version: 2023-06-01",[498,975,580],{"class":508},[498,977,526],{"class":516},[498,979,980,982,984],{"class":500,"line":610},[498,981,601],{"class":512},[498,983,604],{"class":508},[498,985,607],{"class":512},[498,987,988],{"class":500,"line":616},[498,989,613],{"class":512},[498,991,992],{"class":500,"line":622},[498,993,994],{"class":512},"    \"max_tokens\": 1024,\n",[498,996,997],{"class":500,"line":628},[498,998,619],{"class":512},[498,1000,1001],{"class":500,"line":634},[498,1002,625],{"class":512},[498,1004,1005],{"class":500,"line":792},[498,1006,631],{"class":512},[498,1008,1009,1011],{"class":500,"line":810},[498,1010,637],{"class":512},[498,1012,640],{"class":508},[76,1014,1016],{"id":1015},"step-3-call-the-model-from-the-python-sdk","Step 3: Call the model from the Python SDK",[243,1018,345],{"id":1019},"openai-api-format-1",[80,1021,1022],{},"Install the package:",[489,1024,1026],{"className":491,"code":1025,"language":493,"meta":494,"style":494},"pip install openai\n",[224,1027,1028],{"__ignoreMap":494},[498,1029,1030,1033,1036],{"class":500,"line":501},[498,1031,1032],{"class":504},"pip",[498,1034,1035],{"class":512}," install",[498,1037,1038],{"class":512}," openai\n",[489,1040,1044],{"className":1041,"code":1042,"language":1043,"meta":494,"style":494},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=os.environ[\"ARX_ENDPOINT\"],  # ← Change 1: point at your ARX device\n    api_key=os.environ[\"ARX_API_KEY\"],    # ← Change 2: your API key\n)\n\nresponse = client.chat.completions.create(\n    model=os.environ[\"ARX_MODEL_ID\"],     # ← Change 3: the model ID\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a friendly technical assistant. Keep answers short and precise.\"},\n        {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"},\n    ],\n)\n\nprint(response.choices[0].message.content)\n","python",[224,1045,1046,1051,1056,1062,1067,1072,1077,1082,1086,1091,1096,1101,1106,1111,1116,1120,1124],{"__ignoreMap":494},[498,1047,1048],{"class":500,"line":501},[498,1049,1050],{},"import os\n",[498,1052,1053],{"class":500,"line":529},[498,1054,1055],{},"from openai import OpenAI\n",[498,1057,1058],{"class":500,"line":585},[498,1059,1061],{"emptyLinePlaceholder":1060},true,"\n",[498,1063,1064],{"class":500,"line":598},[498,1065,1066],{},"client = OpenAI(\n",[498,1068,1069],{"class":500,"line":610},[498,1070,1071],{},"    base_url=os.environ[\"ARX_ENDPOINT\"],  # ← Change 1: point at your ARX device\n",[498,1073,1074],{"class":500,"line":616},[498,1075,1076],{},"    api_key=os.environ[\"ARX_API_KEY\"],    # ← Change 2: your API key\n",[498,1078,1079],{"class":500,"line":622},[498,1080,1081],{},")\n",[498,1083,1084],{"class":500,"line":628},[498,1085,1061],{"emptyLinePlaceholder":1060},[498,1087,1088],{"class":500,"line":634},[498,1089,1090],{},"response = client.chat.completions.create(\n",[498,1092,1093],{"class":500,"line":792},[498,1094,1095],{},"    model=os.environ[\"ARX_MODEL_ID\"],     # ← Change 3: the model ID\n",[498,1097,1098],{"class":500,"line":810},[498,1099,1100],{},"    messages=[\n",[498,1102,1103],{"class":500,"line":816},[498,1104,1105],{},"        {\"role\": \"system\", \"content\": \"You are a friendly technical assistant. Keep answers short and precise.\"},\n",[498,1107,1108],{"class":500,"line":835},[498,1109,1110],{},"        {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"},\n",[498,1112,1113],{"class":500,"line":841},[498,1114,1115],{},"    ],\n",[498,1117,1118],{"class":500,"line":847},[498,1119,1081],{},[498,1121,1122],{"class":500,"line":906},[498,1123,1061],{"emptyLinePlaceholder":1060},[498,1125,1127],{"class":500,"line":1126},17,[498,1128,1129],{},"print(response.choices[0].message.content)\n",[80,1131,1132],{},"An application that already calls OpenAI needs no logic changes — only the three marked values.",[1134,1135,1136,1143],"warning",{},[80,1137,1138],{},[109,1139,1140,1141,646],{},"Watch the end of ",[224,1142,445],{},[80,1144,1145,1146,1148,1149,1151,1152,1154],{},"Use the endpoint as the interface shows it (ending in ",[224,1147,265],{},") for the OpenAI SDK's ",[224,1150,445],{},". The SDK appends ",[224,1153,566],{}," itself.",[243,1156,348],{"id":1157},"claude-api-format-1",[80,1159,1022],{},[489,1161,1163],{"className":491,"code":1162,"language":493,"meta":494,"style":494},"pip install anthropic\n",[224,1164,1165],{"__ignoreMap":494},[498,1166,1167,1169,1171],{"class":500,"line":501},[498,1168,1032],{"class":504},[498,1170,1035],{"class":512},[498,1172,1173],{"class":512}," anthropic\n",[489,1175,1177],{"className":1041,"code":1176,"language":1043,"meta":494,"style":494},"import os\nimport anthropic\n\nclient = anthropic.Anthropic(\n    base_url=os.environ[\"ARX_ENDPOINT\"].removesuffix(\"\u002Fv1\"),  # ← Change 1: point at your ARX device\n    api_key=os.environ[\"ARX_API_KEY\"],     # ← Change 2: your API key\n)\n\nmessage = client.messages.create(\n    model=os.environ[\"ARX_MODEL_ID\"],      # ← Change 3: the model ID\n    max_tokens=1024,                       # Required in the Claude format\n    system=\"You are a friendly technical assistant. Keep answers short and precise.\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"Explain on-premises model deployment in one sentence.\"},\n    ],\n)\n\nfor block in message.content:\n    if block.type == \"text\":\n        print(block.text)\n",[224,1178,1179,1183,1188,1192,1197,1202,1207,1211,1215,1220,1225,1230,1235,1239,1243,1247,1251,1255,1261,1267],{"__ignoreMap":494},[498,1180,1181],{"class":500,"line":501},[498,1182,1050],{},[498,1184,1185],{"class":500,"line":529},[498,1186,1187],{},"import anthropic\n",[498,1189,1190],{"class":500,"line":585},[498,1191,1061],{"emptyLinePlaceholder":1060},[498,1193,1194],{"class":500,"line":598},[498,1195,1196],{},"client = anthropic.Anthropic(\n",[498,1198,1199],{"class":500,"line":610},[498,1200,1201],{},"    base_url=os.environ[\"ARX_ENDPOINT\"].removesuffix(\"\u002Fv1\"),  # ← Change 1: point at your ARX device\n",[498,1203,1204],{"class":500,"line":616},[498,1205,1206],{},"    api_key=os.environ[\"ARX_API_KEY\"],     # ← Change 2: your API key\n",[498,1208,1209],{"class":500,"line":622},[498,1210,1081],{},[498,1212,1213],{"class":500,"line":628},[498,1214,1061],{"emptyLinePlaceholder":1060},[498,1216,1217],{"class":500,"line":634},[498,1218,1219],{},"message = client.messages.create(\n",[498,1221,1222],{"class":500,"line":792},[498,1223,1224],{},"    model=os.environ[\"ARX_MODEL_ID\"],      # ← Change 3: the model ID\n",[498,1226,1227],{"class":500,"line":810},[498,1228,1229],{},"    max_tokens=1024,                       # Required in the Claude format\n",[498,1231,1232],{"class":500,"line":816},[498,1233,1234],{},"    system=\"You are a friendly technical assistant. Keep answers short and precise.\",\n",[498,1236,1237],{"class":500,"line":835},[498,1238,1100],{},[498,1240,1241],{"class":500,"line":841},[498,1242,1110],{},[498,1244,1245],{"class":500,"line":847},[498,1246,1115],{},[498,1248,1249],{"class":500,"line":906},[498,1250,1081],{},[498,1252,1253],{"class":500,"line":1126},[498,1254,1061],{"emptyLinePlaceholder":1060},[498,1256,1258],{"class":500,"line":1257},18,[498,1259,1260],{},"for block in message.content:\n",[498,1262,1264],{"class":500,"line":1263},19,[498,1265,1266],{},"    if block.type == \"text\":\n",[498,1268,1270],{"class":500,"line":1269},20,[498,1271,1272],{},"        print(block.text)\n",[1134,1274,1275,1285],{},[80,1276,1277],{},[109,1278,1279,1280,1282,1283,646],{},"Drop the trailing ",[224,1281,460],{}," from the Claude SDK's ",[224,1284,445],{},[80,1286,1287,1288,1291],{},"The Anthropic SDK appends ",[224,1289,1290],{},"\u002Fv1\u002Fmessages"," itself — the opposite of the OpenAI SDK.",[76,1293,1295],{"id":1294},"official-api-documentation","Official API documentation",[80,1297,1298],{},"For the full field reference, see the vendor documentation:",[94,1300,1301,1308],{},[97,1302,1303,1304],{},"OpenAI API: ",[141,1305,1306],{"href":1306,"rel":1307},"https:\u002F\u002Fdevelopers.openai.com\u002Fapi\u002Fdocs",[145],[97,1309,1310,1311],{},"Claude API: ",[141,1312,1313],{"href":1313,"rel":1314},"https:\u002F\u002Fplatform.claude.com\u002Fdocs\u002Fen\u002Fapi\u002Foverview",[145],[1316,1317,1318],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":494,"searchDepth":529,"depth":529,"links":1320},[1321,1322,1323,1324,1325,1326,1331,1332,1337,1341],{"id":78,"depth":529,"text":18},{"id":91,"depth":529,"text":92},{"id":114,"depth":529,"text":115},{"id":123,"depth":529,"text":124},{"id":150,"depth":529,"text":151},{"id":240,"depth":529,"text":241,"children":1327},[1328,1329,1330],{"id":245,"depth":585,"text":246},{"id":273,"depth":585,"text":274},{"id":309,"depth":585,"text":219},{"id":330,"depth":529,"text":331},{"id":466,"depth":529,"text":467,"children":1333},[1334,1335,1336],{"id":483,"depth":585,"text":484},{"id":546,"depth":585,"text":345},{"id":912,"depth":585,"text":348},{"id":1015,"depth":529,"text":1016,"children":1338},[1339,1340],{"id":1019,"depth":585,"text":345},{"id":1157,"depth":585,"text":348},{"id":1294,"depth":529,"text":1295},"Get the model API endpoint, API key, and model ID, then call an on-premises model with cURL or the Python SDK in either OpenAI or Claude API format","md",null,{},{"title":62},{"title":71,"description":1342},"-dT9d_65JeW9IYO1Y7jmQbWwpFR7xdooeuhNheRiEyg",[1350,1352],{"title":30,"path":59,"stem":60,"description":1351,"children":-1},"Move from a test install to shipping your application to customers: becoming an ARDGE partner, submitting your template for release, and maintaining it afterwards",{"title":66,"path":67,"stem":68,"description":494,"children":-1},1795763806826]