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
| Parameter | Type | Description |
|---|---|---|
id | string | Service 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
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | Missing wallet_id |
| 404 | NOT_FOUND | Service not found, not active, or wallet doesn't belong to you |
| 409 | ALREADY_SUBSCRIBED | Active subscription already exists |