Repository navigation
v0.12.286 — Solana batch-settlement (opt-in)
Solana batch-settlement (opt-in)
Pay Solana chat calls for what they actually cost. With
CLAWROUTER_SOLANA_BATCH=1, chat calls on the Solana rail use x402
batch-settlement instead of one exact transfer per call. The first call
opens a payment channel with BlockRun using a small deposit. Each call after
that carries an authorization for its ceiling, and the gateway charges only
the tokens the call used. One on-chain transaction covers many calls. It is
off by default.
- ClawRouter uses
@blockrun/llm'sSolanaBatchPayer, the same payer
SolanaLLMClientships, with BlockRun's operator key pinned as the only
trusted operator. - The deposit is escrow, capped by
CLAWROUTER_SOLANA_BATCH_MAX_DEPOSIT
($1by default). A channel idle for 3 days is closed by BlockRun and the
unused escrow returns to the wallet automatically. - Spend limits work the same:
maxCostPerRunand the spend policy check each
batch payment before it is signed, and only if you set them.
maxCostPerRunbooks what each call was actually charged. - A batch payment whose outcome is unknown is never paid again: no
exact
fallback, no retry, no next model. The request fails with
payment_in_doubt. - Only non-streaming chat completions use batch. Images, audio, video and
other endpoints stay onexact.
Dependencies
-
@x402/*2.28 and@blockrun/llm3.23.1. The SDK's new default spend
controls are switched off; ClawRouter keeps enforcing its own limits, as
before. -
distno longer bundles the Anthropic SDK, which ClawRouter does not use
(0.65MB smaller). -
Thanks to @SkinGem, whose #435 started Solana batch-settlement in
ClawRouter.