← 返回 Skills 市场
ctz168

Remote Api

作者 SamAI.cc · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
20
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install remote-api
功能描述
Expose 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 ser...
使用说明 (SKILL.md)

Remote API - Expose Local API for External Testing via Aitun Tunnel

When to Use

Use this skill when:

  • You built a REST API, GraphQL endpoint, or any HTTP API locally and need someone to test it
  • You want to share a local API with a frontend developer, QA team, or integration partner
  • You need a public API endpoint for a client app, mobile app, or third-party tool to call
  • You are developing an API and want to test it with external tools like Postman, curl, or Swagger UI
  • You need to register a local API with an API gateway or service mesh

Do NOT use this skill when:

  • The API is already deployed to a public server
  • You only need to test the API locally (no tunnel needed)
  • You want to send files rather than serve an API (use sendfile instead)

Instructions

Step 1: Install aitun

pip install aitun

Or verify it is already installed:

which aitun || pip show aitun

Step 2: Start the local API service

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"

Step 3: Create a tunnel

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/abc123

Step 4: Share the API URL

Tell 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.

Step 5: Test and iterate

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.

Step 6: Clean up

When testing is complete, stop the servers:

kill $AITUN_PID 2>/dev/null

CLI Reference

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

Notes

  • Free tunnels use proxy address mode (path-based URL like aitun.cc/abc123), NOT subdomains
  • Free tunnels expire after 24 hours, auto-renewed on restart
  • For a permanent API endpoint (e.g., api.t.aitun.cc), register at https://aitun.cc
  • CORS headers may need to be configured on your API server to allow cross-origin requests from browsers
  • If your API uses WebSocket, the tunnel supports WebSocket proxying
  • For TCP-based APIs (databases, gRPC), use the --tcp-ports flag with an auth token
  • All traffic is encrypted end-to-end
  • Rate limiting and authentication should be implemented in your API server for security
安全使用建议
Install only if you intend to share a local app publicly. Before using it, make sure the app is bound to loopback, has no debug/admin/code-execution routes exposed, and does not grant access to local files, shells, databases, or environment credentials. Prefer one-off foreground mode unless you want a persistent service.
能力评估
Purpose & Capability
The public URL and reverse-proxy behavior are the core stated purpose: sharing a locally running app with others.
Instruction Scope
The skill includes explicit security warnings, asks for confirmation before exposing a port, and tells the agent not to expose unknown or unexpected ports.
Install Mechanism
It installs a local p2claw binary from a GitHub release and states that SHA-256 verification is performed; users should still trust the publisher and release source before installing.
Credentials
Exposing localhost to the internet is high impact, but it is proportionate to the skill’s purpose and the artifact repeatedly calls out the risks.
Persistence & Privilege
The skill can install a user-level service, create a persistent identity key, and has an optional sudo/system service path; these are disclosed and require user confirmation.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install remote-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /remote-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release - expose local API for external testing via aitun tunnel
元数据
Slug remote-api
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Remote Api 是什么?

Expose 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 ser... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 20 次。

如何安装 Remote Api?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install remote-api」即可一键安装,无需额外配置。

Remote Api 是免费的吗?

是的,Remote Api 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Remote Api 支持哪些平台?

Remote Api 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Remote Api?

由 SamAI.cc(@ctz168)开发并维护,当前版本 v1.0.0。

💬 留言讨论