Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add davidtoby/agent-skills --skill api-learnergit clone --depth 1 https://github.com/davidtoby/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/davidtoby/agent-skills/api-learner)<a href="https://agentmods.dev/skills/davidtoby/agent-skills/api-learner"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/api-learner/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/api-learner"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/api-learner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00022 | $0.00862 |
| Opus 5.5 | $0.00009 | $0.00345 |
| Sonnet 5.5 | $0.00004 | $0.00172 |
| Haiku 4.5 | $0.00002 | $0.00086 |
Grade B, and why
api-learner scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9222 --duration 300 Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
description: "Workflow for learning site APIs via traffic capture and replacing browser automation with direct curl calls." How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Learner — Browser-to-API Migration
Instead of fighting browser timeouts on heavy sites, you can use learned API patterns to make direct curl calls. This is faster, more reliable, and avoids CDP timeout issues.
When to Suggest API Capture
Suggest this to the operator when:
- A site repeatedly causes browser timeouts (heavy SPAs, JS-heavy storefronts)
- You're doing the same browser task repeatedly (search → add to cart → repeat)
- The browser tool fails with "timed out after 20000ms" on a site you use often
Do NOT use API skills for:
- First visits to a new site (need to discover the workflow first)
- CAPTCHA or bot-detection flows
- Checkout / payment flows (the operator handles these manually)
- Sites where you need to see visual layout (e.g., comparing product images)
How API Learning Works
- The operator starts a capture on the relevant VNC browser port
- Normal browsing happens — manually or via the browser tool
- Capture script records all XHR/Fetch API calls passively
- Generator analyzes the traffic and produces a SKILL.md with endpoint docs
- You use curl with fresh cookies instead of the browser tool
Using a Generated API Skill
Once an API skill exists (e.g., api-example), follow this pattern:
Step 1: Extract fresh cookies
COOKIES=$(/opt/OpenClaw/scripts/extract-cookies.js --domain <domain> --port <cdp-port>)
The VNC browser must be open and logged into the site. Cookies come from the live browser session.
Step 2: Make API calls
Use curl with the cookie header:
curl -s 'https://www.example.com/api/search?q=spinach' \
-H "Cookie: $COOKIES" | python3 -m json.tool
Step 3: Handle failures
- 401/403: Cookies expired. Re-extract and retry.
- Changed responses: API may have been updated. Tell the operator to re-capture.
- Unexpected errors: Fall back to the
browsertool. Report to the operator.
Starting a New Capture (For the Operator)
To capture traffic from a site:
# Capture from Mise's browser (port 9222) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9222 --duration 300
# Capture from Headhunter's browser (port 9223) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9223 --duration 300
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 86 lines · 22 tokens per session scan B 4a6050a35598
api-learner is a skill published in the GitHub repository davidtoby/agent-skills (11 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 862 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
channel-manager
Configure IM platform channels (Feishu, WeCom, Weixin, Discord, Telegram, DingTalk, QQ) for openclacky. Uses browser automation for navigation; guides the user to paste credentials and perform UI steps. Trigger on: "channel setup", "setup feishu", "setup wecom", "setup weixin", "setup wechat", "setup discord", "setup…
web-skills-protocol
Auto-discover and use Web Skills Protocol (WSP) skills when interacting with websites. Use this skill whenever the user asks you to interact with, use, or perform actions on a website or web service — such as searching a site, placing an order, deploying an app, or calling a web API. Before scraping HTML or guessing…
dingtalk_channel_connect
Use a headed browser to automatically complete DingTalk channel integration for QwenPaw. Applicable when the user mentions DingTalk, developer console, Client ID, Client Secret, bot, Stream mode, binding or configuring a channel. Supports pausing when a login page is detected and resuming after the user logs in.
browser_cdp
Browser connection controls for finding local debugging ports, attaching to an already running Chrome browser, or sharing one browser between tools.
morph-ppt
Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style continuous motion, shapes that grow / move / rotate as the slide advances. Trigger on: 'morph', 'morph transition', 'smooth transition', 'continuous animation across slides', 'Keynote-style…
officecli-academic-paper
Use this skill to build academic-style .docx output: journal / conference / thesis chapters carrying formal citation style (APA, Chicago, IEEE, MLA), numbered equations, figure & table cross-references, footnotes/endnotes, bibliography, or multi-column journal layout. Trigger on: 'research paper', 'journal paper'…