Agent API
Wallet and account
Check how much a key can still spend, read the balance ledger, and see which account a key belongs to.
Authentication
All endpoints on this page require Authorization: Bearer pk-…. Amounts are in USD. Top up in the console; there is no top-up API.
Get balance
GET/v1/wallet/balance
bash
curl https://gw.pikeway.ai/v1/wallet/balance -H "Authorization: Bearer $PIKEWAY_API_KEY"
200 OK
{
"balance": { "value": 12.4831, "currency": "USD" },
"earnings": { "value": 0, "currency": "USD" },
"keyBudget": { "limit": 5, "used": 1.25, "remaining": 3.75, "currency": "USD" },
"spendable": { "value": 3.75, "currency": "USD" }
}Fields
balancemoneyThe account's prepaid balance.
earningsmoneyProvider earnings (separate from the spending balance).
keyBudgetobjectOnly when this key has a spend limit: limit, used, remaining.
spendablemoneyWhat this key can spend now: the balance, capped by the key's remaining budget.
List activities
GET/v1/wallet/activities
Entries of the balance ledger, newest first: top-ups, call charges, subscriptions, refunds and other balance changes.
Query
limitintegerPage size. Default 20, max 100.
cursorstringcursor from the previous page.
bash
curl "https://gw.pikeway.ai/v1/wallet/activities?limit=50" -H "Authorization: Bearer $PIKEWAY_API_KEY"
200 OK
{
"items": [
{
"id": "6a1f0c52-8d3e-4b7a-9f21-0e4c5d6b7a89",
"type": "CONSUMPTION",
"amount": { "value": -0.001, "currency": "USD" },
"balanceAfter": 12.4831,
"description": "call Birdeye",
"createdAt": "2026-10-24T09:12:03Z",
"runId": "0192f6b0-5e2a-7d40-b1c3-8f9e2a4d6c11"
},
{
"id": "3c9b1e7d-2f4a-4c8e-b5d6-7a8f9e0d1c2b",
"type": "TOPUP",
"amount": { "value": 10, "currency": "USD" },
"balanceAfter": 12.4841,
"description": "Top-up",
"createdAt": "2026-10-23T18:40:11Z"
}
],
"cursor": null
}Fields
typestringE.g. TOPUP, CONSUMPTION, SUBSCRIPTION, REFUND, BONUS, ADJUST.
amountmoneyPositive for credits, negative for debits.
balanceAfternumberBalance right after this entry.
runIdstringThe call this entry belongs to, when there is one (use with /v1/runs/{runId}).
Who am I
GET/v1/auth/whoami
Verifies a key and returns its account. Handy as a health check for a configured key (the CLI's setup command uses it).
bash
curl https://gw.pikeway.ai/v1/auth/whoami -H "Authorization: Bearer $PIKEWAY_API_KEY"
200 OK
{
"userId": "cm2x8k1qz0000abcd1234efgh",
"email": "[email protected]",
"walletAddress": null,
"twitterHandle": null,
"key": {
"id": "cm2x9p4rt0001abcd5678ijkl",
"name": "agent",
"preview": "pk-AbCd****xYz9",
"budget": { "limit": 5, "used": 1.25, "currency": "USD" }
}
}email, walletAddress and twitterHandle are null when not set on the account. key.budget appears only when the key has a spend limit.
Errors
401missing API key (Authorization: Bearer pk-...)·invalid or revoked API key403key IP / origin restriction404not found(unknown path under/v1/wallet/) ·account not found405use GET