Quickstart
Provision an agent wallet, set a spending policy, and make your first MPP-native payment in under five minutes.
Prerequisites
- An MPPPal operator account — request access here
- Your operator API key from the dashboard
- USDC to fund your first agent wallet (testnet USDC available on devnet)
Step 1 — Install the SDK
npm install @mpppal/sdk
Set your API key as an environment variable. Never hardcode credentials in source.
export MPPPAL_API_KEY="mpk_live_..."
Step 2 — Provision an agent wallet
Each AI agent gets its own wallet — a Program Derived Address (PDA) on Solana with an associated USDC token account and an on-chain spending policy. One API call.
import { MPPPal } from "@mpppal/sdk";
const client = new MPPPal({ apiKey: process.env.MPPPAL_API_KEY });
const wallet = await client.accounts.create({
name: "research-agent-prod",
});
console.log(wallet.account_id); // acct_01j8k4x9p2qrst7yz
console.log(wallet.solana_address); // 9xTz4KqR8mYvPn3Sd...
console.log(wallet.usdc_token_account); // Fund this address with USDC
Or via the REST API:
curl -X POST https://api.mpppal.com/v1/accounts \
-H "Authorization: Bearer $MPPPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "research-agent-prod"}'
{
"account_id": "acct_01j8k4x9p2qrst7yz",
"name": "research-agent-prod",
"solana_address": "9xTz4KqR8mYvPn3SdFgHj6WbCeAuLo1XkQi5NtZpMwV",
"usdc_token_account": "7mZp2VbQnXeYjLo9KrTzFdCgWqA3ShNkRi4UwPtMxHs",
"balance_usdc": "0.000000",
"status": "active"
}
Step 3 — Set a spending policy
Set policy before you fund the wallet. An unfunded wallet with no policy is harmless. A funded wallet with no policy has no limits.
await client.policy.update(wallet.account_id, {
max_single_transfer: 5, // No single payment over $5 USDC
max_daily_spend: 50, // $50/day cap
categories: ["inference", "data"], // Only inference and data providers
require_memo: true,
paused: false,
});
Step 4 — Fund the wallet
Send USDC to the usdc_token_account address returned in step 2. This is a Solana SPL token account — fund it with USDC only. Do not send SOL to this address.
usdc_token_account, not the solana_address. They are different. Sending SOL to a USDC token account results in unrecoverable funds.
Confirm the balance:
const { balance_usdc } = await client.accounts.getBalance(wallet.account_id);
console.log(`Balance: $${balance_usdc} USDC`);
// Balance: $50.000000 USDC
Step 5 — Make a payment via MPP
Wrap the SDK's HTTP client around your agent's outbound calls. MPPPal intercepts HTTP 402 responses, resolves the payment challenge, and retries the request — no changes to your agent's logic.
import { MPPPal } from "@mpppal/sdk";
const agent = new MPPPal.Agent({
wallet: wallet.account_id,
apiKey: process.env.MPPPAL_AGENT_KEY, // agent-scoped key, not operator key
});
const http = agent.createHttpClient();
// This call may return HTTP 402 — MPPPal resolves it automatically
const result = await http.post("https://api.someservice.xyz/inference", {
prompt: "Summarize Q3 earnings calls",
});
// Payment settled on Solana. Receipt available in transaction history.
console.log(result.data);
GET /v1/accounts/:id/transactions.
Step 6 — Make a direct transfer (optional)
For direct agent-to-agent or agent-to-service transfers that don't use MPP, use the Transfers API. Every transfer requires a unique idempotency_key.
const transfer = await client.transfers.create({
from: wallet.account_id,
to: "acct_02k9...", // another MPPPal account or raw SPL address
amount: "12.50",
memo: "Task reward: compute-88",
idempotency_key: "task-88-reward-2026-04-13",
});
console.log(transfer.status); // "settled"
console.log(transfer.tx_signature); // Solana tx signature