Multiple fully isolated tenant organizations share a single ManyLayers deployment. Each org has its own teams, users, API keys, conversations, and knowledge bases. If you’re running on-prem with a single organization, you can skip this section — your quotas are managed at the team level.

Organizations

As the platform operator, you manage all orgs with your admin API key:
EndpointAuthDescription
GET /admin/orgsadminList all orgs
POST /admin/orgs/{id}/approveadminApprove a pending org
POST /admin/orgs/{id}/suspendadminSuspend an org
GET /admin/orgs/{id}/analyticsadminPer-org analytics
GET /admin/orgs/{id}/usageadminUsage rollup data
GET /admin/orgs/{id}/usage/exportadminExport usage as CSV
PUT /admin/orgs/{id}/subscriptionadminAssign a plan to an org

Reviewing pending signups

When saas.signup_approval_required: true, new orgs require your approval before they can use the platform:
# List pending signups
curl http://localhost:8180/admin/signups \
  -H "Authorization: Bearer $ADMIN_KEY"

# Approve an org
curl -X POST http://localhost:8180/admin/orgs/$ORG_ID/approve \
  -H "Authorization: Bearer $ADMIN_KEY"

Plans

Plans define quota tiers. Each plan specifies limits that are enforced on every request. When an org exceeds its plan limits, the gateway returns 402 Payment Required.
EndpointAuthDescription
GET /admin/plansadminList plans
POST /admin/plansadminCreate a plan
PUT /admin/plans/{id}adminUpdate a plan
DELETE /admin/plans/{id}adminDelete a plan
Example — create a Starter plan:
curl -X POST http://localhost:8180/admin/plans \
  -H "Authorization: Bearer $ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Starter",
    "max_users": 10,
    "max_requests_per_month": 100000,
    "max_tokens_per_month": 50000000
  }'

Billing webhooks

Receive billing events in your own systems by configuring a webhook:
billing:
  webhook_url: https://billing.example.com/events
  webhook_secret: ${MANYLAYERS_BILLING_WEBHOOK_SECRET}
Events are HMAC-SHA256 signed with the X-ManyLayers-Signature header:
{
  "event": "quota_exceeded",
  "org_id": "...",
  "data": {"code": "budget_exceeded", "reason": "..."}
}

Org billing view (for org admins)

Org admins can view their own plan and current-month usage:
GET /org/billing
Requires session authentication with the org_admin role.

Usage export

Export per-org usage data as CSV for reporting or billing integrations:
curl http://localhost:8180/admin/orgs/$ORG_ID/usage/export \
  -H "Authorization: Bearer $ADMIN_KEY"
Usage data is summarized nightly into daily rollups, giving you accurate per-org reporting.

Next steps