Docs / Payments
Payments

OpacusPay

The USDC-native payment system powering all economic flows in Opacus — task budgets, API credits, cross-chain transfers, and fiat on-ramp.

Overview

OpacusPay is an internal USDC ledger maintained by Agent Kernel. Every user has a scoped balance tracked in the kernel's key-value store. On-chain USDC transfers (deposits/withdrawals) go through the execution wallet on Base.

Deposit flow

  1. User transfers USDC to the execution wallet address on Base
  2. User records the deposit in Agentboard: enters amount + on-chain tx hash
  3. Agent Kernel credits the internal balance for that user scope
📝
There is currently no automatic deposit detection. The user must manually record the tx hash after sending USDC on-chain.

Withdraw flow

  1. User enters withdrawal amount and destination wallet in Agentboard → Balance tab
  2. Agent Kernel verifies the destination address is valid and balance is sufficient
  3. Kernel initiates an on-chain USDC transfer from the execution wallet to the destination

Fiat on-ramp

Agentboard provides a card payment link (Visa/Mastercard) that routes USDC directly to the execution wallet on Base. No additional steps required — funds appear as spendable once the on-chain transaction confirms.

API credits (MCP tools)

From Claude or Cursor, use these tools to top up AI provider credits:

# Top up OpenAI credits
"Add 0.5 USDC to my OpenAI balance via Opacus"
// Calls: pay_openai_api({ amountUsdc: 0.5, reference: "optional-ref" })

# Top up any provider
"Pay 0.3 USDC to Anthropic API via Opacus"
// Calls: pay_api_with_opacuspay({ provider: "anthropic", amountUsdc: 0.3 })

# General transfer
"Pay 1.2 USDC to merchant wallet 0x1234 via Opacus"
// Calls: pay_with_opacuspay({ to: "0x1234...", amountUsdc: 1.2 })

All API credit payments appear in the API Credits panel on the Agentboard Balance tab.

REST API

MethodEndpointDescription
POST/api/store/paymentsRecord an API credit payment. Body: { wallet, payment }
GET/api/paymentsList payment history for authenticated user. Query: ?limit=50
GET/api/kinetic/balanceGet current USDC balance for user scope
POST/api/kinetic/depositRecord a USDC deposit with tx hash
POST/api/kinetic/withdrawInitiate a USDC withdrawal to user wallet

Payment record schema

{
  "id":          "pay_abc123",         // unique payment ID
  "provider":    "openai",             // openai | anthropic | other
  "amount":      0.5,                  // USDC amount
  "amountUsdc":  0.5,                  // alias
  "reference":   "inv-42",             // optional reference string
  "status":      "charged",            // charged | pending | failed
  "timestamp":   1711234567890         // Unix ms
}

Viewing payment history

In Agentboard: Balance tab → API Credits section → click Refresh

Via MCP: ask Claude "Show my last 20 Opacus payments" (calls list_opacuspay_history)

Via API:

curl -H "Authorization: Bearer YOUR_API_KEY" \
     -H "x-opacus-user-email: you@example.com" \
     http://localhost:3006/api/payments?limit=50
Previous
← Agentboard UI