How to Authenticate to the API
Request an API Token
Example Command to Get an API token
curl -X POST \
'https://<runai_url>/api/v1/token' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"grantType":"client_credentials",
"clientId":"<CLIENT ID>",
"clientSecret" : "<CLIENT SECRET>"
}'import requests
import json
reqUrl = "https://<runai_url>/api/v1/token"
headersList = {
"Accept": "*/*",
"Content-Type": "application/json"
}
payload = json.dumps({
"grantType":"client_credentials",
"clientId":"<CLIENT ID>",
"clientSecret" : "<CLIENT SECRET>"
})
response = requests.request("POST", reqUrl, data=payload, headers=headersList)
print(response.text)Response
Last updated