SaaS API Endpoints
Endpoints for usage tracking, plan enforcement, and SaaS integration. These APIs allow you to report usage, check plan status, and integrate the Agent-Pass core with the SaaS dashboard.
Overview
All SaaS API endpoints require authentication via API key. Usage is tracked per key and plan limits are enforced in real time.
- Report usage events from the core package
- Check current plan, usage, and limits
- Integrate with the Agent-Pass dashboard for analytics and billing
Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /api/agent-pass/status | GET | Get current plan, usage, and limits for the API key |
| /api/agent-pass/usage | POST | Report usage events and receive updated status |
Request & Response Examples
Get Plan Status
Request (with API Key)
GET /api/agent-pass/status
Authorization: Bearer <api-key>Response (200)
{
"plan": "PRO",
"limits": {
"monthlyOperations": 50000,
"maxAgents": 100,
"advancedFeatures": true,
"supportLevel": "standard"
},
"currentUsage": {
"monthlyOperations": 1234,
"agentCount": 3
},
"status": "active"
}Authentication
All requests must include a valid API key in the Authorization header as Bearer <api-key>.
- API keys are managed in the Agent-Pass dashboard
- Each key is linked to a user and plan
- Requests without a valid key will receive a 401 error
Error Handling
Common error responses include 401 Unauthorized, 400 Bad Request, and 500 Internal Server Error.
- 401: Missing or invalid API key
- 400: Invalid request format or missing fields
- 500: Internal server error (see logs for details)
Best Practices
- Batch usage events for efficiency
- Handle offline mode gracefully (queue and retry)
- Monitor plan status and handle over_limit responses
- Rotate API keys securely if compromised
