Skip to main content
POST
/
user
/
custom_token
Create new Token
curl --request POST \
  --url https://api.edenai.run/v2/user/custom_token/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "token_type": "sandbox_api_token",
  "balance": "<string>",
  "expire_time": "2023-11-07T05:31:56Z",
  "active_balance": true
}
'
{
  "name": "<string>",
  "token_type": "sandbox_api_token",
  "balance": "<string>",
  "expire_time": "2023-11-07T05:31:56Z",
  "active_balance": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The token name

Required string length: 1 - 200
token_type
enum<string>
  • sandbox_api_token - Sandbox
  • api_token - Back
Available options:
sandbox_api_token,
api_token
balance
string<decimal>

Optional remaining credits balance for this Token, if active_balance is set to True and the balance reaches 0, this token will become unusable

expire_time
string<date-time> | null
active_balance
boolean

Weither to use the balance field or not.

Response

201 - application/json
name
string
required

The token name

Maximum string length: 200
token_type
enum<string>
  • sandbox_api_token - Sandbox
  • api_token - Back
Available options:
sandbox_api_token,
api_token
balance
string<decimal>

Optional remaining credits balance for this Token, if active_balance is set to True and the balance reaches 0, this token will become unusable

expire_time
string<date-time> | null
active_balance
boolean

Weither to use the balance field or not.