credits

Create a credit top-up

Changed on

Creates a USDC checkout for the amount and returns its x402_url for an agent to pay. Credits land once the payment settles; poll the status route or morph billing topup-status --wait. Organization keys top up the organization and require an organization admin.

post/api/v1/credits/topups

Request

  • Base URL
    https://api.morphllm.com
  • Auth
    HTTP bearer

Request body

idempotencyKeystring uuid

UUID v4. Retrying with the same key returns the same checkout instead of creating another.

Example request

{
  "amount": "25.00",
  "idempotencyKey": "3b241101-e2bb-4255-8caf-4136c566a962"
}

Response

Top-up created.

checkoutIdstring required

Checkout id. Poll it at GET /api/v1/credits/topups/{checkoutId}.

status'ACTIVE' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'EXPIRED' | 'DEACTIVATED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' required

Coinbase checkout status. ACTIVE accepts payment at x402_url; PROCESSING means capture is under way; COMPLETED means settled. FAILED, EXPIRED and DEACTIVATED are terminal and unpaid, so start a new top-up. A completed top-up can later become REFUNDED or PARTIALLY_REFUNDED.

amountstring required

USD amount, two decimals.

currency'USDC' required

Settlement currency.

x402_urlstring uri required

POST here with an x402 client that supports the auth-capture scheme on Base (AuthCaptureEvmScheme from @x402/evm). A 200 means the funds are authorized, not yet credited. Accepts payment for 24 hours.

urlstring uri required

Hosted checkout page for paying the same top-up in a browser.

Example response

{
  "checkoutId": "6ae3c4f9b78e569c621631be",
  "status": "ACTIVE",
  "amount": "25.00",
  "currency": "USDC",
  "x402_url": "https://api.cdp.coinbase.com/platform/v2/payment-sessions/paymentSession_9a323500-bd94-47f5-9ca8-2dc60e19a8e9/authorizations/x402",
  "url": "https://payments.coinbase.com/payment-sessions/paymentSession_9a323500-bd94-47f5-9ca8-2dc60e19a8e9"
}

Changes