# Per-product revenue routing — different endpoints can settle to different
# wallets via `subscription.recipient`. The operator-level recipient acts as
# the default; any endpoint can override.
#
# The overrides are commented out below so this spec validates cleanly with
# `pay --sandbox server start` (the example recipients need to exist on the
# target network). Uncomment and substitute real recipient addresses for
# production.
#
# Run locally:
#   pay --sandbox server start per-product-routing.yml

name: per-product-routing
subdomain: per-product-routing
title: 'Per-Product Revenue Routing'
description: 'Different subscription products can settle to different wallets.'
category: data
version: v1

routing:
  type: respond
  # type: proxy
  # url: https://api.example.com/

operator:
  currencies:
    usd: ['USDC']
  network: localnet
  fee_payer: true
  # Operator-level default. When omitted, the operator signer's own
  # pubkey is used. Set this for production.
  # recipient: '<your-default-revenue-wallet>'

endpoints:
  # Data product revenue — override the operator default with a
  # dedicated wallet by uncommenting `recipient:` below.
  - method: GET
    path: 'api/v1/data/{stream}'
    resource: 'data-stream'
    description: 'Data streams.'
    subscription:
      period: '30d'
      price_usd: 49.00
      currency: USDC
      # recipient: '<dedicated-data-product-wallet>'

  # AI product revenue — uses the operator default.
  - method: GET
    path: 'api/v1/ai/{model}'
    resource: 'ai-model'
    description: 'AI inference.'
    subscription:
      period: '30d'
      price_usd: 99.00
      currency: USDC
