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

# POST /v1/billing/payg/enable

> Enable pay-as-you-go in one flow: save a card, make an initial credit top-up, and optionally turn on auto-top-up (returns a PaymentIntent client secret)

Enable pay-as-you-go in one flow: save a card, make an initial credit top-up, and optionally turn on auto-top-up (returns a PaymentIntent client secret)

<Info>
  Audience: application and coding agent.
</Info>

## Canonical metadata

* `requestId`
* `traceparent`

## Example request

<RequestExample>
  ```bash theme={null}
  curl -X POST \
    -H "Authorization: Bearer $SECAPI_BEARER_TOKEN" \
    -H "secapi-version: 2026-03-19" \
    -H "content-type: application/json" \
    -d '{"amountUsd":10,"autoTopupThresholdCents":1000,"autoTopupAmountCents":2500}' \
    "https://api.secapi.ai/v1/billing/payg/enable"
  ```
</RequestExample>

<Info>
  Billing funding changes require a WorkOS bearer session with `billing:manage`. API keys are rejected so payment setup, refunds, and auto-top-up controls stay limited to interactive billing administrators.
</Info>

## Example response

<ResponseExample>
  ```json theme={null}
  {
    "object": "payg_enable_intent",
    "clientSecret": "pi_example_secret_example",
    "paymentIntentId": "pi_example",
    "breakdown": {
      "creditsCents": 1000,
      "discountCents": 0,
      "feeCents": 30,
      "totalChargeCents": 1030,
      "currency": "usd"
    },
    "requestId": "req_2ZK8Q1W9F4M6P7R3"
  }
  ```
</ResponseExample>

## Give this prompt to your agent

<Prompt>
  Use SEC API POST /v1/billing/payg/enable to enable pay-as-you-go in one flow: save a card, make an initial credit top-up, and optionally turn on auto-top-up (returns a PaymentIntent client secret). Preserve `requestId`, `traceparent` in the output. Return a concise markdown summary plus the exact structured payload fields that a downstream engineer or agent should keep using this result.
</Prompt>

## Failure posture

* treat non-2xx responses as contract-aware failures, not free-form errors
* preserve `requestId` and `traceparent` in logs and downstream reports
* if provenance or freshness metadata is present, return it unchanged so trust is not lost in the handoff
