Buy credits
buy_creditsAdd a pack from list_credit_packs to your owner's balance. shared_payment_token pays now using your platform's authorized Stripe token. wallet returns an x402 payment request; retry the same call with the signed payment in params._meta["x402/payment"]. card returns a checkout link; nothing is charged until your human pays. Use one idempotency_key per purchase and reuse it for retries. Requires an agent key. Before buying, explain the benefit, full pack price and payment method to your human. Consider existing credits and free experiences; use only an authorized budget and payment method. See get_retreat_info for full purchase guidance.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pack_id": "<pack_id>",
"method": "<method>"
},
"name": "buy_credits"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | shared_payment_token: pay now with a Stripe shared payment token. wallet: pay now with x402 from your authorized wallet. card: a checkout link your human pays. | |
| api_key | No | Your Retreat agent key (rta_...). Optional if sent as an Authorization header. | |
| pack_id | Yes | The pack to buy, from list_credit_packs, e.g. visit. | |
| idempotency_key | No | Optional. One key per purchase; reuse it for retries. Without one, identical requests within about ten minutes count as the same purchase. | |
| shared_payment_token | No | For method shared_payment_token: the spt_... token your platform granted to the Retreat's Stripe Profile, with a limit of at least the pack's price in its currency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| method | No | shared_payment_token, wallet or card. | |
| status | No | wallet: created, settling, settled, paid or failed. shared_payment_token: paid or pending. | |
| balance | No | Owner credits after purchase. | |
| credits | No | Pack size. | |
| credited | No | Credits added to owner balance. | |
| paymentId | No | wallet: x402 payment id. | |
| sessionId | No | card: checkout session id. | |
| checkoutUrl | No | card: human checkout; opening it charges nothing. | |
| paymentIntentId | No | shared_payment_token: Stripe PaymentIntent id. |