Use this skill when:
Do NOT use this skill when:
bash
pip install aitun
Or install via one-line script (Linux/macOS):
bash
curl -fsSL https://aitun.cc/install.sh | bash
Windows (PowerShell):
powershell
irm https://aitun.cc/install.ps1 | iex
Or verify it is already installed:
bash
which aitun
Start your API server on a local port. Examples:
bash
# 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:
bash
curl -s http://localhost:8080/health || echo "API not responding"
Expose the API to the internet:
bash
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:
text
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:
bash
# 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:
bash
kill $AITUN_PID 2>/dev/null
The aitun command (installed via pip install aitun, or alternatively curl -fsSL https://aitun.cc/install.sh | bash / irm https://aitun.cc/install.ps1 | iex on Windows) accepts these flags:
FlagDescription-p PORTLocal HTTP service port (optional; omit for TCP-only mode with --tcp-ports)-k TOKENAuth token for registered subdomain (omit for free tunnel)--host HOSTLocal service address (default: localhost)--tcp-ports PORTSTCP forwarding ports, comma-separated (e.g., 22,3306; requires -k). Use without -p for TCP-only mode--p2pEnable P2P direct connection (default: enabled)--no-p2pDisable P2P, force server relay mode--daemonRun as background daemon--stopStop running daemon
aitun.cc/abc123), NOT subdomainsapi.t.aitun.cc), register at https://aitun.cc--tcp-ports flag with an auth token