v1

latestOpenAPI 3.1.02026-07-13897404.3 KB
Accounts

create api-key

Creates a new API key with specified permissions for the authenticated user.

CLI Usage: vastai create api-key --name <name> --permission_file <permissions_file> [--key_params <params>]

post/api/v0/auth/apikeys/

Request body

namestring required

Name for the API key

permissionsobject

JSON object containing permission definitions

key_paramsobject

Optional wildcard parameters for advanced keys

Example request

{
  "name": "read-only-key",
  "permissions": {
    "read": true,
    "write": false
  },
  "key_params": {
    "ip_whitelist": [
      "1.2.3.4"
    ]
  }
}

Response

API key created successfully

idinteger

The ID of the created API key

keystring

The newly generated API key

Example response

{
  "id": 12345,
  "key": "vast-123456789abcdef",
  "permissions": {
    "read": true,
    "write": false
  }
}