> ## Documentation Index
> Fetch the complete documentation index at: https://60db.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscribe

> Subscribe to a plan

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  application/json
</ParamField>

### Body

<ParamField body="plan_id" type="string" required>
  ID of the plan to subscribe to
</ParamField>

<ParamField body="billing_cycle" type="string" default="monthly">
  Billing cycle: "monthly" or "annual"
</ParamField>

## Response

<ResponseField name="subscription" type="object">
  Subscription object
</ResponseField>

<ResponseField name="subscription.id" type="string">
  Subscription ID
</ResponseField>

<ResponseField name="subscription.plan" type="object">
  Plan details
</ResponseField>

<ResponseField name="subscription.status" type="string">
  Subscription status
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.60db.ai/billing/subscribe \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "plan_id": "pro",
      "billing_cycle": "monthly"
    }'
  ```

  ```javascript JavaScript theme={null}
  await client.subscribe("pro");
  ```

  ```python Python theme={null}
  client.subscribe('pro')
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "subscription": {
      "id": "sub-123",
      "plan": {
        "id": "pro",
        "name": "Pro",
        "price": 29
      },
      "status": "active",
      "billing_cycle": "monthly",
      "next_billing_date": "2026-02-29T00:00:00Z"
    }
  }
  ```
</ResponseExample>
