API Authentication
Aegis uses a dual header authentication system to secure all API requests. Every authenticated endpoint requires both a Bearer token and the agent’s registered email address.How Authentication Works
Unlike traditional API key systems, Aegis enforces zero-trust dual-header validation. Both headers must be present and must match the same agent record in the database:Authorization: Your Bearer token issued during/v1/connect/completeX-Aegis-Email: The email address associated with that token
Getting Your API Token
Aegis does not use a dashboard for token management. Tokens are issued programmatically through the Connect API:1
Start onboarding
2
Complete with OTP
Check your email for a 6-character hex code, then submit it:
3
Save the token
The response includes your
token field. This is the only time you will see the plaintext token.Token Format
Aegis API tokens follow a consistent prefix format:- Live Token:
aegis_live_xxxxxxxxxxxxxxxx
tokenExpiresAt field in the connect response tells you the exact expiry timestamp.
Making Authenticated Requests
Include both headers on every request:Request Headers
Every API request should include these headers:Idempotency
To prevent duplicate transactions, all financial action endpoints (/transfer, /pay, /bridge, /swap, /yield/deposit, /yield/withdraw, /wealth/limitOrder, /wealth/dca, /wealth/multiYield, /wealth/yield/synthra/withdraw) require an Idempotency-Key header. This must be a valid UUID v4.
If you send the same request twice with the same idempotency key, Aegis will return the original response without executing the action again.
Nonce System
Aegis tracks anactionNonce for every agent. This counter increments on every successful financial action. You must pass the current nonce value in the X-Aegis-Nonce header for financial mutations.
To check your agent’s current nonce:
Error Handling
Authentication Errors
If authentication fails, you’ll receive an error response:Token Revocation
To revoke all active tokens for an agent (e.g., in case of a token leak), call the revoke endpoint:/v1/connect/start and /v1/connect/complete again to receive a new token.
Rate Limiting
Aegis enforces the following rate limits:
If you exceed the rate limit, you’ll receive a
429 Too Many Requests response.
Security Best Practices
Store Tokens Securely
Store Tokens Securely
- Never hardcode tokens in your application source code
- Use environment variables or a secrets manager
- Rotate tokens by calling
/v1/connect/revokeand Reonboarding
Use HTTPS Only
Use HTTPS Only
- All API requests must use HTTPS, The API will reject plaintext HTTP connections
One Agent, One Token
One Agent, One Token
For multi-agent architectures, provision separate agents (e.g.,
research-agent@company.com, trading-agent@company.com) rather than sharing
a single token. This gives you independent audit trails and spending policies
per agent.Revoke on Compromise
Revoke on Compromise
If you suspect a token has been leaked, immediately call
POST /v1/connect/revoke. This invalidates all active tokens for that agent instantly.Next Steps
Agent Connections
Deep dive into the onboarding lifecycle
Quickstart
Make your first payment in 5 minutes