Payment proofs and cost

Developer flow

  1. Initialize the SDK with a supported wallet
  2. Make a request
  3. The SDK completes the 402 payment flow
  4. You receive the API response (and cost/proof fields where applicable)

You do not need to construct proofs manually when using GalliunClient.

Inference

Successful chat responses may include:

response.payment; // InferencePaymentProof
response.cost; // CostBreakdown

Inference payment proof (selected fields)

Field Description
scheme "exact"
chain / network Payment rail
asset / amount Typically USDC
payer / payTo Addresses
txHash On-chain transaction
requestHash / nonce Binding fields

Cost breakdown

Field Description
inference Base charge
vision Image surcharge when applicable
managedConversation Conversation fee when applicable
toolCalls Tool surcharge when applicable
total Total charged

Each line is { amount, asset }.

Marketplace

Marketplace proofs use scheme "exact_split" and txHashOrDigest. The SDK attaches them as X-PAYMENT on retry. Successful marketplace.call returns the upstream JSON body rather than wrapping a receipt object.

402 accepts[] entries include totalAmount and splits (provider + platform).