!
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 AgentPay Interoperability Summary: Public guide for the current TDM agent-facing payment flow. Agents should understand POST /authorize, optional Session Gas Tank spending, seller-credit settlement, and MCP-assisted operator recovery without inventing broader product contracts. Status: Public AgentPay interoperability guidance Topics: - authorize contract - Session Gas Tank - MCP session-state checks - operator recovery guidance - protocol-first agent integrations Packages: - tdm-sdk - bundled-mcp-runtime - tdm-agentpay Commands: - tdm connect - tdm fuel - tdm sweep - tdm sweep status - tdm workspace use - tdm_get_session_state
Public guidance for agent builders integrating with the current TDM payment contract at https://tdm.todealmarket.com.
POST https://tdm.todealmarket.com/authorize
Content-Type: application/json
X-TDM-Session-Token: tdm_session_... # optional
X-TDM-Public-Key: AGENT_PUBLIC_KEY # optional alternative
X-TDM-Signature: ED25519_SIGNATURE # optional alternative
{
"requestId": "req_123",
"resourceId": "premium:api",
"operation": "premium:api",
"tokenOrUuid": "agent-or-user-id",
"priceMinor": 5
}{
"success": true,
"data": {
"allowed": false,
"reason": "insufficient_balance",
"balanceMinor": 0,
"priceMinor": 5,
"billingMode": "session_gas_tank",
"settlementMode": "platform",
"paymentOptions": [],
"retryEndpoint": "https://tdm.todealmarket.com/api/v1/authorize",
"resourceKey": "premium-api",
"operation": "premium:api",
"bridge": {
"checkoutUrl": "https://todealmarket.com/checkout/premium-api",
"buyUrl": "https://tdm.todealmarket.com/api/v1/bridge/buy/premium-api",
"checkoutSessionUrl": "https://tdm.todealmarket.com/api/v1/bridge/purchase",
"checkoutStatusUrlTemplate": "https://tdm.todealmarket.com/api/v1/checkout-status/{paymentId}",
"publicResourceUrl": "https://tdm.todealmarket.com/api/v1/public/payable-resources/premium-api",
"x402ListingUrl": "https://tdm.todealmarket.com/api/v1/bridge/x402/resources/premium-api",
"mppServiceUrl": "https://tdm.todealmarket.com/api/v1/bridge/mpp/services/premium-api",
"mppLlmsUrl": "https://tdm.todealmarket.com/api/v1/bridge/mpp/llms.txt"
}
}
}Agents should check local runtime state before asking humans for money or recovery steps.
const session = await client.callTool({
name: 'tdm_get_session_state',
arguments: {},
})
if (session.state === 'UNINITIALIZED') {
// Ask the operator to run: tdm connect
}
if (session.state === 'DEPLETED' && session.dust_tokens_detected) {
// Suggest: tdm sweep
}
if (session.state === 'DEPLETED' && !session.dust_tokens_detected) {
// Suggest: tdm fuel
}
if (session.state === 'FUELED') {
// Continue normal paid execution
}Session Gas Tank is not mandatory for every integration. It is an optional mode for the agents you want to pre-fund in advance.
1. Merchant registers a payable resource with billing_mode=session_gas_tank
2. Root owner pre-funds the tank once
3. Agent gets a delegated short-lived session token
4. Every paid request goes through POST /authorize
5. Gateway debits the tank and credits the sellertdm connect
tdm vault create photos --use
tdm fuel --amount 5 --yes
tdm fuel --amount 5 --session-id sess_123 --yes
tdm sweep --network solana --resume-burner --deposit-address <solana_address>
tdm sweep --network solana --resume-burner --target-agent vault1
tdm sweep --network base --project-id <walletconnect_project_id> --treasury <base_address>
tdm sweep status