Skip to content

users_apikeys_create

Issue an API key for this product.

Tool

users_apikeys_create

Issue an API key for this product.

Issue an API key for this product. type='publishable' mints a non-secret browser key (upk_…) that only names this product and stays readable afterwards. It is the only type: the secret server key (usk_…) is retired — the one route it authorized is now checked by the public edge against the product's platform public key.

Behavior

HTTP
POST /users/api-keys

Arguments

Name
Type
Required
Description
name
string
•
A label only humans read — which backend or environment holds this key.
type
string
•
'publishable' mints a non-secret key (upk_…) that identifies this product in browser flows and stays readable. It is the only key type: the secret server key (usk_…) is retired.

Response

Field
Type
Always
Description
id
string
•
Id of the key. Pass it to users_apikeys_revoke.
key
string
•
The full secret key, shown ONCE. Store it now — it is never returned again, and a lost key is replaced by minting a new one.
name
string
•
The label a human gave this key — which backend or environment holds it.
type
string
•
`publishable` — a browser-safe key (upk_…). It is the only type issued.
value
string
•
The full value of a publishable key, which is not a secret and stays readable. Null for a retired server key, whose secret was never stored.
prefix
string
•
`upk_` (or `usk_` on a retired server key) plus six characters — enough to recognise a key, never to use one.
createdAt
string
•
When the key was issued (ISO 8601).
revokedAt
string
•
When the key was revoked (ISO 8601). Null while it still works.

Try it

Issue an API key for this product.

When to use

Issue an API key for this product. type='publishable' mints a non-secret browser key (upk_…) that only names this product and stays readable afterwards. It is the only type: the secret server key (usk_…) is retired — the one route it authorized is now checked by the public edge against the product's platform public key.

Example

Ask your agent something like this:

Issue an API key for this product.

The agent will invoke users_apikeys_create with these arguments:

{
  "name": "<name>",
  "type": "<type>"
}

Esc

Start typing to search the docs.

↑↓navigate↵select