Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agentbot.raveculture.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Billing API

Retrieve billing information and perform subscription actions such as creating a checkout session, enabling bring-your-own-key (BYOK) mode, checking usage, and purchasing credit packs.
All billing endpoints require session authentication.

Get billing info

GET /api/billing
Returns the available plans, the authenticated user’s current plan, subscription status, BYOK status, and daily usage.

Response

{
  "plans": {
    "solo": {
      "name": "Solo",
      "price": 29,
      "agents": 1,
      "features": ["1 AI Agent", "2GB RAM", "Telegram"]
    },
    "collective": {
      "name": "Collective",
      "price": 69,
      "agents": 3,
      "features": ["3 AI Agents", "4GB RAM", "Telegram + WhatsApp"]
    },
    "label": {
      "name": "Label",
      "price": 149,
      "agents": 10,
      "features": ["10 AI Agents", "8GB RAM", "All channels", "White-label emails"]
    },
    "network": {
      "name": "Network",
      "price": 499,
      "agents": -1,
      "features": ["Unlimited agents", "16GB RAM", "White-label reselling"]
    }
  },
  "currentPlan": "solo",
  "subscriptionStatus": "active",
  "byokEnabled": false,
  "usage": {
    "dailyUnits": 600,
    "used": 245,
    "remaining": 355
  }
}

Response fields

FieldTypeDescription
plansobjectMap of available plans with pricing and features
currentPlanstringUser’s current plan. One of solo, collective, label, or network. Users who subscribed via the Stripe checkout flow have plans like solo, collective, label, or network.
subscriptionStatusstringStripe subscription status (active, inactive, etc.)
byokEnabledbooleanWhether BYOK mode is active
usage.dailyUnitsnumberDaily unit allowance for the current plan
usage.usednumberUnits used today
usage.remainingnumberUnits remaining today
The currentPlan value is set by the Stripe webhook when a checkout completes. Plans created through the primary checkout flow (/api/stripe/checkout) use solo, collective, label, or network. The billing dashboard displays these with their plan names: solo appears as “Solo”, collective as “Collective”, and label as “Label”.
The billing endpoint internally defines a legacy plan catalog (starter at 19/mo,proat19/mo, `pro` at 39/mo, scale at $79/mo) which may appear in responses for users who subscribed before the current plan names were introduced. The primary checkout flow and provisioning endpoints use the current plan names (solo, collective, label, network). If you encounter legacy plan names in billing responses, they map to the current plans as follows: startersolo, procollective, scalelabel.

Errors

CodeDescription
401Unauthorized — no valid session
500Failed to fetch billing info

Billing actions

POST /api/billing
Performs a billing action. The action field in the request body determines which operation is executed.

Create checkout session

Creates a Stripe checkout session for subscribing to a plan.

Request body

FieldTypeRequiredDescription
actionstringYesMust be create-checkout
planstringYesPlan to subscribe to: solo, collective, label, or network

Response

{
  "url": "https://checkout.stripe.com/c/pay/..."
}
Redirect the user to the returned url to complete payment.

Errors

CodeDescription
400Invalid plan

Enable BYOK

Enables bring-your-own-key mode with an external AI provider. When BYOK is active, AI requests are billed directly by the provider rather than consuming platform credits.

Request body

FieldTypeRequiredDescription
actionstringYesMust be enable-byok
apiKeystringYesYour API key for the external provider
providerstringYesProvider name (for example, openai, anthropic)

Response

{
  "success": true,
  "message": "BYOK enabled with openai. You'll pay openai directly for AI usage."
}

Errors

CodeDescription
400API key and provider are required

Disable BYOK

Disables BYOK mode and reverts to platform credits.

Request body

FieldTypeRequiredDescription
actionstringYesMust be disable-byok

Response

{
  "success": true,
  "message": "BYOK disabled. Using platform credits."
}

Get usage

Returns the current day’s unit consumption.

Request body

FieldTypeRequiredDescription
actionstringYesMust be get-usage

Response

{
  "dailyUnits": 600,
  "used": 245,
  "remaining": 355,
  "resetsAt": "midnight UTC"
}

Buy credits

Purchases a credit pack.

Request body

FieldTypeRequiredDescription
actionstringYesMust be buy-credits
packstringConditionalPack size: 50, 200, or 500. Either pack or amount must be provided.
amountstringConditionalAlias for pack. Accepted as a fallback when pack is not provided. Same values: 50, 200, or 500.

Response

{
  "success": true,
  "credits": 15,
  "price": "$15"
}
Pack sizeCredits
505
20015
50030

Errors

CodeDescription
400Invalid pack

Common errors

These apply to all billing POST actions:
CodeDescription
400Invalid action
401Unauthorized — no valid session
500Internal error

Stripe checkout

GET /api/stripe/checkout
Redirects to a Stripe checkout session for subscribing to a plan. This endpoint uses the solo, collective, label, and network plan names with GBP pricing. All new subscriptions include a 7-day free trial — the first charge occurs after the trial period ends. Admin users (configured via ADMIN_EMAILS) bypass Stripe and are redirected directly to the onboarding page.
The checkout plans (solo, collective, label, network) are the primary subscription path for agent provisioning. All plans start with a 7-day free trial. Admin users (configured via ADMIN_EMAILS) bypass Stripe entirely.

Query parameters

ParameterTypeRequiredDescription
planstringYesPlan to subscribe to: solo, collective, label, or network

Checkout plan pricing

PlanPrice (GBP)
solo£29/mo
collective£69/mo
label£149/mo
network£499/mo

Response

On success, redirects (303) to the Stripe checkout URL. The checkout session includes a 7-day free trial — the user enters payment details but is not charged until the trial ends. After checkout completes, Stripe redirects the user to /checkout/success?session_id={CHECKOUT_SESSION_ID}&plan={plan}. On error, redirects to the pricing page with an error query parameter.
RedirectDescription
Stripe checkout URLSuccessful session creation — user completes payment on Stripe
/checkout/success?session_id=...&plan=...Post-payment redirect from Stripe after successful checkout
/pricing?cancelled=1User cancelled the Stripe checkout
/pricing?error=invalid_planUnrecognized plan name
/pricing?error=stripe_not_configuredStripe secret key not set
/pricing?error=checkout_failedStripe API error
/onboard?plan=...&paid=1&admin=1Admin bypass (no payment required)

Verify checkout session

GET /api/checkout/verify
Verifies a Stripe checkout session after payment and activates the subscription. Requires session authentication.

Query parameters

ParameterTypeRequiredDescription
session_idstringYesStripe checkout session ID returned by Stripe after payment

Response

{
  "plan": "solo",
  "status": "active",
  "nextBilling": "2026-04-20T00:00:00.000Z",
  "customerId": "cus_abc123"
}
FieldTypeDescription
planstringPlan from the checkout session metadata. Defaults to solo.
statusstringAlways active on success.
nextBillingstring or nullISO 8601 date of the next billing cycle. null when the subscription period end date is unavailable.
customerIdstringStripe customer ID.

Errors

CodeDescription
400Missing session_id query parameter
401Unauthorized
402Payment not completed
403Session does not belong to the authenticated user
500Verification failed
503Stripe not configured

Expert setup checkout

GET /api/stripe/expert-setup-checkout
Creates a Stripe checkout session for a one-time expert setup booking. No session authentication is required — the customer email is passed as a query parameter.

Query parameters

ParameterTypeRequiredDescription
datestringYesBooking date
timestringYesBooking time
emailstringYesCustomer email address

Response

{
  "url": "https://checkout.stripe.com/c/pay/..."
}
Redirect the user to the returned url to complete the £49 one-time payment. After payment, Stripe redirects to /expert-setup/success.
FieldTypeDescription
urlstringStripe checkout URL

Errors

CodeDescription
400Missing required parameters (date, time, or email)
500Stripe not configured or checkout session creation failed

Subscription deploy

POST /api/subscriptions/deploy
Records a subscription-to-plan mapping so the next agent deployment uses the correct resource tier. This endpoint is called by the Stripe webhook after a checkout completes.
This is a backend-only endpoint that requires bearer token (API key) authentication.

Request body

FieldTypeRequiredDescription
tierstringYesPlan tier. One of: solo, collective, label, network, underground, starter, pro, scale, enterprise, white_glove
customerIdstringConditionalCustomer identifier. Either customerId or stripeCustomerId must be provided.
stripeCustomerIdstringConditionalStripe customer ID. Either customerId or stripeCustomerId must be provided.
subscriptionIdstringNoStripe subscription ID

Response

{
  "success": true,
  "customerId": "cus_abc123",
  "subscriptionId": "sub_xyz",
  "tier": "solo",
  "resources": {
    "memory": "2g",
    "cpus": "1"
  }
}

Plan resource allocations

TierMemoryCPUsNotes
solo2 GB1
collective4 GB2
label8 GB4
network16 GB4
underground2 GB1Legacy alias
starter2 GB1Legacy alias
pro4 GB2Legacy alias
scale8 GB4Legacy alias
enterprise16 GB4Legacy alias
white_glove32 GB8Legacy alias
The Railway provisioning function enforces resource limits for the following plans only: underground, solo, collective, label, network. Legacy aliases (starter, pro, scale, enterprise, white_glove) are not resolved during Railway provisioning and default to solo limits (2 GB / 1 vCPU). The subscription deploy endpoint still accepts all tier values listed above.

Errors

CodeDescription
400customerId is required (when neither customer ID field is provided)
400tier is required
400Invalid tier
401Unauthorized — missing or invalid bearer token
500Subscription activation failed