Skip to main content
PATCH
Update Api Token Scopes By Id

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, never unrestricted

What an API key may do; a login session may do everything. Listed in the order the dashboard shows.

A scope x also grants x:read (see covers_scope).

Adding or renaming a scope needs its dashboard description in deepinfra/web too: pages.dashboard.api_keys.scopes.descriptions.<name with ':' as '_'> in public/locales/en/common.json. Without one the dashboard shows the bare name.

A new scope is not initial, so unrestricted keys do not get it; one split from an initial scope is, so they keep what they could do.

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,
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 login session may do everything. Listed in the order the dashboard shows.

A scope x also grants x:read (see covers_scope).

Adding or renaming a scope needs its dashboard description in deepinfra/web too: pages.dashboard.api_keys.scopes.descriptions.<name with ':' as '_'> in public/locales/en/common.json. Without one the dashboard shows the bare name.

A new scope is not initial, so unrestricted keys do not get it; one split from an initial scope is, so they keep what they could do.

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,
unrestricted