Beta Environment Notice
TDM is currently in Beta. Exercise caution when handling assets. Use at your own risk.
Fast Export
Switch the current page to Markdown for fast agent reading, or download it as a .md file.
TDM is currently in Beta. Exercise caution when handling assets. Use at your own risk.
Fast Export
Switch the current page to Markdown for fast agent reading, or download it as a .md file.
# TDM Documentation Summary: Official entry point for the current public TDM stack. This guide covers the SDK, CLI, MCP runtime, checkout, protocol-first integrations, plain-English TDM terms, and copy-paste starter flows for the first working request. Status: Beta - All Features Active Topics: - TDM SDK documentation - tdm-sdk package usage - TDM CLI installation and commands - AgentPay interoperability - x402 payment flows - payment options - MCP session-state checks - AI agent payment infrastructure Packages: - tdm-sdk - bundled-mcp-runtime - tdm-agentpay Commands: - tdm connect - tdm fuel - tdm make payable - tdm sweep - tdm sweep status - tdm cashout - tdm agent - tdm stats
Documentation for the TDM Beta: tdm-sdk with the built-in tdm CLI, the bundled MCP runtime helper, and tdm-agentpay interoperability.
AI + SEO Overview
This documentation is optimized for both human readers and AI systems looking for guidance on the TDM ecosystem. It focuses on public commands, public request contracts, and practical integration behavior.
tdm-sdk (Beta)tdm-agentpaytdm connecttdm fueltdm make payabletdm sweeptdm cashouttdm agenttdm statsOpen Repo + Full Package
The public GitHub repo for tdm-sdk shows the open contract-facing SDK surface. The current npm beta distribution used in this documentation remains broader and includes the CLI and operator flows that power today's onboarding path.
Plain-English Terms
If you are new to TDM, these are the three terms that matter most on the first pass. Learn these once, then jump into the starter that matches your stack.
Paid Request Gate
The request that decides whether a priced action can continue. It is not a generic wallet sign-in flow.
Open HTTP APIMachine-Payment Pattern
A paid HTTP pattern where a client hits a route, gets a payment-required response, then retries with payment context.
Open AgentPayPrepaid Agent Balance
A prepaid balance for one agent or sandbox so repeated microcharges can run without a fresh chain action every time.
Open SettlementIntegration Paths
We now support three clear ways to ship with TDM. Pick the one that matches your runtime, then grow into the others only if you need them.
JS SDK
Use tdm-sdk when you want route wrappers, smart tdm make payable, and the fastest path for Next.js, Hono, Express, and other JS runtimes.
Open SDK Path
Protocol-First
Call POST /authorize directly from Python, Go, Java, Rust, C, or C++ using the public HTTP contract at https://tdm.todealmarket.com.
Open Multi-Language Path
MCP-Assisted
Pair the bundled MCP runtime with AgentPay-aware flows when an AI runtime needs session checks and payment-state guidance around paid tools.
Open Agent Runtime Path
Copy-Paste Starters
These snippets match the current MVP surface in tdm-sdk and the live gateway contract. Pick one, make it green, then add Session Gas Tank, payouts, or recovery only after the first happy path works.
JS SDK
Use the main web-first TDM path when your app already runs in Next.js, Hono, Express, or another JS runtime.
import { chargeFetchHandler, createFetchHookClient } from "tdm-sdk";
const hooks = createFetchHookClient({
baseUrl: process.env.TDM_GATEWAY_URL ?? "https://tdm.todealmarket.com",
});
export const "text-[#ffd166] font-semibold">POST = chargeFetchHandler(
{
operation: "demo:route",
resourceId: "demo:route",
priceUsd: "0.05",
tokenResolver: (request) =>
request.headers.get("x-tdm-token") ?? "demo-user",
hooks,
},
async (_request: Request) => Response.json({ ok: true }),
);Protocol-First
Use the live gateway contract when you are integrating from Python, Go, Java, Rust, C, or C++.
"text-[#ffd166] font-semibold">POST https://tdm.todealmarket.com/authorize
Content-Type: application/json
{
"requestId": "req_demo_1",
"tokenOrUuid": "demo-user",
"operation": "demo:authorize",
"priceUsd": "0.05"
}Buyer Flow
Use the checkout client when buyers should pay in the browser without installing the CLI or shipping your own payment UI first.
import { createCheckoutClient } from "tdm-sdk/checkout";
const checkout = createCheckoutClient({
baseUrl: process.env.TDM_GATEWAY_URL ?? "https://tdm.todealmarket.com",
});
const session = await checkout.createSession({
resourceId: "res_demo_123",
chain: "solana",
});
console.log(session);First Hour
If you want the shortest honest path to a working integration, use this sequence before you add sweep automation, payout recovery, or more advanced runtime setup.
tdm-sdk and decide whether your first path is SDK, protocol-first HTTP, or hosted checkout.TDM_GATEWAY_URL or pass an explicit baseUrl.makePayable(...), tdm-sdk/checkout, or raw POST /authorize.Prepared Surfaces
If you want a direct public entry point instead of reading the whole stack first, use the prepared surface that matches your job. Builders start with the integration kit, agent runtimes go to AgentPay, and note-first creator flows go to Obsidian.
Builders
Copy-paste recipes, thin client guidance, and reference pieces for coding agents and developers who want to add TDM into real projects fast.
Open Prepared Repos
Agent Runtime
The agent-side reading of authorize, pricing, payment options, session fuel, and recovery behavior.
Open AgentPay
Creator Path
The quickest note-first path for payable reading, paid unlock, and premium knowledge artifacts.
Open Obsidian
tdm-sdk provides the core building blocks for paid APIs, content, and agent workflows. It includes SDK helpers and the built-in tdm CLI.
The bundled MCP runtime is the optional helper for runtimes that need session checks before they run paid tools or automated flows.
TDM is currently in Beta. The documented public flows are available across the SDK, built-in CLI, MCP runtime, and AgentPay materials, and we are still refining rollout quality and developer ergonomics.
SDK behavior, checkout, CLI commands, and MCP session-state checks are all active. The public docs focus on what developers can install, call, and use today.
This documentation covers the public TDM SDK, CLI, and API integration paths.
As a Beta, we are shipping updates frequently. Your feedback helps shape the production-ready release of the TDM ecosystem.
The TDM Beta provides a public payment stack for developers. All documented interfaces below are active and ready for integration:
tdm-sdk for production-shaped payment flows, including framework-mode route wrappers and the built-in CLI.tdm CLI for setup, payable registration, top-ups, sweep, stats, and related payment commands.Python, Go, Java, Rust, C, and C++ can integrate through the public HTTP contract at https://tdm.todealmarket.com.tdm_get_session_statetdm make payable