Install Agent Gateway skills to give your AI agent the ability to request TON transfers. Choose the integration method that fits your setup.
Model Context Protocol integration
Exposes Agent Gateway tools directly to your AI agent via MCP. The agent can request transfers, check statuses, and list pending requests — no HTTP knowledge needed.
git clone https://github.com/niccolocase/agent-api.git
cd agent-api/mcp && npm install
Add to .claude/settings.json or your MCP client config:
{
"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"
}
}
}
}
Replace /path/to/agent-api with the actual path and paste your token.
| Tool | Params | Description |
|---|---|---|
request_transfer |
to, amountNano, payloadBoc? |
Queue a TON transfer for owner approval |
get_request_status |
id |
Check if a request was approved, rejected, or pending |
list_pending_requests |
— | List all pending transfer requests |
| TON | nanoTON |
|---|---|
| 0.1 | 100000000 |
| 0.5 | 500000000 |
| 1 | 1000000000 |
| 10 | 10000000000 |
Once configured, your agent can request transfers in natural language:
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.
You: Is it confirmed?
Claude: [calls get_request_status with id="abc-123"]
Yes, the transfer was confirmed and signed by the wallet.
Skill file for Claude Code / OpenClaw
A skill file that teaches Claude Code how to use Agent Gateway. Drop it into your project and Claude will know the full API, tools, and best practices.
mkdir -p .claude/skills
curl -o .claude/skills/agent-gateway.md \
https://raw.githubusercontent.com/niccolocase/agent-api/main/skills/agent-gateway.md
Claude Code will automatically detect the skill. Ask it to /agent-gateway or just say "send TON" and it will know what to do.
Full content of agent-gateway.md:
---
name: agent-gateway
description: Install and use Agent Gateway — lets your AI agent
request TON blockchain transfers that are approved by a human
wallet owner via TON Connect
---
# Agent Gateway Skill
Agent Gateway lets you request TON transfers from a human's wallet.
You submit transfer requests, the wallet owner approves them.
## Setup
1. Get a token from https://tongateway.ai
2. Configure MCP server (see MCP Server skill above)
## Tools
| Tool | Description |
|------------------------|------------------------------------|
| request_transfer | Queue a TON transfer for approval |
| get_request_status | Check request status by ID |
| list_pending_requests | List all pending requests |
## Usage
request_transfer({ to: "EQD...addr", amountNano: "1000000000" })
→ 1 TON = 1,000,000,000 nanoTON
## Direct HTTP (fallback)
POST https://api.tongateway.ai/v1/safe/tx/transfer
Authorization: Bearer TOKEN
{ "to": "0:dest...", "amountNano": "1000000000" }
## Important
- You cannot sign transactions, only request them
- Token = session, guard it like a password
- Requests expire in 5 minutes
- Token expires in 24 hours
Direct HTTP for any language or agent
Use the REST API directly when MCP is not available. Works with any language, framework, or custom agent that can make HTTP requests.
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": "EQD...destination-address",
"amountNano": "1000000000" # 1 TON
}
)
req = resp.json()
print(f"Request {req['id']}: {req['status']}")
# Check status
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 headers = {
"Authorization": `Bearer ${TOKEN}`,
"Content-Type": "application/json"
};
// Request a transfer
const res = await fetch(`${API}/v1/safe/tx/transfer`, {
method: "POST",
headers,
body: JSON.stringify({
to: "EQD...destination-address",
amountNano: "1000000000" // 1 TON
}),
});
const { id, status } = await res.json();
console.log(id, status); // "abc-123" "pending"
// Check status
const check = await fetch(
`${API}/v1/safe/tx/${id}`, { headers }
);
console.log((await check.json()).status);
# Set your token
export TOKEN="your-token-here"
export API="https://api.tongateway.ai"
# Request a transfer (1 TON)
curl -X POST $API/v1/safe/tx/transfer \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "EQD...destination-address",
"amountNano": "1000000000"
}'
# Check status
curl $API/v1/safe/tx/REQUEST_ID \
-H "Authorization: Bearer $TOKEN"
# List all pending
curl $API/v1/safe/tx/pending \
-H "Authorization: Bearer $TOKEN"
All /v1/safe/* endpoints require Authorization: Bearer TOKEN. Full Swagger docs
| Method | Endpoint | Description |
|---|---|---|
POST | /v1/safe/tx/transfer | Request a TON transfer |
GET | /v1/safe/tx/pending | List pending requests |
GET | /v1/safe/tx/:id | Get request by ID |
POST | /v1/safe/tx/:id/confirm | Confirm (after wallet signs) |
POST | /v1/safe/tx/:id/reject | Reject a request |