Skip to content

Mint an API key

POST
/keys

Create a new ck_ API key for the signed-in account. The raw key is returned exactly once; store it and pass it as the Authorization bearer on api.close.city. Accounts hold at most 3 active keys.

X-CSRF-Token
required
string

The session’s CSRF token, from GET /auth/csrf.

object
label

Optional label.

string

The new key, shown once.

object
key
string
prefix
string
tokens_remaining

The account’s current token balance. The signup grant is once per account, so this can be 0 for a returning account.

integer

No signed-in session.

Missing or invalid X-CSRF-Token.

Active-key limit reached; revoke one.