POST
/
api
/
v0
/
auth
/
apikeys
/
create api-key
curl --request POST \
  --url https://console.vast.ai/api/v0/auth/apikeys/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "read-only-key",
  "permissions": {
    "read": true,
    "write": false
  },
  "key_params": {
    "ip_whitelist": [
      "1.2.3.4"
    ]
  }
}'
{
  "id": 12345,
  "key": "vast-123456789abcdef",
  "permissions": false
}

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

Name for the API key

Example:

"read-only-key"

permissions
object

JSON object containing permission definitions

Example:
{ "read": true, "write": false }
key_params
object

Optional wildcard parameters for advanced keys

Example:
{ "ip_whitelist": ["1.2.3.4"] }

Response

API key created successfully

id
integer

The ID of the created API key

Example:

12345

key
string

The newly generated API key

Example:

"vast-123456789abcdef"

permissions

False when permissions are disabled

Example:

false