Skip to main content
API keys authenticate private account and trading requests. Each key has a public key and a secret key, an account scope, and a set of permissions.

Create an API key

  1. Sign in at qfex.com and select your profile in the bottom right corner.
  2. Navigate to Developer Settings via the carousel.
  3. Click Generate public and secret API Keys.
  4. Ensure you have 2FA enabled.
  5. Provide a descriptive name, choose the account access and permissions the key needs, and confirm.
  6. Copy the generated key and store it securely—it will only be shown once.

Account access and permissions

Each API key is limited by both its account access and its permissions. A request must satisfy both settings. For account access, choose either:
  • A specific account: The key can be used only with the selected primary account or subaccount.
  • All accounts: The key can be used with any account you own. Use this only when the integration genuinely needs access across accounts.
Permissions control what the key can do: Create keys with only the permissions required for their intended use. For example, reporting software may need view permissions but should not need order execution or withdrawal access.

Use an API key with a third party

If you authorize a trusted third-party application to access QFEX with an API key:
  1. Create a dedicated key for that application. Do not reuse your personal integration key.
  2. Limit it to the required account and enable only the permissions the application needs.
  3. Provide the public and secret key through a secure channel. The application never needs your QFEX password or MFA codes.
  4. The application must keep the secret key on a secure server and use it to sign authenticated requests. It must never expose the secret in browser code, mobile applications, logs, URLs, or source control.
  5. Revoke the key from Developer Settings when the integration is no longer needed or if either credential may have been exposed.
The secret key is displayed only once. QFEX cannot display it again after creation; create a replacement key if it is lost. For direct integrations, see WebSocket authentication for the trading signing flow or Programmatic deposits and withdrawals for funding REST requests. A third-party application can also use QFEX OAuth or wallet-signed builder registration to connect a user account.
Treat the secret key like a password. Anyone who has both key values can act within the account access and permissions you selected.

Builder-issued API keys

Builder wallet registration lets an enabled builder create a user’s trading key after the user signs a wallet message. The builder authenticates the registration request with its own API key and register_user permission. The returned user key is restricted to the main account and grants trading, account reads, deposit-address reads, and crypto withdrawals to registered destinations. Its view_balance permission authorizes GET /address and GET /withdrawal-addresses. Registered-destination crypto withdrawals with POST /withdraw are enabled through builder key issuance and replacement; this access is not selectable in Developer Settings. It has deposit_withdraw disabled, so it cannot rotate deposit addresses, manage bank accounts, or withdraw USD. See programmatic funding for the requests. The key is labelled builder- followed by the builder’s username. Creating another key for the same user and builder label replaces the previous key. Keys with labels starting with builder- or managed are excluded from the normal API-key listing.

Create an API key programmatically

Standard programmatic key creation uses a QFEX user session, not an existing API key. First authenticate with a wallet or another supported sign-in method, then complete MFA to obtain a recently elevated access token. Send the elevated token to the key-generation endpoint. Supply every permission explicitly so the key cannot gain permissions through a default-value change:
Create a key after the user has selected its scope and permissions:
The accountId value must be one of:
  • * for all primary accounts and subaccounts owned by the user
  • The user’s primary account ID
  • A subaccount ID owned by the user
The deposit and withdrawal permission is available only when accountId is *. QFEX forces that permission to false for a key restricted to one account.
Never return the generated secret to logs, analytics, browser storage, or an untrusted caller. The response is the only time QFEX returns the plaintext secret.

Elevate a session with TOTP

API-key creation requires recent MFA verification. If the user has a verified authenticator-app factor, challenge and verify that factor before creating the key:
Use the access_token returned by the verification response for key creation. Obtain factorId from the signed-in user’s verified factors. The user must provide the current authenticator code; do not store or attempt to generate it for them.

HTTP request

The raw key-generation request is:
A successful response contains public_key and secret_key. Persist the pair before discarding the response; the secret cannot be retrieved later.

Common errors