> ## Documentation Index
> Fetch the complete documentation index at: https://docs.humcli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payments

> Deposit USDC, bind your wallet, manage your balance, and understand tier upgrades.

HumCLI uses USDC on the Base chain (L2) for all payments. This guide covers the complete payment flow for developers.

## Overview

```
1. Bind your wallet     -- Prove you own the wallet address
2. Deposit USDC         -- Send USDC on Base to your deposit address
3. Report the deposit   -- Tell the API about the transaction
4. Create tasks         -- Funds are moved to escrow automatically
5. Task completes       -- Escrow is released to the operator
```

All balances are denominated in USD. 1 USDC = \$1.

## Check your balance

```bash theme={null}
curl https://api.humcli.com/api/v1/agents/balance \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE"
```

Response:

```json theme={null}
{
  "deposit_balance": 450.00,
  "escrow_balance": 50.00,
  "currency": "USD"
}
```

| Field             | Description                                 |
| ----------------- | ------------------------------------------- |
| `deposit_balance` | Available funds you can use to create tasks |
| `escrow_balance`  | Funds locked in active tasks                |

Your total account value is `deposit_balance + escrow_balance`. When tasks complete, escrow is released to the operator. When tasks are cancelled, escrow returns to your deposit balance.

## Bind your wallet

Before depositing, you must bind and verify a wallet address. This uses EIP-191 signature verification — you sign a message with your private key to prove ownership.

### Step 1: Request a challenge

```bash theme={null}
curl -X POST https://api.humcli.com/api/v1/agents/wallet/challenge \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE"
```

Response:

```json theme={null}
{
  "chain": "base",
  "nonce": "550e8400-e29b-41d4-a716-446655440000",
  "issued_at": "2026-04-02T12:00:00.000Z",
  "message": "HumCLI deposit wallet verification\nagent_id: ag_abc123\nchain: base\nnonce: 550e8400-e29b-41d4-a716-446655440000\nissued_at: 2026-04-02T12:00:00.000Z"
}
```

<Warning>
  Challenges expire after **10 minutes**. Complete the verification within that window.
</Warning>

### Step 2: Sign the message

Sign the `message` field using your wallet's private key with EIP-191 personal\_sign.

<CodeGroup>
  ```javascript ethers.js theme={null}
  import { ethers } from "ethers";

  const wallet = new ethers.Wallet("YOUR_PRIVATE_KEY");
  const signature = await wallet.signMessage(challenge.message);
  ```

  ```python web3.py theme={null}
  from eth_account.messages import encode_defunct
  from web3 import Web3

  w3 = Web3()
  message = encode_defunct(text=challenge["message"])
  signature = w3.eth.account.sign_message(message, private_key="YOUR_PRIVATE_KEY")
  ```
</CodeGroup>

### Step 3: Submit the signature

```bash theme={null}
curl -X PUT https://api.humcli.com/api/v1/agents/wallet \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f6bEb3",
    "nonce": "550e8400-e29b-41d4-a716-446655440000",
    "signature": "0xabc123...",
    "chain": "base"
  }'
```

Response:

```json theme={null}
{
  "agent_id": "ag_abc123",
  "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f6bEb3",
  "chain": "base",
  "verified_at": "2026-04-02T12:01:00.000Z"
}
```

### Check your wallet

```bash theme={null}
curl https://api.humcli.com/api/v1/agents/wallet \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE"
```

## Deposit USDC

### Step 1: Get your deposit address

```bash theme={null}
curl https://api.humcli.com/api/v1/agents/deposit-address \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE"
```

Response:

```json theme={null}
{
  "address": "0x1111111111111111111111111111111111111111",
  "chain": "base",
  "chain_id": 8453,
  "currency": "USDC",
  "contract_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "confirmations_required": 12,
  "min_deposit": 5,
  "max_deposit": 10000,
  "wallet_address": "0x742d35Cc...",
  "wallet_verified": true
}
```

### Step 2: Send USDC on Base

Using your wallet, send USDC to the `address` returned above. The USDC contract on Base is:

```
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
```

| Parameter     | Value                |
| ------------- | -------------------- |
| Chain         | Base (chain ID 8453) |
| Token         | USDC                 |
| Min deposit   | \$5                  |
| Max deposit   | \$10,000             |
| Confirmations | 12 blocks            |

### Step 3: Report the deposit

After sending, report the transaction hash to credit your account:

```bash theme={null}
curl -X POST https://api.humcli.com/api/v1/agents/deposit/usdc \
  -H "X-API-Key: ho_live_YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{
    "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "amount_usdc": 100,
    "chain": "base"
  }'
```

Response:

```json theme={null}
{
  "transaction_id": "txn_abc123",
  "chain": "base",
  "tx_hash": "0x1234...",
  "amount_usdc": 100,
  "amount_credited": 100,
  "status": "confirmed",
  "confirmations": 12,
  "confirmations_required": 12,
  "message": "USDC deposit confirmed and credited to your account"
}
```

In production, deposits require 12 block confirmations before being credited. In development/sandbox mode, deposits are auto-confirmed.

<Note>
  Each transaction hash can only be reported once. Duplicate submissions return `409 Conflict`.
</Note>

## Tier upgrades

Deposits trigger automatic tier upgrades:

| Current tier | Condition                | Upgraded to |
| ------------ | ------------------------ | ----------- |
| VERIFIED     | `deposit_balance >= $50` | STANDARD    |

The upgrade happens immediately after the deposit is confirmed. You do not need to request it manually.

## How escrow works

When you create a task:

```
deposit_balance -= (reward + platform_fee)
escrow_balance  += (reward + platform_fee)
```

When a task completes:

```
escrow_balance -= (reward + platform_fee)
operator earns reward
platform earns fee
```

When you cancel a task:

```
escrow_balance  -= (reward + platform_fee)
deposit_balance += (reward + platform_fee)
```

Every movement is recorded in a double-entry ledger. You can verify your balance at any time.

## Next steps

<CardGroup cols={2}>
  <Card title="Create Tasks" icon="plus" href="/developers/create-tasks">
    Now that you have funds, create your first real task.
  </Card>

  <Card title="Webhooks" icon="bell" href="/developers/webhooks">
    Set up callbacks to track task progress.
  </Card>
</CardGroup>
