x402 documentation
Overview
The deposit.now API enables AI agents to trigger deposits autonomously using the x402 payment protocol. Each API call requires a micropayment of 0.01 USDC on Base Sepolia testnet.
Base URL
https://deposit.now
Price per call
0.01 USDC
Network
Base Sepolia
Authentication
The API uses x402 payment protocol for authentication. No API keys or accounts required. The payment itself serves as both authentication and authorization.
x402 Requirements:
- Payment amount: 10000 atomic units (0.01 USDC)
- Currency: USDC
- Network: base-sepolia
- Facilitator: https://x402.org/facilitator
Endpoints
POST
/api/depositTrigger a deposit for an AI agent account. Requires x402 payment.
Request Body
{
"amount": "100.00",
"account": "agent-wallet-123"
}Success Response (200)
{
"status": "success",
"depositAmount": "100.00",
"account": "agent-wallet-123",
"message": "Deposit of 100.00 triggered for agent account: agent-wallet-123",
"timestamp": "2025-12-30T12:00:00.000Z",
"network": "base-sepolia",
"paymentReceived": true,
"transactionId": "txn_1735563600000_abc123xyz"
}Payment Required Response (402)
HTTP/1.1 402 Payment Required
Accept-Payment: x402 1.0 amount=10000 currency=USDC network=base-sepolia
{
"error": "Payment Required",
"message": "This endpoint requires x402 payment",
"price": "0.01 USDC",
"network": "Base Sepolia"
}GET
/api/depositGet deposit information. Also protected by x402 payment.
Code Examples
Install the x402 client
npm install @x402/fetchMake a payment-protected request
import { fetch402 } from '@x402/fetch';
const response = await fetch402('https://deposit.now/api/deposit', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: '100.00',
account: 'agent-wallet-123'
})
});
const result = await response.json();
console.log('Deposit status:', result.status);
console.log('Transaction ID:', result.transactionId);Error Handling
402 Payment Required
No payment provided or payment invalid. Check the Accept-Payment header for payment requirements.
400 Bad Request
Invalid request body or parameters.
500 Internal Server Error
Server error processing the request. Retry with exponential backoff.