Skip to main content

安裝

需求: Python 3.9+

用戶端初始化

Python SDK 為非同步優先。所有方法都回傳協程,應使用 await。

代理

aw.agents.create()

建立具有 MPC 安全錢包的新代理。

aw.agents.get(agent_id)

aw.agents.list()

aw.agents.freeze(agent_id) / aw.agents.unfreeze(agent_id)

付款

aw.payments.send()

發送直接鏈上付款。

aw.payments.get(transaction_id)

aw.payments.list()

x402 微型支付

aw.x402.create_session()

aw.x402.check()

aw.x402.pay()

aw.x402.session_pay(session_id, target_url)

aw.x402.http_interceptor()

建立自動處理 x402 v2 挑戰的攔截器:

策略

aw.policies.update()

aw.policies.get(agent_id)

aw.policies.apply_template()

Webhooks

aw.webhooks.create()

錯誤處理

型別提示

Python SDK 包含完整的型別提示以支援 IDE 和靜態分析:

搭配 asyncio 使用

SDK 為非同步優先。在非同步上下文中使用它: