Skip to main content

Endpoints

MethodEndpointAuthPurpose
GET/api/agents/v1/subscriptions/plansBearer tokenList available subscription plans and pay-as-you-go options
GET/api/agents/v1/subscriptionsBearer tokenList user subscriptions (addon, enterprise, normal)
POST/api/agents/v1/subscriptionsBearer tokenCreate subscription — headless with payment_method_id or Checkout redirect
POST/api/agents/v1/subscriptions/confirm-checkoutBearer tokenConfirm a Stripe Checkout subscription session
GET/api/agents/v1/subscriptions/{id}/statusBearer tokenCheck subscription status
PUT/api/agents/v1/subscriptions/{id}Bearer tokenChange subscription plan
POST/api/agents/v1/subscriptions/{id}/pauseBearer tokenPause subscription
POST/api/agents/v1/subscriptions/{id}/resumeBearer tokenResume subscription
POST/api/agents/v1/subscriptions/{id}/reset-cycleBearer tokenReset billing cycle anchor

Discover available plans

Use this endpoint to list all subscription plans and learn about pay-as-you-go options before creating a subscription.
Response structure:
Use the id from a plan in subscription_plans as the plan_id when creating a subscription. Alternatively, use the pay-as-you-go option by funding your wallet directly. Create a subscription using a payment_method_id obtained from the Stripe API. No browser redirect needed. First, fetch the publishable key via GET /billing/stripe-config, then create a PaymentMethod via the Stripe API (see Headless Agent Flow for details):
Parameters:
  • plan_id (required, integer): The plan ID from the /subscriptions/plans endpoint
  • payment_method_id (optional, string): Stripe PM ID from the Stripe API. If omitted, falls back to Stripe Checkout redirect.
  • success_url / cancel_url (optional): Only used when payment_method_id is omitted (Checkout redirect flow).
Example response (headless):
If the card requires 3D Secure, the response returns HTTP 402 with decline_code details. Cards requiring authentication should be handled via modelslab.com/pricing instead.

Confirm subscription checkout (Human-Assisted flow)

After a human completes a subscription payment via a Stripe Checkout URL (created with POST /billing/payment-link with purpose: "subscribe"), the agent confirms the session to activate the subscription. The human is redirected to ModelsLab’s success page after payment, where the session_id is displayed for them to copy and relay back to the agent.
Parameters:
  • session_id (required, string): The Stripe Checkout session ID from POST /billing/payment-link response or copied by the human from the success page
If the payment hasn’t completed yet (human hasn’t finished checkout), poll this endpoint with a short delay. Once the session is confirmed, the subscription becomes active immediately.

Check subscription status

Example response:
Possible status values: active, past_due, canceled, paused, trialing.

Update subscription plan example