name = "stackdetect"
main = "src/worker.js"
compatibility_date = "2026-05-01"
compatibility_flags = ["nodejs_compat"]
[vars]
X402_NETWORK = "eip155:8453"
X402_PRICE = "$0.003"
PAY_TO = "0x3c1A1E01e790Cd326495631B3b38Bd7068F08d6F"
# Solana mainnet payout wallet (public address; USDC token account CM3JgZELvWZMRuxuCT6kNXYPtgCNgGrzQCJs57YbxpAT). Networks are toggled in src/networks.js
SOLANA_PAY_TO = "FH73WbbUe2UyNzfy72MJs5nT3NxyDf9GrqE7kzjL2Jte"
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"
PUBLIC_URL = "https://stackdetect.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 = "/stackdetect"
# Workers subrequests get server: cloudflare / cf-ray on every origin: ignore those, detect Cloudflare by IP range
CF_EDGE_HEADERS = "1"
# 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"
# Usage counters (batched, flushed <= once/min/isolate) in a SQLite Durable Object (free plan, no KV quota). No KV binding at all.
[[durable_objects.bindings]]
name = "COUNTER"
class_name = "StatsCounter"
[[migrations]]
tag = "v1-stats-counter"
new_sqlite_classes = ["StatsCounter"]
# Free tier: 10 previews / MCP calls per IP per minute
[[ratelimits]]
name = "FREE_LIMITER"
namespace_id = "1007"
simple = { limit = 10, period = 60 }
# Prepaid credits (Worker "credits", RPC entrypoint CreditsGate): Authorization: Bearer yatc_... debits the route price
[[services]]
binding = "CREDITS"
service = "credits"
entrypoint = "CreditsGate"
agentgate-source: code mirror on Cloudflare Pages. All repos