API Documentation
...
Automated RedTeaming for AI/ML
<POST> Model Registration
4 min
post /api/ais/v1 5/model registration/upload { "tab" "examples", "url" "https //api aws boschaishield com/prod/api/ais/v1 5/model registration/upload", "name" "model registration", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "x api key", "type" "string", "children" \[], "description" "enter your api key" }, { "kind" "required", "name" "org id", "type" "string", "children" \[], "description" "enter your organization id" } ], "bodydataparameters" \[ { "name" "task type", "kind" "required", "type" "string", "description" "enter the name of the task type", "children" \[] }, { "name" "analysis type", "kind" "required", "type" "string", "description" "enter the name of the analysis type", "children" \[] } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "hsuk1xbptzdznmhzmpprp", "code" "// returns a json object containing a unique model id and urls to upload required files ", "language" "200", "customlabel" "" }, { "id" "hkv5x2emhgwf7tnx8i0hi", "code" "// returns an error message if the provided api key or org id is invalid or expired ", "language" "401", "customlabel" "" }, { "id" "atezrqzetje4hwhvwxwyu", "code" "// returns an error message if the application cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, etc ) ", "language" "400", "customlabel" "" }, { "id" "y0gaitzn0hbuwyh0ngxjf", "code" "// returns an error message if access to the target resource has been denied (for example, if any of the parameter value is incorrect or license has expired) ", "language" "412", "customlabel" "" } ], "selectedlanguageid" "hsuk1xbptzdznmhzmpprp" }, "examples" { "languages" \[ { "id" "ojtl2rnwtcse8ozclymcd", "language" "python", "code" "import requests\nimport json\n\nurl = \\"https //api aws boschaishield com/prod/api/ais/v1 5/model registration/upload\\"\n\n# please select proper payload for your usecase from request body \npayload = {\n 'task type' \\"<\<task type>>\\",\n \\"analysis type\\" \\"<\<analysis type>>\\"\n}\nheaders = {\n 'accept' 'application/json',\n 'x api key' '########################################',\n 'org id' '####################################################################################################'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, json=payload)\n\nprint(response text)", "customlabel" "" }, { "id" "hh1j4esunjxcklbqcggh0", "language" "curl", "code" "curl location 'https //api aws boschaishield com/prod/api/ais/v1 5/model registration/upload' \\\\\n header 'x api key ########################################' \\\\\n header 'org id ####################################################################################################' \\\\\n header 'content type application/json' \\\\\n data '{\n \\"task type\\" \\"<\<task type>>\\",\n \\"analysis type\\" \\"<\<analysis type>>\\"\n}'", "customlabel" "" }, { "id" "yiyfhmky0u zzehp 0ti1", "language" "nodejs", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //api aws boschaishield com/prod/api/ais/v1 5/model registration/upload',\n 'headers' {\n 'x api key' '########################################',\n 'org id' '####################################################################################################',\n 'content type' 'application/json'\n },\n body json stringify({\n 'task type' '<< enter task type >>',\n 'analysis type' '<< enter analysis type>>'\n })\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "customlabel" "" }, { "id" "f8wphhi2uscctkbfmo9nd", "language" "javascript", "code" "var myheaders = new headers();\nmyheaders append(\\"org id\\", \\"####################################################################################################\\");\nmyheaders append(\\"x api key\\", \\"########################################\\");\nmyheaders append(\\"content type\\", \\"application/json\\");\n\nvar raw = json stringify({\n \\"task type\\" \\"<\<enter task type>>\\",\n \\"analysis type\\" \\"<\<enter analysis type>>\\"\n});\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //api aws boschaishield com/prod/api/ais/v1 5/model registration/upload\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "customlabel" "" } ], "selectedlanguageid" "f8wphhi2uscctkbfmo9nd" }, "description" "the model registration api is used to register ai/ml models it returns a unique model id and urls to upload the required files we have listed the required sample files these are the the model, data, and label files and you are required to upload them the purpose of this api is to provide vulnerability analysis and generate customized endpoint defense to keep models secure ", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } request body ic mea { "task type" "image classification", "analysis type" "extraction" } ic eva { "task type" "image classification", "analysis type" "evasion" } ic pos { "task type" "image classification", "analysis type" "data poisoning" } is mea { "task type" "image segmentation", "analysis type" "extraction" } tc mea { "task type" "tabular classification", "analysis type" "extraction" } tc eva { "task type" "tabular classification", "analysis type" "evasion" } tsf mea { "task type" "timeseries forecasting", "analysis type" "extraction" } nlp mea { "task type" "nlp classification", "analysis type" "extraction" } ts mea { "task type" "timeseries forecasting", "analysis type" "extraction" } od eva { "task type" "object detection", "analysis type" "evasion" } the request body is a json object with the following fields task type the name of the task type possible values are ic (image classification, is (image segmentation), tc (tabular classification), tsf (time series forecasting), text (nlp classification) analysis type the name of the analysis type possible values are mea (model extraction attack), eva (model evasion attack), and data poisoning or poisoning for (data poisoning) and model poisoning for (model poisoning) model upload option post /ais/v1 5/model registration/upload after receiving the unique model id and urls from the vulnerability analysis api, users can upload the required data and track the progress further note all files uploaded to the specified url should be in zipped format this only needs to be done once for any model and multiple analyses can be performed check image classification docid 6deiimjnkl5d0cdwstckb , image segmentation docid\ zgifjwp4yrvb4uog5 qvh tabular classification docid\ mvtlctnkashpx9mzjvb62 , time series forecasting docid\ kdsa2hzsaxo0wcqicddc4 & text recommendation (alpha release) docid\ pf0 v4ug62 akwbxclkoz , object detection docid\ u3g1wca wl4wed67bysah to know the file upload format note the model, data, and label must be uploaded to the given link within ten minutes for image classification poisoning addition, two clean models are required the model id must be saved by the user for future use for using nodejs sample code, install npm package request given ample code for python is tested for python version 3 7 given sample code for nodejs and javascript is tested for node v20lts