Introduction¶
The common approach to connecting Agents to third-party APIs like Slack, Gmail, or Stripe involves stacking OAuth logic, storing refresh tokens, and writing custom HTTP wrappers within the project. With multiple accounts and fine-grained permissions, Agents are prone to sending messages or modifying data without confirmation. This article introduces the API Gateway on SkillHub (located at @clawhub_byungkyu/api-gateway). It defines “which app to connect, which connection to use, and what read/write operations to perform” as a reusable Skill workflow. Under the hood, it utilizes a Maton-managed API gateway to inject credentials, with built-in connection management, triggers, event replay, and user approval constraints.
What is this?¶
API Gateway is a Skill designed for AI Agents (Category: ai-agent, current version v1.0.124, source: clawhub, publisher: byungkyu). The official description on SkillHub is: Connect to external services via Maton-managed API routes; use only after the user specifies the target app, account, and task; start with read or list operations (refer to the upstream Skill documentation for full details).
The Skill is tagged with requires_api_key=true, but actual invocation relies on a Maton account and authorized app connections, rather than hardcoding client secrets for various services within the Skill.
- SkillHub Page: https://www.skillhub.cn/skills/clawhub_byungkyu/api-gateway
- Official Entry: https://api.skillhub.cn/zcwl/api-gateway
- Upstream Repository: https://clawhub.ai/byungkyu/api-gateway
As of the SkillHub display data: Rating 100000, Downloads 134687, Installs 11601.
Core Features¶
The following capabilities are derived from the upstream Maton API Gateway Skill documentation, which this Skill guides the Agent to execute step-by-step.
Managed Routing & API Invocation¶
For apps already connected in Maton, calls can be initiated via the gateway. Credentials are injected by the gateway, so the Agent does not need to hold long-term keys in conversations or code.
- App Commands: View help hierarchically using
maton <app> <resource> <verb>, such as listing Slack channels or sending messages. - Generic API: For endpoints without dedicated subcommands, use
maton api. The first segment of the path is the app identifier, followed by the upstream native API path.
maton slack channel list --types public_channel --limit 10
maton api '/google-mail/gmail/v1/users/me/messages'
maton api '/slack/api/conversations.list?types=public_channel&limit=10'
The documented support scope includes a vast array of SaaS platforms like Gmail (emails, threads, labels), Slack (messages, channels, users), and Stripe (customers, subscriptions, account records). Specific endpoints depend on the respective app’s references/ and maton --help.
Connection Management¶
A connection represents “an authorized external app instance under a specific Maton account.”
maton connection list slack --status ACTIVE
maton connection create slack # Requires explicit user consent
maton connection get {connection_id}
maton connection delete {connection_id} --yes
When multiple connections exist for the same app, use --connection {connection_id} or the Maton-Connection header to specify the account; if unspecified, the oldest ACTIVE connection is used. Before creating a connection, the Skill requires the Agent to verify the specific app and user authorization intent, and must not initiate authorization autonomously.
Triggers & Events¶
Triggers can be configured for sources like GitHub, Stripe, and Google Mail, allowing for management of destinations, viewing, and replaying events.
maton trigger list --source github --status ENABLED -L 50
maton trigger create --source github --event-type pull_request.opened ...
maton trigger event list --trigger {trigger_id} -L 1
maton trigger event replay {event_id} --trigger {trigger_id}
maton trigger event watch -t {trigger_id}
The time source supports cron scheduling (schedule.elapsed) and requires no active connection. Creating a destination continuously forwards matching events to a specified URL. The documentation marks this as a high-risk operation; the URL, data content, and persistence must be disclosed to the user individually before execution.
Functions (Optional, Non-Default Path)¶
Maton supports hosted Python functions (creation, deployment, invocation, versioning, and environment variables). The Skill explicitly states: For daily reading of emails or modifying records, prefer maton api; the function workflow should only be used when the user explicitly requests hosted code. Both deploy and invoke operations require itemized approval.
Security & Approval¶
The Skill defines several hard constraints for the Agent, such as:
- Explicit user approval is required before creating connections or performing any POST/PUT/PATCH/DELETE (sending messages, creating records, deleting resources, etc.).
- Trigger destinations are considered “continuous outbound channels” and must not be created as an incidental step. Sending events to public request-bin services is prohibited.
maton trigger event watch --execis the only path that executes local scripts. Scripts must be written or reviewed by the user and require separate approval.
Installation & Enablement¶
Installing the Skill (SkillHub)¶
Follow the official SkillHub instructions to have the Agent reference the installation documentation and install the specified coordinate:
Please install `@clawhub_byungkyu/api-gateway` according to https://skillhub.cn/install/skillhub.md.
CLI example (the skills directory must point to the actual path used by the current Agent, otherwise it will not be loaded after installation):
command -v skillhub && skillhub --version
skillhub install @clawhub_byungkyu/api-gateway --dir <skills directory>
Common paths (from SkillHub installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
The upstream ClawHub page also provides an OpenClaw installation command openclaw skills install @byungkyu/api-gateway; if using an OpenClaw-based client, refer to its documentation.
Installing Maton CLI & Logging In¶
Gateway invocation relies on Maton CLI (the version example in the Skill doc is @maton/cli@0.4.0, which can also be installed via Homebrew with brew pin maton to pin the version).
npm install -g @maton/cli@0.4.0
maton login
maton whoami --json
Upon successful login, configuration is written to $HOME/.config/maton/config.toml, and tokens are managed by the system’s credential storage. If whoami returns authenticated: false, you should run maton login again.
Typical Usage¶
Below is a reproducible path to “connect to Slack first, then list channels,” consistent with the official example.
1. Verify Login Status
maton whoami --json
2. Check for Existing Slack Connections
maton connection list slack --status ACTIVE
If there is no connection, create one and complete browser authorization after user confirmation:
maton connection create slack
maton connection get {connection_id}
3. List Channels (Read-only)
maton slack channel list --types public_channel --limit 10
For multi-account scenarios, add --connection {connection_id}.
The same logic applies to reading unread Gmail or checking Stripe customers: first confirm the connection and task, prefer maton api or the corresponding maton <app> subcommand; before performing write operations, repeat the target service, resource, and payload to the user and wait for approval, as required by the Skill.
Scenarios & Notes¶
Who is it for?
- Users already employing Agents that support Skills (like Cursor, Claude Code, Codex) and wish to connect to Slack/Gmail/Stripe via a unified gateway instead of rewriting OAuth for every project.
- Users who need their Agents to manage connections and triggers according to documentation, and to pause and ask the user before modifying data.
Limitations & Notes
- Must be able to install and log into Maton CLI; the Skill itself does not replace the Maton account or authorizations on the respective app sides.
- Tag
requires_api_key=true: Keys and tokens are managed by Maton, but the Agent must still adhere to the Skill’s approval rules in conversation. Do not assume that because it is a “read-only Skill” you can freely create connections or destinations. - The SkillHub distributed version is v1.0.124, while the upstream ClawHub page may show a higher version number; it is recommended to check the upstream release notes before upgrading the Skill or CLI.
- The “Managed API Gateway” mentioned in user leads is consistent with the Maton description on the SkillHub page; if the official intro is truncated on SkillHub, the complete behavior is based on the documentation at https://clawhub.ai/byungkyu/api-gateway.
Conclusion¶
API Gateway embeds Maton’s connection, API routing, triggers, and security approval conventions into an Agent Skill. It is suitable for allowing models to list channels, read emails, or check payment objects under the premise of clear apps, accounts, and tasks, rather than scattering OAuth code across repositories. Installation and documentation entry: https://www.skillhub.cn/skills/clawhub_byungkyu/api-gateway , Official URL: https://api.skillhub.cn/zcwl/api-gateway .