> For the complete documentation index, see [llms.txt](https://docs.visualsentinel.com/llms.txt)

# Billing API

Subscription management and checkout. This page lists all 2 endpoints in the Billing area of the Visual Sentinel REST API.

Base URL: `https://visualsentinel.com`. Unless an endpoint says otherwise it accepts an API key or a session cookie, see [Authentication](https://docs.visualsentinel.com/guides/authentication.md). Most error responses use the [ErrorResponse](https://docs.visualsentinel.com/reference/models/error-response.md) shape, see [Errors](https://docs.visualsentinel.com/guides/errors.md) and [Rate limits](https://docs.visualsentinel.com/guides/rate-limits.md).

## Endpoints

- [Create checkout session](#create-checkout): `POST /api/billing/checkout`
- [Get billing portal URL](#get-billing-portal): `POST /api/billing/portal`

## Create checkout session

`POST /api/billing/checkout`

Create a checkout session for a subscription purchase.

Authentication: session cookie only. API keys are refused.

Request body (required): object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | Yes | One of: `free`, `starter`, `business`, `agency`. |
| `email` | string (email) | No |   |
| `billing` | string | No | One of: `monthly`, `yearly`. Default: `monthly`. |

**Responses**

- `200`: Checkout session URL. Body: object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checkoutUrl` | string (uri) | No |   |

## Get billing portal URL

`POST /api/billing/portal`

Get the billing portal URL for managing a subscription.

Authentication: session cookie only. API keys are refused.

**Responses**

- `200`: Portal URL. Body: object.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string (uri) | No |   |

Generated from the OpenAPI 3.1 specification at [https://docs.visualsentinel.com/openapi.json](https://docs.visualsentinel.com/openapi.json), the same file the interactive reference reads.
