> ## Documentation index
> Fetch the complete documentation index at: https://docs.leadity.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get subscription

> Read the account's plan and every credit expiry.

Answers the account's monthly plan, or null when it has none (most accounts buy one-time packs), any older plans still running out beside it, and every expiring credit on the balance grouped by the exact moment it expires. Credits from a one-time pack never expire and are not listed. Cancelling or changing a plan is done by a person on Whop, at manageUrl.

`GET https://api.leadity.io/v1/billing/subscription`

- Scope: `read`
- Spends credits: no
- MCP tool: `get_subscription`

## Headers

- `Authorization`, string, required. Bearer, a space, then an API key: Bearer lk_api_... An MCP key is refused here with wrong_key_kind.

## Example request

```bash cURL
curl "https://api.leadity.io/v1/billing/subscription" \
  -H "Authorization: Bearer $LEADITY_API_KEY"
```

```javascript Node.js
const response = await fetch("https://api.leadity.io/v1/billing/subscription", {
  headers: {
    Authorization: `Bearer ${process.env.LEADITY_API_KEY}`,
  },
});

const data = await response.json();
console.log(data);
```

```python Python
import os

import requests

response = requests.get(
    "https://api.leadity.io/v1/billing/subscription",
    headers={
        "Authorization": f"Bearer {os.environ['LEADITY_API_KEY']}",
    },
)

print(response.json())
```

## Response

- `subscription`, object | null, required. The plan the account keeps, or null.
  - `planSku`, string, required. The plan's sku.
  - `credits`, integer, required. Credits each payment grants.
  - `priceCents`, integer, required. The price of each payment in US cents.
  - `status`, string, required. The plan's state on Whop: active, or past_due while a payment is failing.
  - `cancelAtPeriodEnd`, boolean, required. True once the plan was cancelled: it will not renew.
  - `currentPeriodStart`, string, required. When the latest payment's credits were granted. An ISO 8601 timestamp in UTC.
  - `currentPeriodEnd`, string, required. When the latest payment's credits expire. An ISO 8601 timestamp in UTC.
  - `nextPaymentAt`, string | null, required. When Whop will next charge the plan, when known. An ISO 8601 timestamp in UTC, or null.
  - `manageUrl`, string, required. Where a person manages or cancels the plan on Whop.
- `others`, object[], required. Other plans still live beside it, newest first: a plan that stopped renewing when a new size started. Usually empty.
  - `planSku`, string, required. The plan's sku.
  - `credits`, integer, required. Credits each payment grants.
  - `priceCents`, integer, required. The price of each payment in US cents.
  - `status`, string, required. The plan's state on Whop: active, or past_due while a payment is failing.
  - `cancelAtPeriodEnd`, boolean, required. True once the plan was cancelled: it will not renew.
  - `creditsExpireAt`, string | null, required. When this plan's latest credits expire. An ISO 8601 timestamp in UTC, or null.
  - `remainingCredits`, integer, required. What is left of this plan's own credits.
- `expiring`, object[], required. Every expiring credit on the balance, one entry per exact expiry, soonest first. Expiring credits are spent first.
  - `credits`, integer, required.
  - `expiresAt`, string, required. When these credits expire. An ISO 8601 timestamp in UTC.

## Example response

```json 200
{
  "subscription": {
    "planSku": "monthly_pack_2000",
    "credits": 2000,
    "priceCents": 4900,
    "status": "active",
    "cancelAtPeriodEnd": false,
    "currentPeriodStart": "2026-09-20T10:02:11.000Z",
    "currentPeriodEnd": "2026-10-20T10:02:11.000Z",
    "nextPaymentAt": "2026-10-20T10:02:00.000Z",
    "manageUrl": "https://whop.com/@me/settings/orders/"
  },
  "others": [],
  "expiring": [
    {
      "credits": 1310,
      "expiresAt": "2026-10-20T10:02:11.000Z"
    }
  ]
}
```

## Errors

Every refusal answers `{ error, message }` with the status below. The full list is on the [Errors](https://docs.leadity.io/errors) page.

| Code | Status | Meaning | Extra fields |
| --- | --- | --- | --- |
| `unauthorized` | 401 | The API key is missing, malformed, revoked or expired. | - |
| `wrong_key_kind` | 401 | This key opens the other surface: an API key works on the HTTP API, an MCP key on the MCP server. | - |
| `account_suspended` | 403 | The account is suspended. | - |
| `email_not_verified` | 403 | The account's email address is not verified yet. | - |
| `rate_limited` | 429 | Too many requests. Wait for the Retry-After seconds and try again. | `retryAfterSeconds`: The seconds to wait, the same number as the Retry-After header. |
| `try_again` | 503 | Leadity could not answer just now. Retry in a moment, with the same Idempotency-Key on a spending call. | `retryAfterSeconds`: When a request with this Idempotency-Key is still being processed: the seconds to wait before retrying with the same key, as the Retry-After header says. |
| `internal_error` | 500 | Something failed on our side. Nothing was charged twice. | `body`: On the MCP server, when Leadity answered in a shape the tool does not publish: that answer as it came. |
