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

# Cancel Subscription

Cancel a subscription.

By default it ends when the paid-for period runs out, so the customer keeps
what they have already paid for. Until then the subscription stays `active`
with `cancel_at_period_end` set to `true`.

## Request authentication

This endpoint requires a **Secret Key** (`sk_...`).

## Request parameters

<ResponseField name="at_period_end" type="boolean" default="true">
  `false` ends the subscription immediately instead.
</ResponseField>

<ResponseField name="reason" type="string">
  Why it was canceled. Stored on the subscription for your own reporting.
</ResponseField>
