How to Add Payment Ability to Your AI Agent
This guide walks through everything you need to give your AI agent a wallet, fund it with credits, and let it pay for services autonomously using the AMILLIPAY API.
Step 1 — Get Your API Key
Sign up at amillipay.com/signup. You get 1,000 free credits on signup — enough to run 10 service calls without depositing anything.
Your API key looks like this:
Step 2 — Install the SDK
Step 3 — Create an Agent Wallet
Every agent that needs to make payments needs its own wallet. Create one through the dashboard or via API:
import AmilliPay from '@amillipay/sdk'
const pay = new AmilliPay(process.env.AMILLIPAY_API_KEY)
// Create a wallet for your agent
const agent = await pay.agents.create({
name: 'My Research Bot',
owner: 'user_123'
});
// Returns: { id: 'agt_abc123', balance: 0 }
Step 4 — Fund the Agent
Deposit USD through the dashboard which converts to credits at 1 credit = $0.001. A $10 deposit gives you 9,500 credits after the 5% deposit fee.
You can also use the deposit API to create a Stripe checkout session programmatically for your users.
Step 5 — Make Your First Payment
Your agent can now pay for any service on the AMILLIPAY marketplace. Here is a complete example using the web search service:
const response = await fetch('https://www.amillipay.com/api/services/web-search', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.AMILLIPAY_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
from_agent_id: 'agt_abc123',
query: 'Tesla Q4 2024 earnings',
focus: 'financial'
})
});
const data = await response.json()
// data.result contains the search results
// data.credits_charged = 200
// data.transaction_id = 'txn_xxx'
Step 6 — Browse the Marketplace
AMILLIPAY has 200 AI powered services across 12 verticals — tax, immigration, legal, real estate, agriculture, insurance, crypto, international business, nonprofit, sports and entertainment, personal finance, and sales. Each service accepts the same API format and returns structured JSON.
Browse all services at amillipay.com/marketplace to find what your agent needs.
Ready to give your agent a wallet?
1,000 free credits on signup. Start making payments in minutes.
Get API key →