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 can create, list, and revoke API keys through the API or the merchant dashboard.Create a key
The full API key is only returned once at creation time. We hash keys with SHA-256 before storage — we cannot retrieve the original key for you. Save it securely immediately.
Revoke a key
If a key is compromised, revoke it immediately: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 server-side only
Restrict 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. Revoke any keys that are no longer in use or that you don’t recognize.
Error responses
If authentication fails, you’ll receive a401 Unauthorized response:
- Missing
Authorizationheader - Malformed header (must be
Bearer <key>, not just the key) - Revoked or expired key
- Using a test key against production (or vice versa)