API Access Setup
To interact with the NVIDIA Run:ai platform programmatically, configure API access using application credentials. This section outlines the steps to create an application, generate tokens using the appropriate OAuth2 grant types, and authenticate securely with the platform APIs.
Authenticate with Admin Credentials
Before registering an application, you must authenticate using administrator credentials. You can use the default credentials ([email protected]
/ Abcd!234
) or the custom credentials configured using global.adminUser.username
and global.adminUser.password
as detailed in the customized installation section.
Send a POST
request to the /api/v1/token
endpoint with grantType: password
to generate a token. See the Tokens API endpoint for more details.
Example request:
curl -L 'https://console.<DOMAIN>/api/v1/token' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
{
"grantType": "password",
"username": "[email protected]",
"password": "yourPassword"
}
Example response:
{
"accessToken": "<TOKEN>",
}
Use the returned accessToken
as a Bearer token in the Authorization header for subsequent API requests
Create an Application
After generating a token using the admin password, use it to register an application. Applications contain a clientID
and clientSecret
that are used to authenticate future API requests via the client_credentials
grant type.
Send a POST
request to the /api/v1/apps
endpoint. See Applications API endpoint for more details.
Example request:
curl -L 'https://console.<DOMAIN>/api/v1/apps' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
{
"name": "app-123",
}
Example response:
{
"id": "0eeaf222-e503-4f35-9d9c-c419816272e3",
"name": "app123",
"secret": "asdasidjn9d",
"clientId": "app123"
}
Generate a Token with Client Credentials
Use the clientId
and clientSecret
from your application to generate an access token for authenticated API calls using the client_credentials
grant type.
Send a POST
request to the /api/v1/token
endpoint with grantType: client_credentials
. See the Tokens API endpoint for more details.
Example request:
curl -L 'https://console.<DOMAIN>/api/v1/token' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
{
"grantType": "client_credentials",
"clientID": "clientID",
"clientSecret": "clientSecret"
}
Example response:
{
"accessToken": "string",
"idToken": "string",
"refreshToken": "string",
"externalToken": "string"
}
Use the accessToken
as a Bearer token in the Authorization header for all subsequent API requests
Create a Local User
Send a POST
request to the /api/v1/users
endpoint to create a local user. See the Users API endpoint for more details.
Example request:
curl -L 'https://console.<DOMAIN>/api/v1/users' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"email": "[email protected]",
"resetPassword": false
}'
Example response:
{
"id": "1a2b3c4d",
"email": "[email protected]",
"createdAt": "2024-06-01T00:00:00Z"
}
Last updated