Skip to main content
An inference permit is a model-bound deposit of credits in TulipInferenceEscrow. It limits how much the Gateway can settle for a user’s requests without giving the Gateway arbitrary wallet access.

Permit fields

Each permit records:
  • Owner.
  • Credit token and model ID.
  • Optional pinned provider offer.
  • Remaining credit balance.
  • Expiration time.
  • Close request and closed state.
The escrow verifies that the deposited token is the canonical credit for the selected model.

Request lifecycle

1

Quote

The Gateway tokenizes the prompt, assumes the requested maximum output, checks whether the endpoint must wake, and obtains the maximum charge from the on-chain tariff.
2

Reserve

The Gateway atomically reserves that maximum against the permit in its durable store. Concurrent requests cannot reuse the same available balance.
3

Serve and meter

The selected endpoint serves the request. The Gateway requires actual prompt and completion token usage from the upstream response.
4

Sign receipt

The Gateway releases the unused part of the reservation and signs an EIP-712 receipt containing the exact model, offer, tariff version, token usage, timestamps, and wake state.
5

Settle on-chain

Receipts are submitted to the escrow. The contract recomputes the charge, rejects replayed request IDs, debits the permit, and transfers credits to the recipients.

Close and refund

The owner may top up an open, unexpired permit. To withdraw unused credits, the owner first requests closure. The contract enforces a 30-minute delay before closePermit refunds the remaining balance. The delay gives already issued receipts time to settle. A close request can be cancelled before final closure.

Open or pinned provider selection

  • An open permit has a zero offer ID. The Gateway may select any eligible offer and may perform pre-output failover.
  • A pinned permit names one offer. Settlement rejects receipts from every other offer.
A permit is not an unlimited approval. Credits are transferred into escrow when the permit opens or is topped up. Only the unused escrow balance is refundable.