x402-payguard / tree / wrangler.toml ยท raw (this view has old GitHub links rewritten for the mirror; raw is byte-exact)
name = "payguard"
main = "src/worker.js"
compatibility_date = "2026-05-01"
compatibility_flags = ["nodejs_compat"]

[vars]
X402_NETWORK = "eip155:8453"
X402_PRICE_ADDRESS = "$0.001"
X402_PRICE_BATCH = "$0.01"
PAY_TO = "0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6F"
FACILITATOR_URL = "https://facilitator.payai.network"
# x402 v2 facilitator: "payai" (FACILITATOR_URL above) or "cdp" (Coinbase CDP; needs the CDP_API_KEY_ID and
# CDP_API_KEY_SECRET secrets, falls back to PayAI with a warning if either is missing). Runbook: /workspace/crypto/distribution/cdp-switch.md
FACILITATOR = "cdp"
# Solana devnet test route /solana-devnet/v1/address (x402 v2, solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1, devnet USDC,
# public x402.org facilitator). Receiver key: /home/box/crypto-vault/solana-devnet-receiver.json. See src/solana-devnet.js.
SOLANA_DEVNET_PAY_TO = "DmeY2NNcgbgSd2S7HTipepnCnFsfF6bhmBEms3ctknkq"
SOLANA_DEVNET_FACILITATOR_URL = "https://x402.org/facilitator"
SOLANA_DEVNET_FEE_PAYER = "CKPKJWNdJEqa81x7CkZ14BVPiY6y16Sxs7owznqtWYp5"
# Stellar testnet test route /stellar-testnet/v1/address (x402 v2, stellar:testnet, 0.01 XLM via the native SAC,
# x402.org facilitator, fees sponsored). Receiver key: /home/box/crypto-vault/stellar-testnet-receiver.txt. See src/stellar-testnet.js.
STELLAR_TESTNET_PAY_TO = "GD2I22CZ7K6BJR2JLN54LDM7TSXFSMTDWYFPJECWXZOHK3TFM6PEX44I"
STELLAR_TESTNET_FACILITATOR_URL = "https://x402.org/facilitator"
PUBLIC_URL = "https://payguard.agentgate.workers.dev"
# Reverse proxy (youraitools-api Pages project): public URLs become https://<PROXY_HOSTS><PROXY_PREFIX> only for these hosts
PROXY_HOSTS = "api.youraitools.co"
PROXY_PREFIX = "/payguard"
# x402-trust.com provider verification (public key line; private key in the vault, x402-trust-key.pem)
X402_TRUST_TXT = "x402-trust-verification=v1:MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEE3BRokZRE_5VQY8-uCv5Cc6P-FFPNo8kBOO0nSCcw0OL84uR2LpQRaY_3bp2GVU8ph_8cLr9on8kMbbBUyivsA"

# Legacy usage counters: READ-ONLY since 2026-10-22 (history up to that UTC day). No KV writes any more..
[[kv_namespaces]]
binding = "STATS"
id = "5e71d434050845dbbdc9a85689c430c3"

# Free tier: 10 previews / MCP calls per IP per minute
# Usage counters (batched, flushed <= once/min/isolate) in a SQLite Durable Object (free plan, no KV quota)
[[durable_objects.bindings]]
name = "COUNTER"
class_name = "StatsCounter"

[[migrations]]
tag = "v1-stats-counter"
new_sqlite_classes = ["StatsCounter"]

[[ratelimits]]
name = "FREE_LIMITER"
namespace_id = "1005"
simple = { limit = 10, period = 60 }

agentgate-source: code mirror on Cloudflare Pages. All repos