# API token authentication

Create account API tokens, authenticate with a query parameter, rotate tokens, and keep them out of logs.

Each account can keep up to 10 API tokens. Open **Token management** in Settings to create, rename, reset, enable, disable, or delete them. Disabled tokens still count toward the limit. Deleting a token frees a slot. Each token can call all public APIs for the account, including rotating-proxy allowlists, extraction, and region lookups, as well as static residential lookups, purchases, renewals, and password changes. You do not need to select permissions. Allowlist management does not require an allowlisted source IP. Rotating-proxy extraction still checks the source allowlist, identity verification, and plan entitlement. Admin and internal endpoints do not accept these tokens.

## Create or reset a token

1. Sign in to the Console and open **Account Settings**.
2. Create or reset a token on the **API tokens** card.
3. Copy the full token into your application's secrets manager. New tokens start with `sk-` followed by 32 lowercase hexadecimal characters. Existing `sk_` tokens remain supported.

Account owners can view and copy the full token at any time. The page does not write the token to local storage, the URL, or analytics. A reset immediately invalidates the previous token. Update every application that used it.

## Authenticate a request

Each request accepts a single, non-empty `api_key` query parameter. Bearer tokens and `X-API-Key` are unsupported. Do not repeat the query parameter.

```bash
curl --get 'https://api.zzhttp.com/openapi/v1/proxy/whitelist/list' \
  --data-urlencode "api_key=$API_KEY" \
  --data-urlencode 'page=1' \
  --data-urlencode 'page_size=20'
```

Before running the command, use your secrets manager to set `API_KEY` to the full token. Because `api_key` appears in the query string, avoid logging the full URL.

Malformed tokens, mismatched secrets, disabled or expired tokens, and unavailable accounts all return HTTP `401`. The response does not identify which validation failed.

## Keep tokens out of logs

Clients, proxies, browsers, and third-party edge services can record query parameters.

- Keep full request URLs containing tokens out of application logs, tickets, and screenshots.
- Log the route path, request ID, result code, and elapsed time. Omit the query string.
- Use runtime variables or fictitious redacted tokens with two characters visible at each end in examples. Keep real tokens out of test fixtures and deployment configuration.
- Treat any response that contains a full token as sensitive. The server sends `Cache-Control: no-store` and `Referrer-Policy: no-referrer` to reduce accidental retention.

If you suspect a token was exposed, reset it immediately in the Console and confirm requests using the old token now return HTTP `401`.

html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}
