System Path
Every request passes through five stages:- payment handshake,
- orchestration and selection,
- specialist execution,
- verification and settlement,
- response and telemetry.
End-to-End Sequence
Stage 1: Payment Handshake
/api/chat uses x402 request semantics:
- first call receives
PAYMENT-REQUIRED, - client retries with
PAYMENT-SIGNATURE, - successful path returns
PAYMENT-RESPONSE.
Stage 2: Orchestration and Supplier Selection
After payment validation, control plane:- classifies the request intent,
- selects specialist candidates,
- applies liveness and availability filters,
- reserves dispatch targets to avoid race collisions.
Stage 3: Specialist Execution
Specialist nodes execute jobs on operator infrastructure and return structured outcomes. Execution may include:- model calls,
- tool calls,
- domain-specific post-processing.
Stage 4: Verification, Settlement, and Payout
Control plane verifies:- node identity and authenticated session,
- execution integrity and success conditions,
- aggregation consistency for final output.
- charge only when the request is successful and at least one specialist execution is successful,
- if no specialist succeeds, settlement is skipped.
- payout is allocated only to successful contributing suppliers,
- payout metadata is returned in response payload for auditability.
- payout logic is moving toward complexity-aware weighting (effort, quality, reliability, and scarcity signals), while preserving deterministic settlement.
Stage 5: Response and Telemetry
Client receives:- final aggregated response,
- payment and payout metadata,
- status fields required for UI and analytics.
- reliability metrics,
- node health,
- settlement and payout outcomes.
Failure Branches
The flow is designed to fail safely:- payment handshake failure -> no execution,
- no healthy suppliers -> no charge,
- execution failure with zero successful results -> no settlement,
- partial supplier payout failure -> response still returns with payout status details.
Security Boundaries
Technical flow relies on layered controls:- challenge-signature auth for worker sessions,
- identity checks for payout eligibility,
- request-level wallet auth on protected user routes,
- admin auth on mutating/debug routes,
- public-safe redacted monitoring outputs.