{"openapi":"3.1.0","info":{"title":"onegate","version":"0.1.0","description":"One-time authorisation and proof for irreversible agent actions. Three paid endpoints, one origin. Failures are never charged.","x-guidance":"Call GET /v1/flow/{token} REPEATEDLY for the same token: the value is the delta since your last call, and the server remembers your anchor. First call returns a snapshot. Call POST /v1/gate/send or /v1/gate/swap immediately BEFORE signing an action you cannot undo; you get a single-use lease (TTL 5 min) and a signed receipt that any third party can verify for free at GET /v1/verify?id=. A DENY decision, any 4xx/5xx, and all status checks are NEVER charged — every response carries a literal \"charged\" field. Send idempotency_key on gate calls to avoid paying twice. amount/amount_in/min_out are STRINGS in smallest units (1000000 = 1 USDC at 6dp).","contact":{"email":"ops@onegate.biz.id"}},"servers":[{"url":"https://onegate.biz.id"}],"paths":{"/v1/flow/{token}":{"get":{"operationId":"get_v1_flow__token_","summary":"Feed perubahan wallet untuk satu token — delta sejak panggilan terakhir Anda.","description":"Bukan snapshot. Server menyimpan anchor per payer, jadi panggilan berikutnya hanya mengembalikan perubahan sejak anchor itu. Pindah vendor = kehilangan continuity.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}},{"name":"window","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1440,"default":60}}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"ok":true,"charged":true,"first_call":true,"flow":{"netflow_usd":-12840.55,"buys":214,"sells":189,"unique_buyers":71},"anchor":{"block":52886632}}}}},"402":{"description":"Pembayaran diperlukan (x402 challenge ada di header)"},"503":{"description":"Sumber data tidak tersedia — tidak ditagih"}}}},"/v1/gate/send":{"post":{"operationId":"post_v1_gate_send","summary":"Izin sekali pakai untuk transfer (native / ERC-20 / NFT), plus receipt bertanda tangan.","description":"Mengembalikan lease ber-TTL 5 menit dan anti-duplikat lewat action_hash. Aksi identik kedua dari wallet yang sama dijawab DENY / duplicate_action tanpa biaya.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"CAIP-2"},"asset":{"type":"string","description":"native | 0x…"},"to":{"type":"string","description":"0x…"},"amount":{"type":"string","description":"string integer"},"token_id":{"type":"string","description":"opsional, untuk NFT"},"nonce":{"type":"string","description":"opsional"},"idempotency_key":{"type":"string","description":"opsional"}},"required":["chain","asset","to","amount"]},"example":{"chain":"eip155:8453","asset":"native","to":"0x000000000000000000000000000000000000dEaD","amount":"1000000000000000"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"ok":true,"charged":true,"decision":"ALLOW","lease":{"id":"ls_…","single_use":true,"expires_at":"2026-10-21T06:00:00.000Z"}}}}},"402":{"description":"Pembayaran diperlukan (x402 challenge ada di header)"},"503":{"description":"Sumber data tidak tersedia — tidak ditagih"}}}},"/v1/gate/swap":{"post":{"operationId":"post_v1_gate_swap","summary":"Izin untuk swap dengan validasi parameter, lease, dan receipt.","description":"Menerbitkan lease sekali pakai untuk swap. Simulasi mendalam (debug_traceCall) belum dijalankan pada versi ini dan respons menyatakannya terbuka (level: not_run).","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.030000"},"protocols":[{"x402":{}}]},"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"CAIP-2"},"token_in":{"type":"string","description":"0x…"},"token_out":{"type":"string","description":"0x…"},"amount_in":{"type":"string","description":"string integer"},"min_out":{"type":"string","description":"opsional"},"deadline":{"type":"string","description":"opsional, unix detik"},"router":{"type":"string","description":"opsional"}},"required":["chain","token_in","token_out","amount_in"]},"example":{"chain":"eip155:8453","token_in":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","token_out":"0x4200000000000000000000000000000000000006","amount_in":"1000000"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"ok":true,"charged":true,"decision":"ALLOW","simulation":{"will_revert":null,"level":"not_run"}}}}},"402":{"description":"Pembayaran diperlukan (x402 challenge ada di header)"},"503":{"description":"Sumber data tidak tersedia — tidak ditagih"}}}},"/v1/verify":{"get":{"operationId":"get_v1_verify","summary":"Verifikasi receipt/lease tanpa membayar.","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/v1/lease/{id}":{"get":{"operationId":"get_v1_lease__id_","summary":"Status lease (active/consumed/expired).","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/v1/gate/redeem":{"post":{"operationId":"post_v1_gate_redeem","summary":"Tandai lease terpakai. Gratis.","security":[],"parameters":[],"responses":{"200":{"description":"OK"}}}},"/v1/health":{"get":{"operationId":"get_v1_health","summary":"Liveness.","security":[],"parameters":[],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"X-PAYMENT","description":"x402 payment proof"}}}}