Wallet

Top up wallet (agent-paid)

Add money to the wallet, paid by the calling agent over the Machine Payments Protocol (MPP). The first call answers 402 with a payment challenge in WWW-Authenticate; retry with a Payment-Authorization credential to settle the charge and credit the wallet.

post/v1/wallet/top-up

Request

  • Base URL: https://agent.tinyfish.ai
  • URL: https://agent.tinyfish.ai/v1/wallet/top-up
  • Auth: API key in header X-API-Key

Request body

amountstring required

Amount to add in USD, from 10.00 to 500.00. Charged over MPP once the agent presents a payment credential.

Example request

{
  "amount": "25.00"
}

Response

Payment settled and wallet credited

status'settled' | 'pending' required

settled: the wallet is credited. pending (HTTP 202): the card was charged and the credit lands shortly via webhook; do not pay again.

amountstring required
currency'USD' required
payment_referencestring required

Stripe PaymentIntent that settled this top-up.

ledger_entry_idstring nullable required
available_balancestring nullable required

Spendable balance after the credit landed; null when pending or unreadable.

hintstring

On a 202: do not pay again.

Example response

{
  "amount": "25.00",
  "currency": "USD",
  "payment_reference": "pi_3QxYz2Ab",
  "ledger_entry_id": "wallet-grant:machine-payment:pi_3QxYz2Ab",
  "available_balance": "31.44"
}

Changes

No recorded changes to this operation across all 1 revision of this API.