Buying programmatically
Everything you can buy in the Platform UI — credit, packages, gift tickets, rentals and plans — you can buy from code or an agent, with a key that has manage.
Credits sell at 1,000 per US dollar. The Builder and Scale plans are offered on the Tenzro Partner Cluster; no machine offers rentals and there are no credit packs right now, so those order types are refused until one is offered. GET /payment-methods says which payment methods are set up.
The flow
| Step | Call | Result |
|---|---|---|
| 1. Price it | POST /quotes | The amount, with nothing created |
| 2. Order it | POST /orders | An unpaid order and a pay_url |
| 3. Pay | POST /orders/{id}/pay | A Stripe Checkout link, or a stablecoin deposit address |
| 4. Confirm | GET /orders/{id} | Poll until status is paid |
1–2. Quote and order
curl https://api.tenzro.xyz/orders \
-H "Authorization: Bearer $TENZRO_API_KEY" -H "Content-Type: application/json" \
-d '{"type": "credits", "amount_usd": 25}'
# Grants 25,000 credits once paid.| type | Fields |
|---|---|
credits | amount_usd (the fiat amount paid; it buys credits once Tenzro Labs sets the rate), optional machine_id (pin), gift |
package | package_id from GET /packages, optional gift |
rental | machine_id, gpu, cpu_cores, memory_gb, storage_gb, hours |
subscription | machine_id, plan_id, optional renew_subscription_id |
3a. Pay by card
curl https://api.tenzro.xyz/orders/ord_.../pay -H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" -d '{"method": "card"}'
# → "payment": {"method": "card", "checkout_url": "https://checkout.stripe.com/c/pay/cs_..."}Open checkout_url in a browser. Plans bought by card renew monthly until canceled.
3b. Pay with stablecoin
curl https://api.tenzro.xyz/payment-methods # accepted chains and tokens
curl https://api.tenzro.xyz/orders/ord_.../pay -H "Authorization: Bearer $TENZRO_API_KEY" \
-H "Content-Type: application/json" -d '{"method": "stablecoin", "chain": "base", "token": "usdc"}'
# → "payment": {"method": "stablecoin",
# "deposit": {"chain": "base", "token": "usdc", "amount": "25.00", "address": "0x...", "memo": null}}- Send exactly
amountoftokenonchaintoaddress, from any wallet or exchange. - A different token or network cannot be matched and is returned.
- Calling pay again with the same chain and token returns the same address while it is waiting.
- Stablecoin plans cover 30 days and do not renew themselves — renew with
renew_subscription_id.
4. Confirm
curl https://api.tenzro.xyz/orders/ord_... -H "Authorization: Bearer $TENZRO_API_KEY"
# status: pending → processing → paid (or failed / expired / canceled)Poll every few seconds for card, every 10–30 seconds for stablecoin. Once paid: credit is in the balance, a rental is active, or a plan is active with its first month of credit. For a gift order, the response includes the ticket.code to hand over.
Tickets
Buy credit with gift: true to get a code instead of credit. Anyone can redeem it once with POST /credits/redeem or on the Credits page. List what you bought with GET /tickets.