Api Gateway

👤 miguelguerra200022-sudo 📦 v1.0.0 ⭐ 3.6 ⬇️ 1.7K 下载
🔒 IT运维与安全 免费 🔑 需 API Key

📖 技能介绍


name: api-gateway description: Gateway universal para APIs. Conecta cualquier API REST/GraphQL con configuración simple. Gestiona autenticación, rate limiting y caching. metadata: {"openclaw":{"emoji":"🔌","auto":false}}


API Gateway Universal

Conecta el bot a cualquier API externa con configuración mínima. Un solo lugar para gestionar todas tus integraciones.

Concepto

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│    Bot      │ ──► │  API        │ ──► │  APIs       │
│  (Comando)  │     │  Gateway    │     │  Externas   │
└─────────────┘     └─────────────┘     └─────────────┘
                           │
                    ┌──────┴──────┐
                    │ • Auth      │
                    │ • Cache     │
                    │ • Rate Limit│
                    │ • Retry     │
                    └─────────────┘

Comandos

Configurar APIs

# Agregar nueva API
api add weather
  --base:https://api.openweathermap.org/data/2.5
  --auth:query:appid:$WEATHER_API_KEY

# Agregar endpoint
api endpoint weather current
  --path:/weather
  --params:q,units

# Listar APIs configuradas
api list

Llamar APIs

# Llamar endpoint
api call weather current --q:"Mexico City" --units:metric

# Llamada directa con URL
api get https://api.example.com/data

# POST con body
api post https://api.example.com/create --body:'{"name":"test"}'

Gestión

# Ver estadísticas
api stats weather

# Ver logs
api logs --last:10

# Probar conexión
api test weather

Ejemplo: Configurar API del Clima

# apis/weather.yaml
name: weather
base_url: https://api.openweathermap.org/data/2.5
auth:
  type: query
  param: appid
  value: ${WEATHER_API_KEY}

endpoints:
  current:
    path: /weather
    method: GET
    params:
      - q: string  # ciudad
      - units: metric|imperial
    cache: 10m

  forecast:
    path: /forecast
    method: GET
    params:
      - q: string
      - cnt: number  # días

Uso después de configurar

Usuario: clima en "Ciudad de México"

Bot: 🌤️ Clima actual en Ciudad de México:

     🌡️ Temperatura: 22°C
     💧 Humedad: 45%
     💨 Viento: 12 km/h
     🌅 Sensación térmica: 24°C

Tipos de Autenticación

Tipo Ejemplo
API Key (Header) Authorization: Bearer xxx
API Key (Query) ?api_key=xxx
Basic Auth username:password
OAuth 2.0 Token refresh automático
Custom Headers personalizados

Funcionalidades

Caching

endpoints:
  data:
    cache: 15m  # Cache de 15 minutos

Rate Limiting

rate_limit:
  requests: 100
  period: 1h

Retry Automático

retry:
  attempts: 3
  backoff: exponential

APIs Pre-configuradas

API Configuración
OpenWeather WEATHER_API_KEY
GitHub GITHUB_TOKEN
Slack SLACK_TOKEN
Notion NOTION_API_KEY
Discord DISCORD_TOKEN

Integración

  • proactive-triggers: Llamar APIs en automatizaciones

    访问小葱技能站7w4.net,解锁更多实用的AI技能插件。

  • daily-digest: Obtener datos de múltiples APIs
  • multi-agent: Los agentes pueden usar APIs configuradas

🤖 AI 评测

这个 Skill 的设计思路不错,文档写得也很清楚,看起来功能挺丰富的。但可惜目前只有使用说明,没有实际的程序代码,所以暂时还无法直接使用。需要开发者先把代码补全,才能真正体验到这些功能好不好用。

📊 多维度评分

适应性3.7
规范性3.9
有效性3.7
可靠性3
可信度4

📁 包含文件 (3 个)

📄 SKILL.md 3.4 KB
📄 _meta.json 135 B
📄 skill-card.md 2 KB