API Documentation

Integrate ClawBank into your autonomous agents. Give your bots the ability to check balances, spend credits, and transfer funds programmatically.

Authentication

All API requests require an active API key. You can generate API keys for each of your bots in the Human Dashboard. Pass the API key in the Authorization header as a Bearer token.

http
Authorization: Bearer cb_live_xxxxxxxxxxxxxxxxxxxx

OpenClaw Prebuilt Skills

If you are building your agent on the OpenClaw framework, you don't need to write API requests from scratch. We publish official, production-ready skills directly to ClawHub. Just install the skills and your bot instantly knows how to interact with its bank account.

bash
clawhub install @clawbank/skills

clawbank-balance

Bot checks its own balance on a schedule or on demand and reports it to the owner via Telegram or WhatsApp.

clawbank-spend

Bot calls the spend endpoint whenever it needs to pay for something. Includes built-in error handling for insufficient funds.

clawbank-send

Bot sends credits to another bot by BotID. Essential for bot-to-bot task payments and multi-agent delegation.

clawbank-alert

Bot monitors its own balance and autonomously messages the owner when it drops below a configured threshold.

clawbank-history

Bot pulls its last N transactions, summarizes the spending patterns using an LLM, and presents a clean financial report to the owner.

Endpoints

1. Get Bot Balance

Retrieve the current available ClawCredits (CC) for the authenticated bot.

GEThttps://api.clawbank.com/v1/balance

Request

bash
curl -X GET https://api.clawbank.com/v1/balance \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

json
{
  "bot_id": "bot_9x2k1",
  "balance": 1500,
  "currency": "CC",
  "status": "active"
}

2. Spend Credits

Deduct credits from the bot's wallet for a service or API call.

POSThttps://api.clawbank.com/v1/spend

Request

bash
curl -X POST https://api.clawbank.com/v1/spend \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "description": "OpenAI GPT-4 API Call"
  }'

Response

json
{
  "success": true,
  "transaction_id": "tx_882910a",
  "amount_spent": 50,
  "remaining_balance": 1450
}

3. Transfer Credits

Send ClawCredits to another bot on the network.

POSThttps://api.clawbank.com/v1/transfer

Request

bash
curl -X POST https://api.clawbank.com/v1/transfer \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient_bot_id": "bot_3m9v4",
    "amount": 200,
    "description": "Payment for data scraping services"
  }'

Response

json
{
  "success": true,
  "transaction_id": "tx_99182bc",
  "transferred": 200,
  "recipient": "bot_3m9v4",
  "remaining_balance": 1250
}

Error Codes

CodeStatusDescription
insufficient_funds400The bot does not have enough ClawCredits for this transaction.
limit_exceeded403The transaction exceeds the bot's configured spending limit.
invalid_api_key401The provided API key is invalid or has been revoked.
bot_paused403The bot has been paused by the human administrator.