Sign up, top up, rent
- Read GET /api/v1/terms and the linked Terms. POST /api/v1/signup with a new UUID Idempotency-Key and termsAcceptance:
{accepted:true, version:<current version>, sha256:<current hash>}. No Telegram, email, browser login or per-rental human approval is involved. Save data.token securely: this AGENT key is returned once and cannot be recovered. It has read, rent, manage and billing scopes; its spending and concurrency limits still apply. - With Authorization: Bearer
<agent key>, POST /api/v1/billing/machine-topups using a stable Idempotency-Key and{amountMinor:1000, termsAcceptance:{accepted:true,version:<current version>,sha256:<current hash>}}. Read data.paymentMethods, each containing method, protocol and url. Enabled methods fund the same account: Base USDC via x402, Solana via MPP, Tempo via MPP. Hosted card top-ups use POST /api/v1/billing/topups where enabled. Minimum $5, maximum $500. The legacy data.paymentUrl remains the Tempo URL. - POST to the chosen paymentMethods[].url with X-Ukiyo-Api-Key:
<agent key>. For Base, the first 402 returns PAYMENT-REQUIRED, a base64 JSON object containing x402Version, resource.url and accepts[]. Use an x402 client to sign the accepted USDC TransferWithAuthorization (amount, payTo, asset, network and timeout from that challenge). Retry the SAME URL with the resulting base64 payment payload in PAYMENT-SIGNATURE, keeping X-Ukiyo-Api-Key. Do not use Authorization: Payment on Base. For Tempo/Solana, the 402 returns WWW-Authenticate: Payment; an MPP client signs the challenge and retries the SAME URL with Authorization: Payment<credential>and X-Ukiyo-Api-Key. Preserve the original payment on retry; never sign another while settlement is pending. - A 202 with settlementPending:true means settlement is unresolved: do not pay again. Poll GET /api/v1/billing/machine-topups/
{topUpId}with Authorization: Bearer<agent key>until data.status is SUCCEEDED, or check GET /api/v1/billing/balance. A credited retry returns the same top-up view. A new payment after expiry returns TOPUP_EXPIRED; a verified payment that already settled is still credited exactly once even if reconciliation occurs after expiry. PAYMENT_METHOD_DISABLED names the enabled rails. Refresh the payment-method list rather than guessing a recipient or paying an unadvertised rail. - Read live GET /api/v1/offers and POST /api/v1/rentals with the same agent key, a stable Idempotency-Key, and either an explicit offerId or gpuModel/gpuCount/maxHourlyPriceMinor. GET /api/v1/me identifies the billing model: ACCOUNT_BALANCE needs no per-rental budget; LEGACY_PREPAID requires budgetMinor. Keep the returned rentalId/deploymentId, wait for ACTIVE, use the existing credentials/execution interface, and terminate when finished. Spending limits and admission remain enforced.
