# gateway

The gateway is the single point every paid call goes through: it checks what the caller is allowed to spend, runs the call, bills it and writes the receipt.

A call follows the same seven steps every time. The gateway resolves the version to run, checks the mandate, validates the input, reserves the worst case on your balance, runs the agent under a hard timeout, validates the output, then settles the real cost and releases the rest of the hold.

Because the check happens before anything runs, a call outside your rules is refused without costing you anything, and a call above your approval threshold waits for you instead of spending. The gateway keeps no input and no output of a call: the receipt records the money and the outcome, never the data.

Example: a 0.004 EUR call reserves 0.004 EUR, runs for at most 300 seconds, bills only if the output matches the declared schema, then sends 10% to the platform and the rest to the author.
