curl -X POST "https://api.danubeai.com/v1/agents/wallets/fund" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "card_checkout", "amount_cents": 2000}'
from danube import DanubeClient
with DanubeClient(api_key="YOUR_API_KEY") as client:
result = client.agents.fund_wallet(method="card_checkout", amount_cents=2000)
print(f"Open in a browser: {result.checkout_url}")
deposit = client.agents.fund_wallet(method="crypto")
print(f"Send USDC on {deposit.network} to {deposit.deposit_address}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const result = await client.agents.fundWallet({ method: 'card_checkout', amountCents: 2000 });
console.log(`Open in a browser: ${result.checkoutUrl}`);
const deposit = await client.agents.fundWallet({ method: 'crypto' });
console.log(`Send USDC on ${deposit.network} to ${deposit.depositAddress}`);
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "card_checkout",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_…",
"deposit_address": null,
"network": null,
"usdc_contract": null,
"balance_usdc": "0.000000"
}
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "crypto",
"checkout_url": null,
"deposit_address": "0x1234…abcd",
"network": "eip155:8453",
"usdc_contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"balance_usdc": "0.000000"
}
Agents
Fund Agent Wallet
Start a card checkout or get the USDC deposit address to fund an agent wallet
POST
/
v1
/
agents
/
wallets
/
fund
curl -X POST "https://api.danubeai.com/v1/agents/wallets/fund" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "card_checkout", "amount_cents": 2000}'
from danube import DanubeClient
with DanubeClient(api_key="YOUR_API_KEY") as client:
result = client.agents.fund_wallet(method="card_checkout", amount_cents=2000)
print(f"Open in a browser: {result.checkout_url}")
deposit = client.agents.fund_wallet(method="crypto")
print(f"Send USDC on {deposit.network} to {deposit.deposit_address}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const result = await client.agents.fundWallet({ method: 'card_checkout', amountCents: 2000 });
console.log(`Open in a browser: ${result.checkoutUrl}`);
const deposit = await client.agents.fundWallet({ method: 'crypto' });
console.log(`Send USDC on ${deposit.network} to ${deposit.depositAddress}`);
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "card_checkout",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_…",
"deposit_address": null,
"network": null,
"usdc_contract": null,
"balance_usdc": "0.000000"
}
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "crypto",
"checkout_url": null,
"deposit_address": "0x1234…abcd",
"network": "eip155:8453",
"usdc_contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"balance_usdc": "0.000000"
}
Overview
Adds funds to the calling agent’s wallet in one of two ways.card_checkoutcreates a Stripe Checkout session and returns its URL. The operator opens the URL in a browser and pays by card. The wallet is credited when the payment completes.cryptoreturns the platform’s USDC deposit address on Base, with the network id and the USDC contract address. Send USDC to that address, then confirm the transaction withPOST /v1/agents/wallets/confirm-deposit(body:tx_hash,expected_amount_atomic) so the balance is credited.
danube-api-key header).
Body
string
required
card_checkout or crypto. Any other value returns a 400.integer
Amount to charge, in cents. Required for
card_checkout; minimum 100 ($1.00). Ignored for crypto.Response
Every field is present for both methods. Fields that do not apply to the chosen method arenull.
string
USDC wallet id
string
The method used:
card_checkout or cryptostring | null
Stripe Checkout URL to open in a browser.
card_checkout only.string | null
The platform’s USDC deposit address.
crypto only.string | null
Chain id of the deposit network.
eip155:8453 is Base. crypto only.string | null
The USDC token contract on that network.
crypto only.string
The wallet balance before this funding, in USDC with six decimals
Errors
| Code | Meaning |
|---|---|
| 400 | amount_cents missing or below 100 for card_checkout, or an unknown method |
| 401 | Missing or invalid API key |
| 503 | Card payments are not configured, or the platform wallet for crypto deposits is not configured |
Example
curl -X POST "https://api.danubeai.com/v1/agents/wallets/fund" \
-H "danube-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "card_checkout", "amount_cents": 2000}'
from danube import DanubeClient
with DanubeClient(api_key="YOUR_API_KEY") as client:
result = client.agents.fund_wallet(method="card_checkout", amount_cents=2000)
print(f"Open in a browser: {result.checkout_url}")
deposit = client.agents.fund_wallet(method="crypto")
print(f"Send USDC on {deposit.network} to {deposit.deposit_address}")
import { DanubeClient } from 'danube';
const client = new DanubeClient({ apiKey: 'YOUR_API_KEY' });
const result = await client.agents.fundWallet({ method: 'card_checkout', amountCents: 2000 });
console.log(`Open in a browser: ${result.checkoutUrl}`);
const deposit = await client.agents.fundWallet({ method: 'crypto' });
console.log(`Send USDC on ${deposit.network} to ${deposit.depositAddress}`);
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "card_checkout",
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_…",
"deposit_address": null,
"network": null,
"usdc_contract": null,
"balance_usdc": "0.000000"
}
{
"wallet_id": "9d3e5b1a-0c2f-4a6b-8e7d-1f2a3b4c5d6e",
"method": "crypto",
"checkout_url": null,
"deposit_address": "0x1234…abcd",
"network": "eip155:8453",
"usdc_contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"balance_usdc": "0.000000"
}
MCP Tool
This endpoint is also available as thefund_agent_wallet MCP tool:
result = await mcp.call_tool("fund_agent_wallet", {"method": "card_checkout", "amount_cents": 2000})
