Authentication
Every request to the ZendFi API must include a valid API key. Keys are scoped to a specific mode (test or live) and tied to your merchant account.API Key Format
ZendFi API keys follow a predictable format that encodes their mode:
The SDK and API automatically route requests to the correct Solana network based on the key prefix. You do not need to specify devnet or mainnet anywhere — it is determined by the key.
Using Your API Key
Include your API key as a Bearer token in theAuthorization header:
With the SDK
The SDK reads your key from theZENDFI_API_KEY environment variable automatically:
With cURL
Environment Variables
The SDK checks these environment variables in order:Managing API Keys
Via the Dashboard
Your primary API keys are available in the ZendFi Dashboard under Settings.Via the API
You can also manage keys programmatically:Via the CLI
Key Rotation
When you rotate a key, the old key is immediately invalidated and a new one is returned. Make sure to update your environment variables promptly.Error Responses
If authentication fails, the API returns a401 status code:
- Missing
Authorizationheader - Incorrect key prefix (typo or malformed key)
- Revoked or rotated key
- Using a test key against a live-only endpoint (or vice versa)
Rate Limits
Authenticated requests are rate-limited per merchant:
Rate limit headers are included in every response:
429 Too Many Requests with a Retry-After header.