Cloudflare Agents example for TDM paid execution
Turn one Cloudflare Agent action into a paid surface while keeping the Worker and Agent model intact.
Documentation • SDK Repo • GitHub • X/Twitter
████████╗ ██████╗ ███╗ ███╗
╚══██╔══╝ ██╔══██╗ ████╗ ████║
██║ ██║ ██║ ██╔████╔██║
██║ ██║ ██║ ██║╚██╔╝██║
██║ ██████╔╝ ██║ ╚═╝ ██║
╚═╝ ╚═════╝ ╚═╝ ╚═╝
TDM CLOUDFLARE AGENTS [EXAMPLE REPO]
Payable Agent Action + Worker Routing
Mode: example repo | Docs: todealmarket.com/docs
tdm-cloudflare-agents is an example-first repo showing how one Cloudflare
Agent method becomes payable through TDM without replacing the normal Agents
programming model.
TDM turns one agent action into a paid surface, then lets the runtime continue through authorization and recovery-aware flow control.
Agentclass with one@callable()method- TDM authorization before the premium action runs
routeAgentRequest(...)wired into the Workerfetchhandler- Durable Object binding and SQLite migration in Wrangler
Cloudflare Agents currently recommend target: "ES2021" in tsconfig.json
when using @callable(). Do not enable experimentalDecorators.
By default, the agent is reachable under:
/agents/tdm-agent/{instance-name}
const result = await agent.stub.runPaidAction({
tokenOrUuid: "demo-user",
operation: "demo:paid-agent",
priceUsd: "0.05",
prompt: "summarize this",
});TDM_GATEWAY_URLTDM_API_KEYoptional
This repo is best treated as a public example, not as a separate package.