Zyla API Hub Skill
Turn your OpenClaw AI agent into a real-world operator.
Power it with 10,000+ production-ready APIs from Zyla API Hub — instant access to weather, finance, translation, email validation, geolocation, and more, all through one unified API key, pay-as-you-go pricing, and zero vendor lock-in.
Setup
If ZYLA_API_KEY is not configured, guide the user:
- 1. Visit https://zylalabs.com/openclaw/connect to get an API key
- Or run
/zyla connect if the plugin is installed (opens browser automatically) - Add the key to
~/.openclaw/openclaw.json under INLINECODE3
Never ask the user to paste their API key in chat. Ask them to set it via the config and confirm when ready.
Quick Start — Popular APIs
Use these directly without searching the catalog. Each includes the API ID, endpoint details, and parameters.
Weather by Zip API (ID: 781)
- - Use when: user asks about weather, temperature, forecast, climate, conditions by zip code
- Category: Weather & Environment
- Call: INLINECODE4
Currency Conversion API (example)
- - Use when: user asks about currency exchange, conversion rates, forex
- Category: Finance
- Call: INLINECODE5
Email Validation API (example)
- - Use when: user asks to validate, verify, or check an email address
- Category: Data Validation
- Call: INLINECODE6
Note: Run npx tsx {baseDir}/scripts/generate-popular.ts to regenerate this section with real API IDs and endpoints from the live catalog.
Discovering APIs
For APIs not listed above, search the catalog:
CODEBLOCK0
Calling APIs
Using the helper script (recommended)
CODEBLOCK1
Using curl (fallback)
CODEBLOCK2
URL pattern: INLINECODE8
- -
api_id and endpoint_id are numeric IDs (these do the actual routing) - INLINECODE11 and
endpoint_name_slug are URL-friendly names (for readability)
Error Handling
- - 401 Unauthorized: API key is invalid or expired. Ask the user to run
/zyla connect or visit https://zylalabs.com/openclaw/connect to get a new key. - 403 Forbidden: Subscription issue. The pay-as-you-go plan should handle this automatically. If it persists, ask the user to contact support.
- 429 Too Many Requests: Rate limit exceeded. Check the
X-Zyla-RateLimit-Minute-Remaining response header. Wait before retrying. - 404 Not Found: The API or endpoint does not exist. Verify the IDs using the catalog.
- 5xx Server Error: Upstream API issue. Retry after a short delay (2-5 seconds).
Rate Limit Headers
Every API response includes these headers:
- -
X-Zyla-RateLimit-Minute-Limit: Max requests per minute - INLINECODE16 : Remaining requests this minute
- INLINECODE17 : Total calls this billing cycle
- INLINECODE18 : Remaining calls this cycle
Billing
- - Pay-as-you-go: No monthly fee. Each API call is billed at the API's per-call rate.
- Billing happens at the end of each cycle via Stripe.
- Use the health endpoint to check current usage: INLINECODE19
Zyla API Hub 技能
将您的 OpenClaw AI 智能体转变为现实世界的操作者。
通过 Zyla API Hub 为其提供 10,000 多个生产级 API — 即时访问天气、金融、翻译、电子邮件验证、地理位置等,全部通过统一的 API 密钥、按需付费定价,且零供应商锁定。
设置
如果未配置 ZYLAAPIKEY,请引导用户:
- 1. 访问 https://zylalabs.com/openclaw/connect 获取 API 密钥
- 如果已安装插件,运行 /zyla connect(将自动打开浏览器)
- 将密钥添加到 ~/.openclaw/openclaw.json 中的 skills.entries.zyla-api-hub-skill.apiKey
切勿要求用户在聊天中粘贴其 API 密钥。请要求他们通过配置文件进行设置,并在准备就绪时确认。
快速入门 — 热门 API
无需搜索目录即可直接使用这些 API。每个 API 均包含 API ID、端点详情和参数。
邮政编码天气 API(ID:781)
- - 使用场景:用户询问按邮政编码查询的天气、温度、预报、气候、状况
- 类别:天气与环境
- 调用:npx tsx {baseDir}/scripts/zyla-api.ts call --api 781 --endpoint --params {zip:10001}
货币转换 API(示例)
- - 使用场景:用户询问货币兑换、汇率、外汇
- 类别:金融
- 调用:npx tsx {baseDir}/scripts/zyla-api.ts call --api --endpoint --params {from:USD,to:EUR,amount:100}
电子邮件验证 API(示例)
- - 使用场景:用户要求验证、核实或检查电子邮件地址
- 类别:数据验证
- 调用:npx tsx {baseDir}/scripts/zyla-api.ts call --api --endpoint --params {email:test@example.com}
注意:运行 npx tsx {baseDir}/scripts/generate-popular.ts 以使用实时目录中的真实 API ID 和端点重新生成此部分。
发现 API
对于上述未列出的 API,请搜索目录:
bash
按关键词搜索
npx tsx {baseDir}/scripts/zyla-catalog.ts search 食谱
按类别列出 API
npx tsx {baseDir}/scripts/zyla-catalog.ts list --category 金融
获取特定 API 的端点
npx tsx {baseDir}/scripts/zyla-catalog.ts endpoints --api 781
调用 API
使用辅助脚本(推荐)
bash
基本调用
npx tsx {baseDir}/scripts/zyla-api.ts call \
--api
\
--endpoint \
--params {key:value}
指定 HTTP 方法(默认:GET)
npx tsx {baseDir}/scripts/zyla-api.ts call \
--api \
--endpoint \
--method POST \
--params {key:value}
获取 API 信息
npx tsx {baseDir}/scripts/zyla-api.ts info --api
检查健康状况和剩余配额
npx tsx {baseDir}/scripts/zyla-api.ts health
使用 curl(备用方案)
bash
curl -H Authorization: Bearer $ZYLAAPIKEY \
https://zylalabs.com/api/{apiid}/{apislug}/{endpointid}/{endpointslug}?param=value
URL 模式:https://zylalabs.com/api/{apiid}/{apinameslug}/{endpointid}/{endpointnameslug}
- - apiid 和 endpointid 是数字 ID(用于实际路由)
- apinameslug 和 endpointnameslug 是 URL 友好的名称(用于可读性)
错误处理
- - 401 未授权:API 密钥无效或已过期。请用户运行 /zyla connect 或访问 https://zylalabs.com/openclaw/connect 获取新密钥。
- 403 禁止访问:订阅问题。按需付费计划应自动处理此问题。如果问题持续存在,请用户联系支持。
- 429 请求过多:超出速率限制。检查 X-Zyla-RateLimit-Minute-Remaining 响应头。等待后重试。
- 404 未找到:API 或端点不存在。使用目录验证 ID。
- 5xx 服务器错误:上游 API 问题。短暂延迟后重试(2-5 秒)。
速率限制头
每个 API 响应均包含以下头信息:
- - X-Zyla-RateLimit-Minute-Limit:每分钟最大请求数
- X-Zyla-RateLimit-Minute-Remaining:本分钟剩余请求数
- X-Zyla-API-Calls-Monthly-Used:本计费周期总调用次数
- X-Zyla-API-Calls-Monthly-Remaining:本周期剩余调用次数
计费
- - 按需付费:无月费。每次 API 调用按 API 的每次调用费率计费。
- 通过 Stripe 在每个周期结束时进行计费。
- 使用健康端点检查当前使用情况:npx tsx {baseDir}/scripts/zyla-api.ts health