API Access Setup
To interact with the NVIDIA Run:ai platform programmatically, configure API access using access keys. This section outlines the steps to create a service account, generate tokens using the appropriate OAuth2 grant types, and authenticate securely with the platform APIs.
Authenticate with Admin Credentials
Before registering a service account, authenticate using administrator credentials. Use the credentials configured via global.management.user and global.management.password as detailed in Install the Control Plane.
Send a POST request to the /api/v2/token endpoint with grant_type=password to generate a token.
Example request:
Example response:
Use the returned access_token as a Bearer token in the Authorization header for subsequent API requests.
Create a Service Account
After generating a token using the admin password, use it to register a service account. Service accounts 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/service-accounts endpoint.
Example request:
Example response:
Generate a Token with Client Credentials
Use the clientId and clientSecret from your service account to generate an access token for authenticated API calls using the client_credentials grant type.
Send a POST request to the /api/v2/token endpoint with grant_type=client_credentials.
Example request:
Example response:
Use the access_token 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.
Example request:
Example response: