Skip to main content

Overview

The activity endpoints provide visibility into your account’s API usage and x402 payment transactions. Use these to monitor costs, debug payment flows, and track API key usage.

List Transactions

Retrieve recent x402 payment transactions.
curl https://api.actumx.app/v1/transactions \
  -H "Cookie: your_session_cookie"
This endpoint requires session authentication (dashboard login).

Response

transactions
array
List of x402 transaction objects (up to 100 most recent)
{
  "transactions": [
    {
      "id": "x402tx_abc123",
      "status": "completed",
      "method": "GET",
      "endpoint": "/v1/protected/quote",
      "amountCents": 25,
      "receiptId": "receipt_xyz789",
      "consumedAt": "2024-03-01T10:05:30Z",
      "createdAt": "2024-03-01T10:05:00Z",
      "updatedAt": "2024-03-01T10:05:30Z",
      "apiKeyId": "key_def456",
      "apiKeyName": "Production API Key",
      "apiKeyPrefix": "actumx_live_x"
    },
    {
      "id": "x402tx_def456",
      "status": "pending",
      "method": "GET",
      "endpoint": "/v1/protected/quote",
      "amountCents": 25,
      "receiptId": null,
      "consumedAt": null,
      "createdAt": "2024-03-01T10:00:00Z",
      "updatedAt": "2024-03-01T10:00:00Z",
      "apiKeyId": "key_def456",
      "apiKeyName": "Production API Key",
      "apiKeyPrefix": "actumx_live_x"
    }
  ]
}

Transaction Lifecycle

  1. pending - Transaction created when endpoint returns 402
  2. settled - User called /v1/x402/settle and payment was deducted
  3. completed - User retried request with payment proof and received data

Get Usage Events

Retrieve detailed usage events showing API consumption and costs.
curl https://api.actumx.app/v1/usage \
  -H "Cookie: your_session_cookie"
This endpoint requires session authentication (dashboard login).

Response

events
array
List of usage event objects (up to 100 most recent)
{
  "events": [
    {
      "id": "usage_abc123",
      "userId": "user_xyz789",
      "apiKeyId": "key_def456",
      "endpoint": "/v1/protected/quote",
      "method": "GET",
      "units": 1,
      "costCents": 25,
      "x402TransactionId": "x402tx_ghi789",
      "createdAt": "2024-03-01T10:05:30Z"
    },
    {
      "id": "usage_def456",
      "userId": "user_xyz789",
      "apiKeyId": "key_def456",
      "endpoint": "/v1/protected/quote",
      "method": "GET",
      "units": 1,
      "costCents": 25,
      "x402TransactionId": "x402tx_jkl012",
      "createdAt": "2024-03-01T09:45:15Z"
    }
  ]
}

Usage vs Transactions

Understand the difference between these two endpoints:

Transactions Endpoint

Shows the x402 payment lifecycle:
  • All payment requests (even unpaid ones)
  • Payment status (pending → settled → completed)
  • Which API key initiated each transaction
  • Whether payment was consumed
Use for: Debugging payment flows, tracking abandoned payments, monitoring API key activity

Usage Endpoint

Shows actual consumption and billing:
  • Only completed/consumed requests
  • Exact costs per request
  • Usage patterns and history
Use for: Billing analysis, cost tracking, usage reporting
Usage events are only created when a transaction reaches the completed status (after payment and consumption).

Common Use Cases

Track Spending by API Key

  1. Call /v1/usage to get all usage events
  2. Group by apiKeyId and sum costCents
  3. Join with API key names from /v1/api-keys

Monitor Abandoned Payments

  1. Call /v1/transactions to get all transactions
  2. Filter for status: "pending" older than 10 minutes
  3. These represent initiated but unpaid requests

Debug Payment Issues

  1. Call /v1/transactions with relevant apiKeyId
  2. Check transaction status and timestamps
  3. Verify receiptId matches what client sent
  4. Check if transaction was consumed (consumedAt)

Error Codes

StatusErrorDescription
401unauthorizedNot logged in or session expired

Next Steps