API keys
Every request to the Anton Payments API must include an API key in theAuthorization header using the Bearer scheme:
Key formats
API keys are prefixed to indicate their environment:| Prefix | Environment | Purpose |
|---|---|---|
ak_test_ | Sandbox | Testing and development — no real money moves |
ak_live_ | Production | Real payouts with real money |
Key management
You create, view, and revoke API keys through the merchant portal at Settings > API Keys. There is no API endpoint for key management — all key operations are performed in the portal.Creating a key
- Log in to the merchant portal
- Navigate to Settings > API Keys
- Select the environment (sandbox or production)
- Click Create Key and give it a descriptive name (e.g., “Production server”, “Staging CI”)
The full API key is displayed once at creation time. We hash keys with SHA-256 before storage — we cannot retrieve the original key for you. Copy it immediately and store it in your secrets manager.
Revoking a key
If a key is compromised, revoke it immediately from the merchant portal:- Navigate to Settings > API Keys
- Find the key and click Revoke
- Confirm the revocation
Security best practices
Rotate keys regularly
Rotate keys regularly
Create a new key, update your systems to use it, then revoke the old key. This limits exposure if a key is leaked.
Use separate keys per environment
Use separate keys per environment
Never use production keys in development. Create dedicated test keys for sandbox.
Restrict to server-side only
Restrict to server-side only
API keys should only be used from your backend servers. Never include them in mobile apps, browser JavaScript, or client-side code.
Monitor key usage
Monitor key usage
Review your API key list periodically in the merchant portal. Revoke any keys that are no longer in use or that you do not recognize.
Error responses
If authentication fails, you receive a401 Unauthorized response:
- Missing
Authorizationheader - Malformed header (must be
Bearer <key>, not just the key) - Revoked key
- Using a test key against the production URL (or vice versa)