For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Key Management

Create, list, and revoke API keys, with scopes and IP allow-lists.

API keys let you call authenticated endpoints from servers and scripts. You create and manage keys through these endpoints, then sign each request as described in Signing Requests With API Keys.

Scopes

Each key is granted one or more scopes. Requests signed with a key are limited to the actions its scopes allow.

Scope
Grants

read:spot

Read spot accounts, orders, trades, deposits, withdrawals

trade:spot

Place and cancel spot orders

withdraw:spot

Request spot withdrawals

read:futures

Read perpetuals accounts, positions, orders, trades

trade:futures

Place and cancel perpetuals orders, manage positions

Grant the narrowest set of scopes a key needs. A read-only data key should not carry trade:* or withdraw:* scopes.

GET /accounts/api-keys

List the API keys belonging to the authenticated account.

Authentication: Required (JWT only)

Query Parameters:

Parameter
Type
Required
Options
Description

page

integer

No

default 1

Page number

page_size

integer

No

capped at server maximum

Items per page

Response:

Response Fields:

Field
Type
Description

keys

array

Array of API key records

keys[].id

string

Internal key identifier (used to revoke the key)

keys[].api_key

string

The public API key value (sent in the X-API-KEY header)

keys[].scopes

array

Granted scopes

keys[].ip_whitelist

array

Allowed source IPs (empty means no IP restriction)

keys[].state

string

Key state (e.g. active, revoked)

keys[].expires_at

string

Expiry timestamp, or empty if the key does not expire

keys[].last_used_at

string

Last time the key was used, or empty if never used

keys[].created_at

string

Creation timestamp

keys[].description

string

User-supplied label

total

integer

Total number of keys

page

integer

Pagination echo

page_size

integer

Pagination echo

Status Codes:

  • 200 - Keys retrieved successfully

  • 401 - Authentication failed

  • 403 - Request was not authenticated with a JWT (forbidden_auth_method)

POST /accounts/api-keys

Create a new API key. The secret is returned only once, in this response — store it immediately; it cannot be retrieved later.

Authentication: Required (JWT only)

Request Body:

Request Parameters:

Parameter
Type
Required
Options
Description

scopes

array

Yes

Scopes to grant (see Scopes)

ip_whitelist

array

No

Source IPs allowed to use the key. Omit or leave empty for no IP restriction.

expires_at

string

No

RFC3339

Expiry timestamp. Omit for a non-expiring key.

description

string

No

A label to help you identify the key

Response (201 Created):

Response Fields:

Field
Type
Description

key

object

The created key record (same shape as in the list response)

secret

string

The API secret, used to compute request signatures. Shown only once.

Status Codes:

  • 201 - Key created successfully

  • 400 - Invalid request body or invalid scope/parameter

  • 401 - Authentication failed

  • 403 - Request was not authenticated with a JWT (forbidden_auth_method)

  • 500 - Internal server error

POST /accounts/api-keys/:id/revoke

Revoke an API key by its id. Revocation is immediate and permanent; the key can no longer be used to sign requests.

Authentication: Required (JWT only)

Path Parameters:

Parameter
Type
Required
Options
Description

id

string

Yes

The id of the key to revoke (from the list response)

Response:

Status Codes:

  • 200 - Key revoked successfully

  • 401 - Authentication failed

  • 403 - Request was not authenticated with a JWT (forbidden_auth_method)

  • 404 - Key not found or not owned by the authenticated account (api_key_not_found)

Next step

Once you have an API key and secret, see Signing Requests With API Keys to authenticate your requests.

Last updated

Was this helpful?