Contents

Quick startAuthenticationCreditsCreate agentSend paymentCheck balanceTransactionsDepositWithdrawWebhooksError codes

API Reference

The AMILLIPAY API lets you create agent wallets, send payments between agents, and manage credits. Base URL: https://api.amillipay.com

Quick start

Install the SDK:

npm install @amillipay/sdk

Initialize and make your first payment:

import AmilliPay from '@amillipay/sdk'

const pay = new AmilliPay(process.env.AMILLIPAY_API_KEY)

// Create an agent wallet
const agent = await pay.agents.create({ name: 'My Bot' })

// Fund it ($10 = 10,000 credits)
await pay.deposit({ agent_id: agent.id, amount_usd: 10 })

// Send a payment
await pay.send({
  from: agent.id,
  to: 'agt_search_service_id',
  amount: 10, // credits
  memo: 'Search query'
})

Authentication

All API requests require your API key in the Authorization header:

Authorization: Bearer amp_your_api_key_here

Credits

AMILLIPAY uses a credit system for micro-payments. 1 credit = $0.001 USD.

$1.00  = 1,000 credits
$10.00 = 10,000 credits
$100   = 100,000 credits

Minimum transaction: 1 credit ($0.001)
Transaction fee: 1% (minimum 1 credit)
POST/v1/agents

Create a new agent wallet

Request body

{
  "name": "My Research Bot",
  "owner_id": "user_123",
  "metadata": { "type": "research" }
}

Response

{
  "id": "agt_abc123",
  "name": "My Research Bot",
  "owner_id": "user_123",
  "balance": 0,
  "created_at": "2026-06-08T00:00:00Z"
}
GET/v1/agents/:id

Get agent balance and info

Response

{
  "id": "agt_abc123",
  "name": "My Research Bot",
  "balance": 49990,
  "balance_usd": 49.99,
  "total_sent": 10,
  "total_received": 0
}
POST/v1/pay

Send payment between agents

Request body

{
  "from": "agt_abc123",
  "to": "agt_search_service",
  "amount": 10,
  "memo": "Web search: Tesla Q4"
}

Response

{
  "id": "txn_xyz789",
  "from": "agt_abc123",
  "to": "agt_search_service",
  "amount": 10,
  "fee": 0.1,
  "status": "completed",
  "created_at": "2026-06-08T00:00:00Z"
}
GET/v1/transactions

List transactions for an agent

Response

{
  "transactions": [
    {
      "id": "txn_xyz789",
      "from": "agt_abc123",
      "to": "agt_search_service",
      "amount": 10,
      "memo": "Web search: Tesla Q4",
      "created_at": "2026-06-08T00:00:00Z"
    }
  ],
  "total": 1
}
POST/v1/deposit

Add credits to an agent wallet

Request body

{
  "agent_id": "agt_abc123",
  "amount_usd": 50.00
}

Response

{
  "checkout_url": "https://checkout.stripe.com/...",
  "credits": 50000,
  "amount_usd": 50.00
}
POST/v1/withdraw

Cash out credits to bank

Request body

{
  "agent_id": "agt_abc123",
  "amount": 10000,
  "bank_account": "ba_xxx"
}

Response

{
  "id": "wth_abc123",
  "amount_credits": 10000,
  "amount_usd": 10.00,
  "fee_usd": 0.10,
  "status": "processing"
}

Webhooks

AMILLIPAY sends webhooks when payments are sent or received. Configure your webhook URL in the dashboard.

// Webhook payload
{
  "event": "payment.completed",
  "data": {
    "id": "txn_xyz789",
    "from": "agt_abc123",
    "to": "agt_search_service",
    "amount": 10,
    "memo": "Web search: Tesla Q4",
    "created_at": "2026-06-08T00:00:00Z"
  }
}

Error codes

401unauthorizedInvalid or missing API key
402insufficient_creditsAgent does not have enough credits
404agent_not_foundAgent ID does not exist
422invalid_amountAmount must be a positive integer
429rate_limitedToo many requests — slow down
500internal_errorSomething went wrong on our end