---
title: "Upgrade Account"
method: POST
path: "/billing/upgrade-account"
tags: ["billing"]
---

# Upgrade Account

`POST /billing/upgrade-account`

Upgrade user's account to Pro or Enterprise plan.

This endpoint creates a Stripe Checkout session for the user to complete payment.
After successful payment, the webhook will update the user's plan and reset their token usage.

Args:
    request: Plan selection and redirect URLs
    auth: Authenticated user context

Returns:
    Checkout URL to redirect user to

## Request body

- UpgradeAccountRequest — Request model for upgrading account plan.
  - `plan` 'hobby' | 'pro' | 'enterprise', required — Target plan to upgrade to
  - `success_url` string, required — URL to redirect to after successful payment
  - `cancel_url` string, required — URL to redirect to if user cancels
  - `force_checkout` boolean — When true, skip using existing payment method and always create a Stripe Checkout session.

## Response `200`

Successful Response

- UpgradeAccountResponse — Response model for upgrade account.
  - `success` boolean, required
  - `checkout_url` string, nullable
  - `already_subscribed` boolean
  - `message` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/versions/31dfe831e079/schema)
