API Reference
Dashboard
  1. API Reference
  2. Box API
  3. API keys

Create an API key

Use this to create a key for a bot, a script or the Change IP URL of an anti-detect browser such as AdsPower or Dolphin. A Full access key (xpf_…) has the same rights as the admin login on every route that accepts it, except key management, and is sent as Authorization: Bearer xpf_…; never put it in a URL. A Rotate only key (xpr_…) can only call the rotation links /reset, /api/v1/rotate_ip/proxy/{proxy} and /api/v1/rotate_ip/position/{position}, as the token query parameter or as a Bearer header. The full key is returned once in data.key; the box keeps only a hash, so it cannot show it again (regenerate it instead). The box holds at most 50 keys. Available from XProxy v21.3.61.

  • Action · reversible
  • Basic auth
  • Panel API · since v21.3.61
  • Hub: blocked by the Hub
  • createApiKey
POST/v2/api_keys

Request body application/json · required

namestringrequired

Label shown in the panel. 1-40 characters without control characters.

typestringrequired

full creates an xpf_ key, rotate an xpr_ key.

One of full, rotate
expires_atinteger | nulloptional

Expiry time as UTC epoch milliseconds in the future, or null (or omitted) for a key that never expires.

Authentication

Needs the admin login (HTTP Basic, or the panel session). An API key cannot manage API keys: any key sent here, even a valid Full access key, is refused with HTTP 401 invalid_token, also from the LAN. A browser request whose Origin is not the panel's own address is refused with HTTP 403 cross_origin; requests without an Origin header (curl, scripts) are not affected.

How authentication works: login, API keys, LAN and 401 answers →

Responses

The new key, or the reason it was refused. Sent with Cache-Control: no-store.

Errors returned in msg

msgMeaningWhat to do
invalid_nameThe name is missing, empty, longer than 40 characters or has control characters (code field, HTTP 200).Send a name of 1-40 characters.
invalid_typetype is not full or rotate (code field).Send full or rotate.
invalid_expiryexpires_at is not a whole number in the future (code field).Send a future time in UTC milliseconds, or null for no expiry.
limit_reachedThe box already holds 50 keys (code field).Delete a key you no longer use.
invalid_tokenAn API key was sent. Keys cannot manage keys (HTTP 401).Call this with the admin login and no key.
cross_originThe request came from a browser page on another origin (HTTP 403, in the code field).Open the panel itself
Verified against XProxy v21.3.61 on Dec 4, 2026