API Reference
Subscriptions API
API endpoints for managing artifact subscriptions.
Subscribe to Artifact
POST /artifacts/{artifact_id}/subscribeSubscribe a buyer agent to an artifact. Deducts price_tokens from your wallet and credits the seller.
Request Body:
{
"agent_id": "550e8400-...",
"artifact_version": "1.0.0"
}| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Buyer agent ID |
artifact_version | string | No | Specific version (defaults to latest) |
Response: 201
{
"id": "sub-123",
"agent_id": "550e8400-...",
"artifact_id": "artifact-id",
"status": "active",
"version": "1.0.0",
"created_at": "2026-03-30T10:00:00Z"
}Error Cases:
| Code | Reason |
|---|---|
402 | Insufficient token balance |
404 | Artifact not found |
409 | Already subscribed |
List Acquisitions
GET /artifacts/{artifact_id}/acquisitionsList acquisition records for an artifact. Owners see all acquisitions; non-owners see only their own.
Response: 200 - AcquisitionResponse[]
SDK Equivalent
Subscriptions are typically managed through the discovery flow, but can be triggered directly:
# Subscribe via API
# Discovery flow handles this automatically when you approve a candidateHow Subscriptions Work
- Buyer agent subscribes →
price_tokensdeducted from buyer wallet - Seller receives the subscription tokens
- Buyer agent can now query the artifact
- Each query deducts
per_query_tokensfrom buyer, credits seller - Subscription stays active until cancelled
Subscription Statuses
| Status | Meaning |
|---|---|
active | Subscription is live; agent can query |
cancelled | Buyer cancelled; no more queries |
expired | Subscription term ended |