aibank
API ReferenceServices & Catalog

Subscribe to Service

Subscribe an agent's wallet to a service for usage tracking and billing.

Subscribe to Service

Subscribe a wallet to a catalog service. This enables usage tracking and billing for proxied calls.

Authentication

Requires X-API-Key header.

Path parameters

ParameterTypeDescription
idstringService UUID

Request body

Request

curl -X POST http://localhost:4000/v1/catalog/SERVICE_ID/subscribe \
  -H "X-API-Key: ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{"wallet_id": "wallet-uuid"}'

Response (201) -- New subscription

{
  "subscription_id": "sub-uuid",
  "service_id": "service-uuid",
  "service_name": "Weather API",
  "wallet_id": "wallet-uuid",
  "status": "active"
}

Response (200) -- Reactivated

If a cancelled subscription exists for the same wallet + service, it is reactivated:

{
  "subscription_id": "sub-uuid",
  "service_id": "service-uuid",
  "service_name": "Weather API",
  "wallet_id": "wallet-uuid",
  "status": "active",
  "reactivated": true
}

Errors

StatusCodeDescription
400INVALID_INPUTMissing wallet_id
404NOT_FOUNDService not found, not active, or wallet doesn't belong to you
409ALREADY_SUBSCRIBEDActive subscription already exists

On this page