SDK Authentication
The Conto SDK authenticates using agent-specific SDK keys.SDK Keys
SDK keys are scoped to a specific agent and can only perform payment operations. They use the format:conto_agent_a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678
Generating SDK Keys
Via Dashboard
Via API
Using SDK Keys
Initialize the SDK
Environment Variables (Recommended)
.env
SDK Scopes
SDK keys are granted specific scopes that control access to different endpoints. Scopes are configured when generating an SDK key.Default Scopes
These scopes are included by default:| Scope | Description |
|---|---|
payments:request | Request payment authorization |
payments:execute | Execute approved payments |
Additional Scopes
These scopes can be added for broader access:| Scope | Description |
|---|---|
payments:confirm | Confirm external wallet payments |
wallets:read | View wallet balances and limits |
transactions:read | View transaction history |
transactions:write | Retry failed transactions |
policies:read | View policies governing the agent |
policies:exceptions | Request and view policy exceptions |
counterparties:read | View counterparty information and trust |
counterparties:write | Create and update counterparties |
alerts:read | View agent alerts |
alerts:write | Acknowledge and resolve alerts |
agents:read | View agent profile and summary |
analytics:read | View spending analytics and trends |
network:read | Query network trust scores |
audit:read | View audit logs |
- Create or modify agents
- Create or modify wallets
- Change policies
- Access other agents’ data
Key Expiration
Keys can be set to expire:- No expiration - Key never expires (default)
- 30 days - For short-term testing
- 90 days - For production rotation
- 365 days - For long-term use
Revoking Keys
Via Dashboard
- Go to Agents → Your Agent → SDK Keys
- Click the Revoke button next to the key
Via API
Best Practices
Never Hardcode Keys
Never Hardcode Keys
Always use environment variables:
Separate Keys by Environment
Separate Keys by Environment
Use different keys for different environments:
.env.development
.env.production
Rotate Keys Regularly
Rotate Keys Regularly
Set up a key rotation schedule:
- Generate new key
- Update environment variables
- Deploy with new key
- Revoke old key
Monitor Key Usage
Monitor Key Usage
Check the dashboard for:
- Usage count
- Last used timestamp
- Any authentication errors
Use Secrets Management
Use Secrets Management
For production, use a secrets manager:
- AWS Secrets Manager
- HashiCorp Vault
- Google Secret Manager
- Azure Key Vault
Authentication Errors
| Error Code | Description | Solution |
|---|---|---|
AUTH_FAILED | Invalid API key | Check key is correct and not revoked |
EXPIRED_KEY | Key has expired | Generate a new key |
AGENT_INACTIVE | Agent is not active | Activate the agent in dashboard |
INSUFFICIENT_SCOPE | Key lacks permission | Use a key with required scope |