DIM · Dagon Inference Marketplace

Errors from sellers, the SDK and the program

A 402 from a seller means it refused your hold before serving anything; the JSON body names the reason. A 429 means the route is at capacity right now. Policy errors come from your own side: no route matches your model and policy, or your Mandate forbids the request. None of these is billed: any non-2xx answer, and any connection failure before a status line, is unbillable.

402: hold refused

The body is {"error": {"code": "…", "message": "…"}}. Only insufficient_channel_funds is worth retrying, and only after a voucher acknowledgment or a top-up frees budget.

Code What it means What to do
malformed_hold Missing, malformed or misbound hold, or the wrong channel epoch. A client bug; check the headers and encoding.
bad_signature The hold is not signed by the channel's session key. Check you are signing with this channel's session key and domain.
unknown_channel The seller does not see this channel (yet). Wait for the open to confirm, or check the cluster.
channel_closed The channel is closing, finalized or past its service end. Open or top up a channel.
wrong_seller The channel's settler or payout does not match this seller. Open the channel with the route's settler and payout_token.
route_mismatch This seller does not list the route. Refresh routes.
schedule_mismatch The hold's price schedule is not the seller's effective one. Refresh routes; the seller changed prices.
hold_expired dispatch_until passed before the seller saw it. Send a fresh hold; check your clock.
cap_exceeds_limit The cap is above the Mandate's per_request_cap, or above what the channel has left. Lower the cap.
cap_too_low The cap is below the schedule's w_req_micros. Raise the cap.
insufficient_channel_funds The cap does not fit in budget − redeemed − unvouchered − in flight. Flush vouchers, or top up; then retry.
duplicate_request The request_id was already used. Never reuse request IDs.
lane_replay The lane counter did not increase. Never reuse lane counters; give concurrent workers their own lanes.

In the SDK, a 402 surfaces as MarketplaceError with code: "hold_rejected", status: 402 and holdCode set to the code above. For insufficient_channel_funds the SDK first flushes that channel's vouchers and, if the seller acknowledged new receipts, retries automatically.

429: route at capacity

The seller answers 429 with code no_headroom and Retry-After: 1 when the route is full. It costs nothing. The SDK's planner backs off that route for the hinted time and tries another eligible route on the same call. If every attempt is refused, the call fails with MarketplaceError code upstream and status: 429; you can requeue the work.

503: draining or busy

During a rolling deploy, a gateway answers new requests with 503 gateway_draining and Retry-After: 1 before admitting them. The hold is not consumed, so the SDK waits and replays the exact same request without spending an attempt. 503 ingress_busy means the gateway has too many uploads in flight.

Policy and wallet errors

These come from the SDK before anything is sent:

MarketplaceError.code Typical message Cause
no_route "configure an exact model identity for the OpenAI model" The model name is not mapped to a 64-hex identity ID.
no_route "no matching route has dispatch headroom" No installed route matches the identity, zdr, region and cap, or all are full. Refresh routes.
no_route "request cannot override the configured region" A per-call region conflicts with the client's policy.
wallet "Mandate forbids this Hold" The cap is above per_request_cap, or the seller pair is not allowed, or the Mandate is revoked or expired.
wallet "no funded channel or lane for the selected seller" You have no open channel with that seller, or it lacks budget.
wallet "settlement backlog or channel origin mismatch" Too many unpaid receipts on the channel; vouchers are not getting through.
lane_busy "agent lane already has an admission in progress" Two concurrent calls on one lane; use sdk.agent(id) per worker.
aborted "inference was aborted or timed out" Your signal fired, or timeoutMs passed.
invalid_evidence "indexer route list rejected" A discovery answer failed verification: wrong key, wrong query, stale, or malformed.

Receipt and settlement problems use invalid_receipt, missing_receipt and settlement; see verifying receipts and paying with vouchers.

A receipt with status policy_unhonored is another kind of policy outcome: the seller says it could not honor the route's policy, and the charge is 0.

On-chain errors

When opening channels or managing Mandates, the program fails closed with stable codes. The ones you are most likely to meet:

Code Name Usually means
6004 InvalidTime Service end not in the future, or grace or expiry out of bounds.
6007 MandateExpired The Mandate or an ancestor has expired.
6008 MandateRevoked The Mandate or an ancestor was revoked.
6010 NotNarrowed A child Mandate is wider than its parent.
6011 SellerNotAllowed The seller pair is not on the Mandate's list.
6012 MandateBudget The period budget has no room for this channel.
6013 InsufficientFree The vault's free balance is too small.
6024 EpochNotIncreasing Another open won the epoch race; retry with the next epoch (the SDK does this once).
6025 MandateInUse A Mandate still has live channels or children.