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 Protocol Specs Summary: Public protocol guide for TDM. This page documents the SDK and CLI surface, the MCP session-state helper, AgentPay interoperability guidance, and the published HTTP API. Status: Public protocol documentation Topics: - TDM protocol documentation - SDK and CLI surface - MCP session-state runtime - agent payment interoperability Packages: - tdm-sdk - bundled-mcp-runtime - tdm-agentpay Commands: - tdm login - tdm fuel - tdm sweep - tdm stats - tdm_get_session_state
This page documents only the public TDM contract. It focuses on installable packages, published commands, and documented HTTP requests.
The main SDK package. It includes the SDK APIs and the built-in tdm CLI.
A narrow MCP helper for agent runtimes that exposes tdm_get_session_state.
Public interoperability guidance for agent builders integrating with authorize outcomes and payment recovery flows.
Public discovery and buy-entry adapters that expose TDM-paid resources to external protocol ecosystems without replacing the TDM checkout and authorize flow.
TDM does not need a separate formal spec to be useful today. The current public contract is already stable enough for protocol-first integrations: one authorize request, one machine-readable 402 shape, one checkout path, and one retry path back into authorize or delivery.
1. Client calls a protected route or POST /authorize
2. If payment is required, TDM returns HTTP 402 with payment and bridge metadata
3. Client uses checkoutUrl, buyUrl, or direct payment options
4. Client retries through retryEndpoint
5. Success returns authorizationId, optional accessToken, and optional deliveryUrl{
"success": true,
"data": {
"allowed": false,
"reason": "insufficient_balance",
"resourceKey": "premium-api",
"operation": "premium:api",
"priceMinor": 5,
"billingMode": "account",
"settlementMode": "platform",
"retryEndpoint": "https://tdm.todealmarket.com/api/v1/authorize",
"paymentOptions": [],
"bridge": {
"checkoutUrl": "https://todealmarket.com/checkout/premium-api",
"publicResourceUrl": "https://tdm.todealmarket.com/api/v1/public/payable-resources/premium-api"
}
}
}The tdm CLI is included in tdm-sdk. In public docs it is usually clearer to describe them together, then call out CLI-only commands when needed.
tdm login
tdm fuel --amount 5 --yes
tdm make payable ./report.pdf --price 0.05
tdm sweep --network solana --resume-burner --deposit-address <solana_address>
tdm cashout --to <address>
tdm statsTDM can publish the same payable resource into external discovery surfaces without moving settlement out of TDM. The bridge layer is for visibility and buy-entry routing, while checkout, authorize, and unlock stay canonical inside TDM. In practice that means resources can be discovered outside TDM, bought through lightweight entry paths, and then used more deeply inside TDM-native runtimes.
GET /api/v1/bridge/x402/resources
GET /api/v1/bridge/x402/resources/:resourceId
GET /api/v1/bridge/mpp/services
GET /api/v1/bridge/mpp/services/:resourceId
GET /api/v1/bridge/mpp/llms.txt
GET /api/v1/bridge/buy/:resourceId
POST /api/v1/bridge/purchase