Skip to content
English
  • There are no suggestions because the search field is empty.

API Key Access Token

Authenticate by generating an API token key and exchanging the token key for the access token. The access token expires after 24 hours.

Creating an API token key

Generate a token key from the CredoAI web app. Click on your name in the lower left hand → Settings → Tokens. Save this token somewhere locally to reference again in the future.

Exchange API token key for access token

This key can be exchanged for the auth token with a POST /auth/exchange request.

  
curl -X "POST" "https://api.credo.ai/auth/exchange" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "api_token": "${API_TOKEN}", "tenant": "${TENANT}" }'

An access token will be returned. This token is valid for 24 hours.

{ "access_token": "ACCESS_TOKEN" }
 

Now send an API request with this access token. Set the Authorization header with bearer token:

Authorization: Bearer ${ACCESS_TOKEN}

to get use cases, for example 

## Get use cases curl "https://api.credo.ai/api/v2/TENANT/use_cases \ -H 'Authorization: Bearer ${ACCESS_TOKEN}'