// 5-step curl walkthrough — proven end-to-end agent payment flow
Five curl calls: provision, fund, reserve, commit, verify. No SDK. No setup beyond a terminal.
https://agentkit-2.polsia.app
No auth needed. Give your agent an ID, a spending cap, an initial balance, and an allowed-provider list. Save the returned api_key — it is shown once.
curl -X POST https://agentkit-2.polsia.app/api/wallets \n
-H "Content-Type: application/json" \n
-d '{
"agent_id": "my-agent-001",
"spending_limit_cents": 50000,
"initial_balance_cents": 10000,
"allowed_providers": ["openai"]
}'
{
"wallet": {
"id": 12,
"agent_id": "my-agent-001",
"spending_limit_cents": 50000,
"current_balance_cents": 10000,
"reserved_balance_cents": 0,
"policies": [{ "provider": "openai" }]
},
"api_key": "ak_live_xxxxxxxx",
"warning": "Store api_key — it is shown once and cannot be retrieved"
}
Add cents to the wallet you just created. Use your new api_key (stored as API_KEY in the shell from here on). Substitute the real wallet.id from step 01 for :id.
curl -X POST https://agentkit-2.polsia.app/api/wallets/:id/credit \n
-H "Content-Type: application/json" \n
-H "X-API-Key: ak_live_xxxxxxxx" \n
-d '{ "amount_cents": 5000 }'
{
"wallet": {
"id": 12,
"agent_id": "my-agent-001",
"spending_limit_cents": 50000,
"current_balance_cents": 15000,
"reserved_balance_cents": 0,
"policies": [{ "provider": "openai" }]
}
}
Pre-authorize a charge by moving amount_cents from available into reserved. The reservation has a TTL — if you don't commit it in time, the hold releases automatically. The idempotency_key keeps a retry from creating a second reservation.
curl -X POST https://agentkit-2.polsia.app/api/v1/wallets/my-agent-001/reservations \n
-H "Content-Type: application/json" \n
-H "X-API-Key: ak_live_xxxxxxxx" \n
-d '{
"amount_cents": 2000,
"currency": "USD",
"ttl_seconds": 300,
"memo": "pre-auth openai",
"idempotency_key": "rsv-quickstart-01"
}'
{
"reservation_id": 1,
"status": "active",
"replay": false,
"amount_cents": 2000,
"currency": "USD",
"memo": "pre-auth openai",
"idempotency_key": "rsv-quickstart-01",
"expires_at": "2026-08-10T12:05:00.000Z",
"balance": {
"available": 13000,
"reserved": 2000,
"currency": "USD",
"as_of": "2026-08-10T12:00:00.000Z"
}
}
Finalize the hold. The reserved amount is deducted from your real balance and a ledger row with provider="reservation_commit" is written. The reservation_id in the URL is idempotent — replaying commit returns the same transaction.
curl -X POST https://agentkit-2.polsia.app/api/v1/wallets/my-agent-001/reservations/1/commit \n
-H "X-API-Key: ak_live_xxxxxxxx"
{
"reservation_id": 1,
"status": "committed",
"replay": false,
"transaction_id": 101,
"balance": {
"available": 13000,
"reserved": 0,
"currency": "USD",
"as_of": "2026-08-10T12:00:05.000Z"
}
}
Filter the ledger by provider=reservation_commit. The row written in step 04 appears with idempotency_key="reservation:<id>" — the same key is a replay deduper so audit trails stay clean.
curl "https://agentkit-2.polsia.app/api/transactions?provider=reservation_commit" \n
-H "X-API-Key: ak_live_xxxxxxxx"
{
"transactions": [
{
"id": 101,
"wallet_id": 12,
"provider": "reservation_commit",
"amount_cents": 2000,
"status": "approved",
"idempotency_key": "reservation:1"
}
],
"limit": 50,
"offset": 0
}
Need to verify incoming webhooks? See the HMAC signature & retry guide →