payloadexchange-operator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PayloadExchange Operator

PayloadExchange 运营操作指南

Workflow

工作流程

  1. Start the Rust API service.
  2. If using sponsored APIs, ensure Postgres is configured (
    DATABASE_URL
    ) and migrations are applied.
  3. Create user profiles with role/tool attributes.
  4. Create sponsor campaigns with target roles, target tools, task gate, and budget.
  5. Record sponsor task completion before allowing proxy-sponsored usage.
  6. Create sponsored APIs via
    POST /sponsored-apis
    .
  7. If
    SPONSORED_API_CREATE_PRICE_CENTS
    > 0, first call
    POST /sponsored-apis
    without payment, read
    PAYMENT-REQUIRED
    , then retry with
    PAYMENT-SIGNATURE
    per x402.
  8. Call sponsored APIs via
    POST /sponsored-apis/:api_id/run
    . Calls are free while
    budget_remaining_cents
    covers the per-call price; once exhausted, server returns
    402
    with
    PAYMENT-REQUIRED
    , then retry with
    PAYMENT-SIGNATURE
    .
  9. Use
    /proxy/:service/run
    for sponsored campaign flows and
    /tool/:service/run
    for direct paid flows.
  10. Log skill usage outcomes to
    /creator/metrics/event
    .
  11. Read
    /campaigns/discovery
    for agent campaign URL sources.
  12. Read
    /creator/metrics
    and
    /metrics
    for operational monitoring.
  1. 启动Rust API服务。
  2. 若使用赞助API,请确保已配置Postgres(
    DATABASE_URL
    )并执行了数据迁移。
  3. 创建带有角色/工具属性的用户档案。
  4. 创建包含目标角色、目标工具、任务门控以及预算的赞助活动。
  5. 在允许代理赞助使用前,记录赞助任务完成情况。
  6. 通过
    POST /sponsored-apis
    创建赞助API。
  7. 如果
    SPONSORED_API_CREATE_PRICE_CENTS
    > 0,首先不带支付参数调用
    POST /sponsored-apis
    ,读取
    PAYMENT-REQUIRED
    响应,然后按照x402规范携带
    PAYMENT-SIGNATURE
    重试请求。
  8. 通过
    POST /sponsored-apis/:api_id/run
    调用赞助API。当
    budget_remaining_cents
    余额足够支付单次调用费用时,调用免费;余额耗尽后,服务端返回携带
    PAYMENT-REQUIRED
    402
    状态码,随后可携带
    PAYMENT-SIGNATURE
    重试。
  9. 赞助活动流程使用
    /proxy/:service/run
    接口,直接付费流程使用
    /tool/:service/run
    接口。
  10. /creator/metrics/event
    接口上报技能使用结果。
  11. 访问
    /campaigns/discovery
    获取Agent活动的URL来源。
  12. 访问
    /creator/metrics
    /metrics
    进行运营监控。

Sponsored API Tracking

赞助API追踪

Each sponsored API call inserts a row into
sponsored_api_calls
with payment mode, amount, and caller metadata for budget reconciliation.
每一次赞助API调用都会在
sponsored_api_calls
表中插入一条记录,包含支付模式、金额以及调用方元数据,用于预算对账。

Metric Event Contract

指标事件协议

Send one telemetry event per key skill action:
  • event_type=created
    when skill definition is created
  • event_type=installed
    when copied into Codex/other environment
  • event_type=invoked
    when skill starts handling a request
  • event_type=completed
    when task succeeds
  • event_type=failed
    when task fails
Required fields:
skill_name
,
platform
,
event_type
,
success
. Optional field:
duration_ms
.
每个关键技能操作都需要发送一个遥测事件:
  • 技能定义创建时发送
    event_type=created
  • 技能被复制到Codex或其他环境时发送
    event_type=installed
  • 技能开始处理请求时发送
    event_type=invoked
  • 任务成功时发送
    event_type=completed
  • 任务失败时发送
    event_type=failed
必填字段:
skill_name
platform
event_type
success
。 可选字段:
duration_ms

x402 Settlement Sync

x402结算同步

Use
/webhooks/x402scan/settlement
to ingest external settlement updates and keep sponsored/direct ledger state consistent with the payment rail monitor.
使用
/webhooks/x402scan/settlement
接口接收外部结算更新,保持赞助/直接交易账本状态与支付链路监控数据一致。