Skip to content

Billing API

Manage subscriptions, view usage, and handle payments via LemonSqueezy.

Create Checkout Session

Start a LemonSqueezy Checkout flow to upgrade.

http
POST /billing/checkout
Authorization: Bearer <token>
Content-Type: application/json

Request Body:

json
{
  "tier": "pro"
}
FieldTypeValuesDescription
tierstringpro, teamTarget subscription tier

Response (200):

json
{
  "checkoutUrl": "https://lunaos.lemonsqueezy.com/checkout/...",
  "sessionId": "cs_..."
}

Redirect the user to checkoutUrl to complete payment.


Get Subscription

View the current user's subscription status.

http
GET /billing/subscription
Authorization: Bearer <token>

Response (200) — Subscribed user:

json
{
  "tier": "pro",
  "status": "active",
  "subscription": {
    "id": "sub_...",
    "currentPeriodStart": "2026-02-01T00:00:00.000Z",
    "currentPeriodEnd": "2026-03-01T00:00:00.000Z",
    "cancelAtPeriodEnd": false,
    "createdAt": "2026-02-01T00:00:00.000Z"
  }
}

Response (200) — Free user:

json
{
  "tier": "free",
  "status": "active",
  "subscription": null
}

Get Usage

View current rate limit usage and subscription details.

http
GET /billing/usage
Authorization: Bearer <token>

Response (200):

json
{
  "tier": "pro",
  "rateLimit": {
    "limit": 600,
    "window": "1m",
    "used": 12,
    "remaining": 588
  },
  "period": {
    "start": "2026-02-01T00:00:00.000Z",
    "end": "2026-02-28T23:59:59.000Z"
  },
  "features": {
    "managedKeys": true,
    "mcpServers": 33,
    "rag": true,
    "visualQA": true
  }
}

Cancel Subscription

Cancel at end of current billing period.

http
POST /billing/cancel
Authorization: Bearer <token>

Response (200):

json
{
  "message": "Subscription will be canceled at end of billing period"
}

Customer Portal

Create a LemonSqueezy portal session for managing billing.

http
POST /billing/portal
Authorization: Bearer <token>

Response (200):

json
{
  "portalUrl": "https://app.lemonsqueezy.com/my-orders/..."
}

Redirect the user to portalUrl to manage their subscription, update payment method, or view invoices.


Plan Comparison

FeatureFree ($0)Pro ($29/mo)Team ($79/mo)
CommandsUnlimitedUnlimitedUnlimited
API KeysBYOKManaged keysManaged keys
AccessCLI + Dashboard + StudioCLI + Dashboard + StudioCLI + Dashboard + Studio
MCP Servers33 MCP servers33 MCP servers
RAG
Visual QA
Rate limit60/min600/min6,000/min
Team workspace
SSO / SAML
Shared memory
Audit logs
SupportCommunityPriorityDedicated + SLA