Subscriptions & Plans
Manage subscription plans with Stripe-powered billing, automatic credit grants, and feature access control.
How Subscriptions Work
Browse plans
Fetch available plans with their features and pricing. Plans control rate limits, feature access, and monthly credit grants.
Create checkout session
Redirect the user to Stripe Checkout to complete payment. Supports monthly and yearly billing.
Automatic activation
After payment, the Stripe webhook activates the subscription, grants credits, and unlocks plan features — all automatically.
List Plans
/v1/plansPublicFetch all publicly available subscription plans with their features and pricing:
curl https://api.llmhub.one/v1/plansResponse
[
{
"id": "plan-free",
"name": "Free",
"slug": "free",
"description": "Get started with basic access",
"monthly_price_cents": 0,
"yearly_price_cents": 0,
"features": {
"max_requests_per_minute": 10,
"max_requests_per_day": 100,
"max_agents": 1,
"max_rag_servers": 1,
"image_generation": false,
"workflows": false,
"sabine": false
},
"sort_order": 1
},
{
"id": "plan-pro",
"name": "Pro",
"slug": "pro",
"description": "For professionals and power users",
"monthly_price_cents": 1900,
"yearly_price_cents": 19000,
"credit_grant_monthly": 500000,
"features": {
"max_requests_per_minute": 60,
"max_requests_per_day": 5000,
"max_agents": 10,
"max_rag_servers": 5,
"image_generation": true,
"workflows": true,
"sabine": true,
"vision": true,
"function_calling": true
},
"sort_order": 2
}
]Get Current Subscription
/v1/subscriptionAuth RequiredGet your current subscription status and plan details:
curl https://api.llmhub.one/v1/subscription \
-H "Authorization: Bearer $LLMHUB_API_KEY"Response
{
"has_subscription": true,
"subscription": {
"id": "sub-uuid",
"user_id": "user-uuid",
"plan_id": "plan-pro",
"stripe_subscription_id": "sub_xxx",
"status": "active",
"interval": "monthly",
"current_period_start": "2026-03-01T00:00:00Z",
"current_period_end": "2026-04-01T00:00:00Z",
"created_at": "2026-01-15T10:00:00Z"
},
"plan": {
"id": "plan-pro",
"name": "Pro",
"slug": "pro",
"monthly_price_cents": 1900,
"features": { ... }
}
}Subscribe to a Plan
/v1/subscription/checkoutAuth RequiredCreate a Stripe Checkout session to subscribe. Redirect the user to the returned URL to complete payment.
curl -X POST https://api.llmhub.one/v1/subscription/checkout \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLMHUB_API_KEY" \
-d '{
"plan_id": "plan-pro",
"interval": "monthly",
"success_url": "https://yourdomain.com/dashboard?subscribed=true",
"cancel_url": "https://yourdomain.com/dashboard/subscription"
}'Parameters
| Parameter | Type | Description |
|---|---|---|
plan_idRequired | string | ID of the plan to subscribe to |
interval | string | Billing interval: monthly or yearly. Default: monthly |
success_urlRequired | string | Redirect URL after successful payment |
cancel_urlRequired | string | Redirect URL if user cancels checkout |
Response
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_xxx...",
"session_id": "cs_xxx"
}Billing Portal
/v1/subscription/portalAuth RequiredOpen the Stripe customer portal where users can manage payment methods, view invoices, and update billing information:
curl -X POST https://api.llmhub.one/v1/subscription/portal \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLMHUB_API_KEY" \
-d '{
"return_url": "https://yourdomain.com/dashboard/subscription"
}'Response
{
"portal_url": "https://billing.stripe.com/p/session/xxx..."
}Cancel Subscription
/v1/subscription/cancelAuth RequiredCancel at the end of the current billing period. The subscription remains active until the period ends — features are not removed immediately.
curl -X POST https://api.llmhub.one/v1/subscription/cancel \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLMHUB_API_KEY" \
-d '{
"reason": "Too expensive",
"feedback": "Would return if pricing was lower"
}'Response
{
"message": "Subscription will be cancelled at end of billing period",
"cancel_at": "2026-04-01T00:00:00Z",
"subscription": {
"id": "sub-uuid",
"status": "active",
"cancel_at_period_end": true,
"current_period_end": "2026-04-01T00:00:00Z"
}
}Change Plan
/v1/subscription/change-planAuth RequiredUpgrade or downgrade your plan. Stripe handles proration automatically — you'll only be charged for the difference.
curl -X POST https://api.llmhub.one/v1/subscription/change-plan \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLMHUB_API_KEY" \
-d '{
"plan_id": "plan-business",
"interval": "yearly"
}'Frontend Integration
Example of a subscription checkout flow in a web application:
// Frontend: redirect to Stripe Checkout
async function subscribe(planId: string, interval: 'monthly' | 'yearly') {
const response = await fetch('/v1/subscription/checkout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`,
},
body: JSON.stringify({
plan_id: planId,
interval,
success_url: window.location.origin + '/dashboard?subscribed=true',
cancel_url: window.location.origin + '/dashboard/subscription',
}),
});
const { checkout_url } = await response.json();
window.location.href = checkout_url;
}
// After successful checkout, Stripe webhook automatically:
// 1. Creates UserSubscription record
// 2. Grants monthly credit allocation
// 3. Activates plan featuresOther Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/plans/:id | Get plan details by ID or slug |
| POST | /v1/subscription/reactivate | Reactivate a cancelled subscription before period ends |
| GET | /v1/subscription/history | List all past and current subscriptions |
| GET | /v1/subscription/invoices | List invoices (last 100) |

