- Release Notes
- Getting started
- Notifications
- Projects
- Datasets
- Data Labeling
- ML packages
- Out of the box packages
- Pipelines
- ML Skills
- ML Logs
- Document UnderstandingTM in AI Center
- AI Center API
- Licensing
- AI Solutions Templates
- How to
- Invoke public ML Skills using API
- Save infrastructure costs using AI Center APIs
- Update ML Skill deployment using API
- Basic Troubleshooting Guide
Save infrastructure costs using AI Center APIs
With the API requests, you can programmatically change the state of an ML Skill. These APIs could be used even within an automation workflow to deploy and undeploy an ML Skill, optimizing the uptime for infrastructure and saving costs. See the complete set of AI Center APIs documented in swagger.
accountname
and tenantname
are specific to your account. For more information, see the API list.
You use the AI Center APIs to:
- Find the ML Skill ID of
sampleClassifierSkill
- Stop (undeploy) the ML Skill
- Start (redeploy) and verify the status update.
In November 2022, we announced the availability of APIs to programmatically interact with every component within AI Center. You can now manage datasets, train ML models, and deploy ML Skills using APIs, without having to use the User interface.
One of the key use-cases for leveraging APIs is to manage the deployment status of an ML Skill. Depending on the automation, you may not need an ML Skill to be active all the time. Undeploying ML Skills when not in use can help you save on hardware costs (AI units).
The steps to access AI Center APIs are:
- Registering an external application (one-time setup)
- Generating an authentication token (renew upon expiry)
- Making AI Center API calls
To use the APIs, your app needs to register as an external application with an AI Center scope.
- From the left navigation panel, go to the
Admin
page and selectExternal Applications
. - To add a new external application, select
+ Add Application
and name it.
Note: Onlyconfidential application
type can access AI Center APIs. - To enable AI Center scope to the external application:
- Select
Add scope
- Pick
AI Center API Access (preview)
from the Resource dropdown - Navigate to the
Application Scope
tab - Select the APIs to which you want to enable access to.
- Select
- Select
Add
. A pop up with App ID and an App Secret is generated.Tip: You can view the App ID and App Secret anytime from the Edit External application. These credentials are used to generate an authentication token in the next step. See additional information on managing external applications.
For authentication and secure access, the external application requests an access token from the UiPath® Identity Server. The generated authentication token expires in one hour, upon which you need to regenerate a new auth token.
If you want to use Postman, you can register for free and choose to use either the Postman web-based interface or the downloadable application. See the official Postman website.
-
Generate a POST request to the Identity Server endpoint
https://cloud.uipath.com/identity_/connect/token
that includes the following in the body of the request.client_id: App ID from previous step client_secret: App Secret from previous step grant_type: “client_credentials”
client_id: App ID from previous step client_secret: App Secret from previous step grant_type: “client_credentials” -
Set
grant_type
to client_credentials.
application/x-www-form-urlencoded
content type for Postman.
See additional information on credentials and auth tokens.
accountname
" and “tenantname
” are specific to your account. Most APIs need the following information:
- Account ID and Tenant ID. You can find the account and tenant information in the profile info section within the tenant. See profile information.
- Authorization. The authorization field should be populated with the auth token generated in the previous step.
Important: When using the auth token, prefix it with Bearer as in the screenshot below.
sampleClassifierSkill
for this example. In
the ML Skills list, you can see this skill exists and is currently in the
Available state.
GET ML Skills
call, you can fetch a list of all ML Skills within the account and tenant. You can also add the ML Skill name as part of
the query to search for a specific ML Skill and retrieve its details. In this case, you find the ML Skill id
for the sampleClassifierSkill
GET /ai-deployer/v1/mlskills?name=sampleClassifierSkill
sampleClassifierSkill
is in the Available state. The ML Skill id
is used in the subsequent APIs to update the state.
To stop an ML Skill:
- Request query should contain the
stop
update action and ML Skillid
- Header should contain account, tenant and auth info
PUT /ai-deployer/v2/mlskills/stop/{mlSkillId}
sampleClassifierSkill
was undeployed.
updateType
set to Resume.
POST
/ai-deployer/v1/mlskills/{mlSkillId}?updateType=RESUME
{ "deploymentsRequired": 1,
"gpuRequired": 0,
"mlPackageVersionId": <package-version-id>,
"processor": "CPU",
"publicSkill": false,
"autoUpdate": false,
"inactivityPeriodInDays": 7,
"replicas": 1,
"requestMemory": 2,
"requestCPU": 0.5,
"limitMemory": 9,
"limitCPU": 2
}
{ "deploymentsRequired": 1,
"gpuRequired": 0,
"mlPackageVersionId": <package-version-id>,
"processor": "CPU",
"publicSkill": false,
"autoUpdate": false,
"inactivityPeriodInDays": 7,
"replicas": 1,
"requestMemory": 2,
"requestCPU": 0.5,
"limitMemory": 9,
"limitCPU": 2
}
GET ML Skill
details API.
sampleClassifierSkill
within workflows, to make predictions.