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

  • Report usage events from the core package
  • Check current plan, usage, and limits
  • Integrate with the Agent-Pass dashboard for analytics and billing

Endpoints

EndpointMethodDescription
/api/agent-pass/statusGETGet current plan, usage, and limits for the API key
/api/agent-pass/usagePOSTReport 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

  • 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

  • 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

Related Documentation