Authentication
Authenticate with AgnicPay using OAuth2 or API tokens
Authentication
AgnicPay supports two authentication methods to access the API and AI Gateway.
Authentication Methods
Which Should I Use?
| Use Case | Recommended Method |
|---|---|
| Your own scripts/agents | API Tokens |
| CI/CD pipelines | API Tokens |
| Third-party app integration | OAuth2 |
| User-facing applications | OAuth2 |
| MCP servers | API Tokens |
| N8N workflows | OAuth2 |
Quick Comparison
| Feature | API Tokens | OAuth2 |
|---|---|---|
| Setup complexity | Simple | Moderate |
| User authorization | Not required | Required |
| Spending limits | Set by you | Set by user |
| Token lifespan | Until revoked | 30-60 days |
| Best for | Personal use | Multi-user apps |
Token Formats
All AgnicPay tokens follow a predictable format:
| Prefix | Type | Description |
|---|---|---|
agnic_tok_ | API Token | Direct API access token |
agnic_at_ | Access Token | OAuth2 access token |
agnic_rt_ | Refresh Token | OAuth2 refresh token |