REST API

Programmatic access
to every capability.

Every CLI command maps to a REST endpoint. Authenticate with API keys, manage agents, cards, IBANs, credit, and payments programmatically. Available on the Pro plan.


Authentication

API key authentication.

Bearer Token

Login via the CLI, then use aipay auth token to get your bearer token. Include it in the Authorization header for all API requests.

$ aipay auth
$ aipay auth token
eyJhbG...
Per-Agent Scoping

Optionally scope API calls to a specific agent by including the agent ID in the header. This ensures agent-level isolation and audit trail attribution.

X-Agent-Id: agent_procurement_bot

Endpoints

Nine resource groups.

Base URL: https://api.aipay.sh/v1

/agents
POSTGET

Register agents, list agents, retrieve agent details and credentials.

/cards
POSTGETDELETE

Issue virtual cards, retrieve PAN/CVV, freeze, cancel, and list transactions.

/ibans
POSTGET

Provision virtual IBANs, check balances, transfer funds between accounts.

/credit
POSTGET

View credit line status, allocate credit to agents, check repayment schedule.

/policies
POSTGETDELETE

Create spending policies, list active rules, remove policies by ID.

/invoices
POSTGET

List pending invoices, trigger payment, track settlement status.

/crypto
POSTGET

Get exchange rates, fund cards from USDC/USDT, retrieve deposit addresses.

/audit
GET

Query audit log with filters for agent, type, date range. Export as CSV or JSON.

/auth
POSTGET

Send magic links, verify tokens, check session status, and validate API keys.


Example

Create a card
in one request.

POST to /v1/cards with amount, currency, and agent ID. Get back a full card object with PAN, CVV, and expiry.

curl
$ curl -X POST \
  https://api.aipay.sh/v1/cards \
  -H "Authorization: Bearer eyJhbG..." \
  -d '{"amount":200,"currency":"eur","agent":"procurement-bot"}'
 
// Response
{ "id": "card_eur_3kf9a",
  "last4": "8391",
  "balance": 200.00,
  "currency": "eur",
  "status": "active" }

Rate Limits & Versioning

Built for scale.

Rate limit
1,000 req/min

Per API key. Burst up to 100 concurrent requests. Higher limits available on Enterprise.

API version
v1 (stable)

Versioned via URL path. Breaking changes ship in new versions. Old versions supported for 12 months.

Pagination
Cursor-based

All list endpoints support cursor pagination. Default page size: 50. Max: 200.


Start building with the API.

Full REST API access included with the Pro plan.

Read the docs