Agent Gateway lets AI agents request TON blockchain transactions that are approved by a human wallet owner. The agent never holds private keys — it only submits transfer requests that you review and sign via TON Connect.
Connect your wallet on the main page and copy the token.
curl -X POST https://api.tongateway.ai/v1/safe/tx/transfer \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"to": "EQD...destination-address",
"amountNano": "1000000000"
}'
The request appears in your dashboard within seconds. Click Approve to sign with your wallet.
Base URL: https://api.tongateway.ai — Swagger UI
All /v1/safe/* endpoints require Authorization: Bearer TOKEN header.
Exchange wallet address for a JWT token.
// Request
{ "address": "0:2dfd5e74cd9cd05b..." }
// Response
{ "token": "eyJhbG...", "address": "0:2dfd5e74cd9cd05b..." }
Verify token and get wallet address.
// Response
{ "address": "0:2dfd5e74cd9cd05b..." }
Request a TON transfer. The request is queued for wallet owner approval.
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Destination TON address |
amountNano | string | Yes | Amount in nanoTON (1 TON = 1000000000) |
payloadBoc | string | No | BOC-encoded payload |
// Response
{
"id": "0ad28efd-d44a-4ac8-9104-1c3f0b7bfc7a",
"status": "pending",
"to": "0:2dfd5e...",
"amountNano": "1000000000",
"expiresAt": 1773329201052
}
List all pending transfer requests for your session.
// Response
{ "requests": [ { "id": "...", "to": "...", "amountNano": "...", "status": "pending", ... } ] }
Get a specific request by ID.
Confirm a pending request after wallet signs. Body: { "txHash": "..." } (optional).
Reject a pending request.
The easiest way to connect an AI agent is via the MCP server. It exposes Agent Gateway tools directly — no HTTP knowledge needed.
git clone https://github.com/niccolocase/agent-api.git
cd agent-api/mcp
npm install
Add to your .claude/settings.json or project settings:
{
"mcpServers": {
"agent-gateway": {
"command": "npx",
"args": ["tsx", "/path/to/agent-api/mcp/src/index.ts"],
"env": {
"AGENT_GATEWAY_TOKEN": "YOUR_TOKEN_HERE",
"AGENT_GATEWAY_API_URL": "https://api.tongateway.ai"
}
}
}
}
| Tool | Description |
|---|---|
request_transfer | Request a TON transfer (to, amountNano, payloadBoc?) |
get_request_status | Check status of a transfer request by ID |
list_pending_requests | List all pending requests |
You: Send 0.5 TON to EQD...abc
Claude: I'll request that transfer for you.
[calls request_transfer with to="EQD...abc", amountNano="500000000"]
Transfer request created (ID: abc-123).
Please approve it in your Agent Gateway dashboard.
import requests
API = "https://api.tongateway.ai"
TOKEN = "your-token-here"
headers = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
# Request a transfer
resp = requests.post(f"{API}/v1/safe/tx/transfer", headers=headers, json={
"to": "0:destination-address",
"amountNano": "1000000000" # 1 TON
})
print(resp.json()) # {"id": "...", "status": "pending", ...}
# Check status
req_id = resp.json()["id"]
status = requests.get(f"{API}/v1/safe/tx/{req_id}", headers=headers)
print(status.json()["status"]) # "pending" | "confirmed" | "rejected"
const API = "https://api.tongateway.ai";
const TOKEN = "your-token-here";
const res = await fetch(`${API}/v1/safe/tx/transfer`, {
method: "POST",
headers: { "Authorization": `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify({ to: "0:destination", amountNano: "1000000000" }),
});
const { id, status } = await res.json();
console.log(id, status); // "abc-123" "pending"