Skip to main content
PATCH
Update Api Token Scopes By Id
When called with an API key, the key needs the account_api_key scope (about scopes).
account_api_key is sensitive: a key can be given it only once the account owner has enabled it. To enable it, sign in to the dashboard as the account owner, open Account → Danger zone and tick Allow API keys to manage API keys, then give it to a key from the dashboard. No API key can enable it or give it to a key: an API key that sets it is refused with 422 (an API key cannot grant scope: account_api_key), whether or not it is enabled.

Authorizations

Authorization
string
header
required

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

Headers

xi-api-key
string | null
x-api-key
string | null

Path Parameters

token_id
string
required

Body

application/json
scopes
enum<string>[]
required

what the key may do: at least one scope, or unrestricted alone for every non-sensitive scope

What an API key may do. A scope x also grants x:read; unrestricted grants every non-sensitive scope.

Available options:
inference,
models:read,
account:read,
models,
lora:read,
lora,
voice:read,
voice,
account_scoped_jwt:read,
account_scoped_jwt,
batch,
compute:sandbox,
compute:agents,
compute:containers,
billing:read,
metrics,
account_api_key:read,
account_api_key,
unrestricted

Response

Successful Response

created_at
integer
required

creation unix timestamp

name
string
required
token_id
string
required
allowed_ips
string[] | null
prefix
string
default:""

sk-di-, or empty on a token minted before it

fragment
string
default:""

display suffix; last 5 chars of the secret

scopes
enum<string>[]

what the key may do

What an API key may do. A scope x also grants x:read; unrestricted grants every non-sensitive scope.

Available options:
inference,
models:read,
account:read,
models,
lora:read,
lora,
voice:read,
voice,
account_scoped_jwt:read,
account_scoped_jwt,
batch,
compute:sandbox,
compute:agents,
compute:containers,
billing:read,
metrics,
account_api_key:read,
account_api_key,
unrestricted