Skip to navigation

Create an access token v2

View as Markdown
Use this endpoint to obtain an access token. Compliant with standard OAuth2 protocol and supports the common OAuth2 grant types.

Authentication

AuthorizationBearer
Bearer authentication

Request

This endpoint expects an object.
grant_typeenumRequired

The OAuth2 grant type. Determines the authentication flow and which parameters are required:

client_credentials - Authenticate as a service account or user access key using clientId and clientSecret.

password - Authenticate as a local user using username and password.

external_token_exchange - Authenticate as a service account or user using a token issued by the configured identity provider (IdP) for a Run:ai token. Requires externalToken.

Allowed values:
client_idstringOptional

The client identifier for a service account or user access key. Required when using the client_credentials grant type. Must be used together with clientSecret.

client_secretstringOptionalformat: "password"

The client secret corresponding to the clientId. Required when using the client_credentials grant type. Must be used together with clientId.

usernamestringOptional
The username of a local user account. Required when using the password grant type. Must be used together with password.
passwordstringOptionalformat: "password"
The password for the specified username. Required when using the password grant type. Must be used together with username.
external_tokenstringOptional

A valid token issued by the identity provider (IdP) that is configured in NVIDIA Run:ai. Required when using the external_token_exchange grant type.

Response

Successfully issued token
access_tokenstring
The access token issued by the authorization server
token_typestring

The type of the token issued (typically “Bearer”)

expires_inintegerOptional
The lifetime in seconds of the access token
refresh_tokenstringOptional
The refresh token, which can be used to obtain new access tokens
id_tokenstringOptional

ID Token value associated with the authenticated session (OpenID Connect)

scopestringOptional
The scope of the access token

Errors

400
Bad Request Error
401
Unauthorized Error
500
Internal Server Error
503
Service Unavailable Error