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看看吧。

  • 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