Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

ai-gatewayAI 网关

Agent Skill

ai-gateway 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

505

周安装

17

GitHub Stars

4

下载量

140
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ai-gateway(AI 网关)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/ai-gateway
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill ai-gateway
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill ai-gateway

简介

ai-gateway 负责 AI 服务请求的路由、安全与性能监控,集成于 aimlops 集群。

  • 适用于多模型生产环境,需集中管控流量、保障 API 安全与扩展性。
  • 支持微服务架构下的 AI 推理端点管理与 Kubernetes 集成。
  • 安装命令为 npx skills add https://github.com/alphaonedev/openclaw-graph --skill ai-gateway。
  • 涉及生产级配置变更,建议先在测试环境验证后再上线。

SKILL.md

ai-gateway

Purpose

This skill manages an AI gateway for routing, securing, and monitoring AI service requests in ML operations, ensuring efficient traffic handling, API security, and performance tracking within the aimlops cluster.

When to Use

Use this skill when building ML pipelines that require centralized routing of AI requests, such as in production environments with multiple AI models, to enforce security policies, monitor traffic, or scale API endpoints. Apply it in scenarios involving microservices for AI inference or when integrating with tools like Kubernetes for aimlops workflows.

Key Capabilities

  • Routing: Dynamically route requests to AI services based on rules, using path-based or header-based matching.
  • Security: Enforce authentication, rate limiting, and encryption via JWT or API keys.
  • Monitoring: Track metrics like request latency and error rates through integrated logging and Prometheus exporters.
  • Configuration: Support YAML-based configs for defining routes, e.g., specifying source and destination endpoints.
  • Scalability: Handle load balancing across multiple AI backends with automatic failover.

Usage Patterns

To use this skill, first set up the AI gateway via CLI or API, then define routes and security rules. Always authenticate requests using the $AI_GATEWAY_API_KEY environment variable. For CLI usage, initialize with ai-gateway-cli init --config path/to/config.yaml, then apply changes with ai-gateway-cli apply. In code, import the SDK and call methods like createRoute() for programmatic setup. Monitor usage by querying metrics endpoints periodically.

Common Commands/API

  • CLI Commands:

- Initialize gateway: ai-gateway-cli init --cluster aimlops --key $AI_GATEWAY_API_KEY - Add a route: ai-gateway-cli add-route --path /predict --target http://ai-service:8080 --method POST - Secure an endpoint: ai-gateway-cli secure --endpoint /predict --auth jwt --rate-limit 100/min - View metrics: ai-gateway-cli metrics --format json

  • API Endpoints:

- Create route: POST /api/v1/routes with body {"path": "/predict", "target": "http://ai-service:8080", "method": "POST"} - Update security: PUT /api/v1/security/{endpoint} with body {"authType": "jwt", "rateLimit": 100} - Get metrics: GET /api/v1/metrics?type=latency

  • Code Snippets: import requests headers = {'Authorization': f'Bearer {os.environ.get("AI_GATEWAY_API_KEY")}'} response = requests.post('http://gateway:8080/api/v1/routes', json={"path": "/predict", "target": "http://ai-service:8080"}, headers=headers) export AI_GATEWAY_API_KEY=your_api_key_here ai-gateway-cli add-route --path /chat --target http://llm-service:5000
  • Config Formats: Use YAML for configurations, e.g.: routes: - path: /predict target: http://ai-service:8080 methods: [POST] security: - endpoint: /predict auth: jwt rateLimit: 100

Integration Notes

Integrate with aimlops by deploying the gateway as a sidecar or standalone service in your cluster. For Kubernetes, add annotations to pods, e.g., kubectl annotate pod ai-pod aimlops/gateway=true. Use the SDK to link with other AI tools: import and initialize with AI_Gateway(api_key=os.environ['AI_GATEWAY_API_KEY']).connect(cluster='aimlops'). Ensure compatibility by matching tags like "ai" and "mlops". For external services, set up webhooks by configuring the gateway's callback URL in your config, e.g., add callback: http://external-service/webhook in YAML.

Error Handling

Handle errors by checking HTTP status codes from API responses; for example, 401 indicates authentication failure, so retry with headers['Authorization'] = f'Bearer {new_key}'. For CLI, parse output errors like "Error: Invalid route path" and correct inputs. Common issues include missing API keys—always verify if not os.environ.get('AI_GATEWAY_API_KEY'): raise ValueError('API key required'). Log errors using the gateway's built-in logger: enable with ai-gateway-cli config --log-level debug, then monitor for patterns like rate limit exceedances and implement retries with exponential backoff in code.

Concrete Usage Examples

  1. Route AI Requests: To route prediction requests to an ML model, first export your API key, then use the CLI: export AI_GATEWAY_API_KEY=abc123; ai-gateway-cli add-route --path /ml-predict --target http://model-service:8000. Verify with a curl request: curl -H "Authorization: Bearer abc123" http://gateway:8080/ml-predict -d '{"input": "data"}'.
  2. Secure and Monitor API: Secure an endpoint and monitor traffic by running: ai-gateway-cli secure --endpoint /chat --auth api-key --rate-limit 50/min. Then, query metrics: ai-gateway-cli metrics --endpoint /chat. In code, handle it as: ``python import requests; headers = {'Authorization': f'Bearer {os.environ["AI_GATEWAY_API_KEY"]}'}; requests.get('[http://gateway:8080/api/v1/metrics](http://gateway:8080/api/v1/metrics)', headers=headers) `

Graph Relationships

  • Related to: aimlops (cluster), ai (tag), mlops (tag)
  • Depends on: authentication services for security
  • Used by: AI services for routing and monitoring
  • Integrates with: Kubernetes for deployment, Prometheus for metrics collection

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.27%
按下载量换算51

Claude

30.92%
按下载量换算43

Cursor

19.91%
按下载量换算28

Gemini CLI

10.17%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills