> 13-Stage Request Pipeline
Every tool call passes through — no shortcuts, no bypass
1AUTHValidate API key, resolve agent_id
2IDEMPOTENCYDeduplicate by idempotency key
3CONTENT_NEGAccept/Content-Type negotiation
4SCHEMA_VALIDATIONZod validation — reject malformed input
5TOOL_STATUSCheck tool exists & healthy
6CACHERedis lookup — return if cached (TTL per tool)
7RATE_LIMITDual-bucket per agent per tool
8ESCROWVerify x402/MPP payment — 402 if unpaid
9PROVIDER_CALLCall upstream API (Amadeus, CoinGecko, DHL...)
10ESCROW_FINALIZECharge on success, refund on failure
11LEDGER_WRITEAppend-only financial record (PG transaction)
12CACHE_SETStore response in Redis
13RESPONSEReturn normalized JSON to agent
~120ms
avg pipeline latency
Fail-Closed
any error = reject, never pass through
Atomic
escrow + ledger in one PG transaction