Logo
OpenScaler

Create API token

POST
/v1/account/api-tokens

Mint an OpenScaler API token. The full secret is returned once in this response. Requires a Keycloak access token (console session or CLI login). An API token cannot create other tokens.

Authorization

bearer_auth
AuthorizationBearer <token>

Authentication

Create an API token on Profile, or with osctl auth login. Send it in the Authorization header:

Authorization: Bearer os1_...

Do not use the Keycloak web-session JWT as an API token. Keep the secret secure and do not share it.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body to create an API token. The full secret is returned in the create response.

Response Body

application/json

application/json

text/pain

application/json

application/json

curl -X POST "https://example.com/v1/account/api-tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "CI laptop",    "expires_at": null  }'
{  "id": "019dd518-7b37-7b33-99a7-85d78d7a3320",  "name": "CI laptop",  "prefix": "os1_abcd",  "created_via": "console",  "expires_at": null,  "last_used_at": null,  "created_at": "2026-09-08T12:00:00.000000Z",  "token": "os1_abcdefghijklmnopqrstuvwxyz0123456789"}
{  "errors": [    {      "message": "'vcpus' field must be an integer",      "field": "resource_id"    }  ]}
"Access denied"
{  "errors": [    {      "message": "User not initialized. Send POST /v1/init, then retry the request."    }  ]}
{  "errors": [    {      "message": "VM with ID 23 not found"    }  ]}