Skip to main content
Create a Stripe PaymentIntent to purchase prepaid credits, returning the client secret and the discount/fee charge breakdown
Audience: application and coding agent.

Canonical metadata

  • requestId
  • traceparent

Example request

curl -X POST \
  -H "Authorization: Bearer $SECAPI_BEARER_TOKEN" \
  -H "secapi-version: 2026-03-19" \
  -H "content-type: application/json" \
  -d '{"amountUsd":50,"paymentMethodType":"us_bank_account"}' \
  "https://api.secapi.ai/v1/billing/credits/topup"
Credit top-ups require a WorkOS bearer session with billing:manage and are limited to pay-as-you-go organizations with prepaid credits enabled. API keys are rejected, and the body must include a positive amountUsd.

Example response

{
  "requestId": "req_2ZK8Q1W9F4M6P7R3"
}

Give this prompt to your agent

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