API Quickstart

Get from zero to live monitoring in under 10 minutes.

Base URL: https://watch.0agent.ai All authenticated requests require the X-API-Key: owk_... header.


Step 1 — Create an account

curl -X POST https://watch.0agent.ai/api/auth/signup \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "you@example.com",
    "password": "YourPassword123"
  }'
const res = await fetch('https://watch.0agent.ai/api/auth/signup', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: 'you@example.com', password: 'YourPassword123' }),
});
const { apiKey } = await res.json();
import requests

r = requests.post('https://watch.0agent.ai/api/auth/signup', json={
    'email': 'you@example.com',
    'password': 'YourPassword123',
})
api_key = r.json()['apiKey']

Response:

{
  "accountId": "acct_abc123",
  "apiKey": "owk_...",
  "subscription": { "tier": "free", "status": "active" },
  "firstWalletAdded": false
}

Save the apiKey. It goes on every subsequent request as X-API-Key.


Step 2 — Add a wallet

export API_KEY="owk_..."

curl -X POST https://watch.0agent.ai/api/wallets \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{"address": "0xYourWalletAddress", "label": "treasury"}'
const API_KEY = 'owk_...';

await fetch('https://watch.0agent.ai/api/wallets', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': API_KEY,
  },
  body: JSON.stringify({ address: '0xYourWalletAddress', label: 'treasury' }),
});
API_KEY = 'owk_...'

requests.post('https://watch.0agent.ai/api/wallets',
  headers={'X-API-Key': API_KEY},
  json={'address': '0xYourWalletAddress', 'label': 'treasury'},
)

The indexer starts tracking the wallet immediately after creation.


Step 3 — Query transactions

curl -H "X-API-Key: $API_KEY" \
  "https://watch.0agent.ai/api/wallets/0xYourWalletAddress/transactions?limit=10"
const res = await fetch(
  'https://watch.0agent.ai/api/wallets/0xYourWalletAddress/transactions?limit=10',
  { headers: { 'X-API-Key': API_KEY } }
);
const { transactions } = await res.json();
r = requests.get(
    'https://watch.0agent.ai/api/wallets/0xYourWalletAddress/transactions',
    headers={'X-API-Key': API_KEY},
    params={'limit': 10},
)
transactions = r.json()['transactions']
{
  "address": "0xyourwalletaddress",
  "count": 3,
  "transactions": [
    {
      "hash": "0xabc...",
      "blockNumber": 27480000,
      "timestamp": 1741500000,
      "fromAddress": "0xyourwalletaddress",
      "toAddress": "0x...",
      "valueWei": "100000000000000000",
      "txType": "eth_transfer",
      "gasUsed": 21000,
      "status": 1,
      "chainId": 8453
    }
  ]
}

valueWei is a string. Parse large values with BigInt() in JavaScript or Python's native int.

Transaction types: eth_transfer, erc20_transfer, erc20_approval, uniswap_swap, unknown.


Step 4 — Query anomalies

Anomalies are flagged automatically. Pull them per wallet:

curl -H "X-API-Key: $API_KEY" \
  "https://watch.0agent.ai/api/wallets/0xYourWalletAddress/alerts?limit=20"
const res = await fetch(
  'https://watch.0agent.ai/api/wallets/0xYourWalletAddress/alerts',
  { headers: { 'X-API-Key': API_KEY } }
);
const { alerts } = await res.json();
r = requests.get(
    'https://watch.0agent.ai/api/wallets/0xYourWalletAddress/alerts',
    headers={'X-API-Key': API_KEY},
)
alerts = r.json()['alerts']
{
  "address": "0xyourwalletaddress",
  "count": 1,
  "alerts": [
    {
      "walletAddress": "0xyourwalletaddress",
      "txHash": "0xabc...",
      "anomalyType": "large_transfer",
      "severity": "high",
      "details": {
        "valueWei": "50000000000000000000",
        "threshold": "10000000000000000000"
      },
      "detectedAt": 1741550000000
    }
  ]
}

Anomaly types: large_transfer, high_velocity, failed_tx. Severities: low, medium, high, critical.


Step 5 — Configure alert rules

Alert rules give you fine-grained control: define conditions, combine them with AND/OR, and route notifications to webhooks or email.

Create a webhook target first

curl -X POST https://watch.0agent.ai/api/webhooks \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "url": "https://your-endpoint.example.com/hook",
    "wallet_address": "0xYourWalletAddress",
    "threshold_eth": 0.1
  }'

Note the returned id — you'll reference it as webhookId in alert rules.

Create an alert rule

curl -X POST https://watch.0agent.ai/api/alert-rules \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "name": "Large outbound transfers",
    "wallet_addresses": ["0xYourWalletAddress"],
    "conditions": {
      "operator": "AND",
      "conditions": [
        {
          "type": "value_threshold",
          "comparator": "above",
          "valueEth": 1.0
        }
      ]
    },
    "notification_channels": [
      { "type": "webhook", "webhookId": 1 },
      { "type": "email", "email": "you@example.com" }
    ]
  }'

Condition types

value_threshold — fire when the transaction value crosses a threshold:

{ "type": "value_threshold", "comparator": "above", "valueEth": 5.0 }
{ "type": "value_threshold", "comparator": "below", "valueEth": 0.001 }

erc20_transfer — fire on transfers of a specific token:

{ "type": "erc20_transfer", "tokenAddress": "0xTokenContractAddress" }

contract_interaction — fire when the wallet calls a specific contract:

{
  "type": "contract_interaction",
  "targetAddress": "0xContractAddress",
  "functionSelector": "0xa9059cbb"
}

Both targetAddress and functionSelector are optional. Omit both to match any contract interaction.

Combine conditions

Use nested condition groups to express complex logic:

{
  "operator": "OR",
  "conditions": [
    {
      "operator": "AND",
      "conditions": [
        { "type": "value_threshold", "comparator": "above", "valueEth": 10.0 },
        { "type": "erc20_transfer", "tokenAddress": "0xUsdc..." }
      ]
    },
    {
      "type": "value_threshold",
      "comparator": "above",
      "valueEth": 50.0
    }
  ]
}

This fires when: (value > 10 ETH AND it's a USDC transfer) OR (value > 50 ETH).

Manage rules

# List all rules
curl -H "X-API-Key: $API_KEY" https://watch.0agent.ai/api/alert-rules

# Get a specific rule
curl -H "X-API-Key: $API_KEY" https://watch.0agent.ai/api/alert-rules/1

# Update (enable/disable or change conditions)
curl -X PATCH https://watch.0agent.ai/api/alert-rules/1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{"enabled": false}'

# Delete
curl -X DELETE -H "X-API-Key: $API_KEY" https://watch.0agent.ai/api/alert-rules/1

Test a rule

Dry-run a rule against a real transaction before going live:

curl -X POST https://watch.0agent.ai/api/alert-rules/1/test \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "tx_hash": "0xYourTransactionHash",
    "wallet_address": "0xYourWalletAddress"
  }'

Rate limits

Tier API calls/day Wallets History
Free 100 3 7 days
Developer ($49/mo) 10,000 10 90 days
Team ($199/mo) 50,000 50 1 year
Enterprise 250,000 Unlimited Unlimited

Every authenticated response includes:


Next steps