Install
openclaw skills install remote-apiExpose a local API service to the public internet via aitun tunnel for external testing and integration. Perfect for AI agents that build REST APIs, gRPC services, or any HTTP API locally and need to share it for testing.
openclaw skills install remote-apiUse this skill when:
Do NOT use this skill when:
pip install aitun
Or verify it is already installed:
which aitun || pip show aitun
Start your API server on a local port. Examples:
# Flask REST API
flask run --port 8080 --host 0.0.0.0 &
# FastAPI
uvicorn main:app --host 0.0.0.0 --port 8080 &
# Express.js
node server.js --port 8080 &
# Django
python manage.py runserver 0.0.0.0:8080 &
# Any HTTP API on any port
Verify it is running locally:
curl -s http://localhost:8080/health || echo "API not responding"
Expose the API to the internet:
aitun -p 8080 &
AITUN_PID=$!
sleep 3
The output will contain the public URL, e.g.:
https://aitun.cc/abc123Tell the user or integration partner the public API base URL:
Your API is now publicly accessible at: https://aitun.cc/abc123
Example endpoints:
- GET https://aitun.cc/abc123/health
- GET https://aitun.cc/abc123/api/users
- POST https://aitun.cc/abc123/api/users
Test with curl:
curl https://aitun.cc/abc123/health
This tunnel expires in 24 hours.
You or your users can now test the API with any HTTP client:
# Quick health check
curl -s https://aitun.cc/abc123/health
# GET request
curl -s https://aitun.cc/abc123/api/items
# POST request with JSON body
curl -X POST https://aitun.cc/abc123/api/items \
-H "Content-Type: application/json" \
-d '{"name": "test", "value": 42}'
Continue developing and restarting the API server locally — the tunnel stays active as long as the aitun process runs.
When testing is complete, stop the servers:
kill $AITUN_PID 2>/dev/null
The aitun command (installed via pip install aitun) accepts these flags:
| Flag | Description |
|---|---|
-p PORT | Local service port (default: 8080) |
-k TOKEN | Auth token for registered subdomain (omit for free tunnel) |
--host HOST | Local service address (default: localhost) |
--tcp-ports PORTS | TCP forwarding ports, comma-separated (e.g., 22,3306; requires -k) |
--p2p | Enable P2P direct connection (default: enabled) |
--no-p2p | Disable P2P, force server relay mode |
--daemon | Run as background daemon |
--stop | Stop running daemon |
aitun.cc/abc123), NOT subdomainsapi.t.aitun.cc), register at https://aitun.cc--tcp-ports flag with an auth token