openclaw-aisa-llm-gateway
Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install openclaw-aisa-llm-gateway或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install openclaw-aisa-llm-gateway⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/openclaw-aisa-llm-gateway/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: llm-router description: "Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key." homepage: https://openclaw.ai metadata: {"openclaw":{"emoji":"🧠","requires":{"bins":["curl","python3"],"env":["AISA_API_KEY"]},"primaryEnv":"AISA_API_KEY"}} ---
Unified LLM Gateway for autonomous agents. Powered by AIsa.
One API key. 70+ models. OpenAI-compatible.
Replace 100+ API keys with one. Access GPT-4, Claude-3, Gemini, Qwen, Deepseek, Grok, and more through a unified, OpenAI-compatible API.
"Chat with GPT-4 for reasoning, switch to Claude for creative writing"
"Compare responses from GPT-4, Claude, and Gemini for the same question"
"Analyze this image with GPT-4o - what objects are in it?"
"Route simple queries to fast/cheap models, complex queries to GPT-4"
"If GPT-4 fails, automatically try Claude, then Gemini"
| Feature | LLM Router | Direct APIs | |---------|------------|-------------| | API Keys | 1 | 10+ | | SDK Compatibility | OpenAI SDK | Multiple SDKs | | Billing | Unified | Per-provider | | Model Switching | Change string | Code rewrite | | Fallback Routing | Built-in | DIY | | Cost Tracking | Unified | Fragmented |
| Family | Developer | Example Models | |--------|-----------|----------------| | GPT | OpenAI | gpt-4.1, gpt-4o, gpt-4o-mini, o1, o1-mini, o3-mini | | Claude | Anthropic | claude-3-5-sonnet, claude-3-opus, claude-3-sonnet | | Gemini | Google | gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash | | Qwen | Alibaba | qwen-max, qwen-plus, qwen2.5-72b-instruct | | Deepseek | Deepseek | deepseek-chat, deepseek-coder, deepseek-v3, deepseek-r1 | | Grok | xAI | grok-2, grok-beta |
> Note: Model availability may vary. Check marketplace.aisa.one/pricing for the full list of currently available models and pricing.
export AISA_API_KEY="your-key"
POST https://api.aisa.one/v1/chat/completions
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
"temperature": 0.7,
"max_tokens": 1000
}'
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | model | string | Yes | Model identifier (e.g., gpt-4.1, claude-3-sonnet) | | messages | array | Yes | Conversation messages | | temperature | number | No | Randomness (0-2, default: 1) | | max_tokens | integer | No | Maximum response tokens | | stream | boolean | No | Enable streaming (default: false) | | top_p | number | No | Nucleus sampling (0-1) | | frequency_penalty | number | No | Frequency penalty (-2 to 2) | | presence_penalty | number | No | Presence penalty (-2 to 2) | | stop | string/array | No | Stop sequences |
{
"role": "user|assistant|system",
"content": "message text or array for multimodal"
}
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1234567890,
"model": "gpt-4.1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Quantum computing uses..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 50,
"completion_tokens": 200,
"total_tokens": 250,
"cost": 0.0025
}
}
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-sonnet",
"messages": [{"role": "user", "content": "Write a poem about AI."}],
"stream": true
}'
Streaming returns Server-Sent Events (SSE):
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"In"}}]}
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":" circuits"}}]}
...
data: [DONE]
Analyze images by passing image URLs or base64 data:
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
]
}
]
}'
Enable tools/functions for structured outputs:
curl -X POST "https://api.aisa.one/v1/chat/completions" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4.1",
"messages": [{"role": "user", "content": "What is the weather in Tokyo?"}],
"functions": [
{
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
},
"required": ["location"]
}
}
],
"function_call": "auto"
}'
For Gemini models, you can also use the native format:
POST https://api.aisa.one/v1/models/{model}:generateContent
curl -X POST "https://api.aisa.one/v1/models/gemini-2.0-flash:generateContent" \
-H "Authorization: Bearer $AISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"role": "user",
"parts": [{"text": "Explain machine learning."}]
}
],
"generationConfig": {
"temperature": 0.7,
"maxOutputTokens": 1000
}
}'
No installation required - uses standard library only.
# Basic completion
python3 {baseDir}/scripts/llm_router_client.py chat --model gpt-4.1 --message "Hello, world!"
# With system prompt
python3 {baseDir}/scripts/llm_router_client.py chat --model claude-3-sonnet --system "You are a poet" --message "Write about the moon"
# Streaming
python3 {baseDir}/scripts/llm_router_client.py chat --model gpt-4o --message "Tell me a story" --stream
# Multi-turn conversation
python3 {baseDir}/scripts/llm_router_client.py chat --model qwen-max --messages '[{"role":"user","content":"Hi"},{"role":"assistant","content":"Hello!"},{"role":"user","content":"How are you?"}]'
# Vision analysis
python3 {baseDir}/scripts/llm_router_client.py vision --model gpt-4o --image "https://example.com/image.jpg" --prompt "Describe this image"
# List supported models
python3 {baseDir}/scripts/llm_router_client.py models
# Compare models
python3 {baseDir}/scripts/llm_router_client.py compare --models "gpt-4.1,claude-3-sonnet,gemini-2.0-flash" --message "What is 2+2?"
from llm_router_client import LLMRouterClient
client = LLMRouterClient() # Uses AISA_API_KEY env var
# Simple chat
response = client.chat(
model="gpt-4.1",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response["choices"][0]["message"]["content"])
...安装 One API key for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more 后,可以对 AI 说这些话来触发它
What's trending on X right now related to AI?
Queries Grok's real-time X data feed and returns a ranked list of trending AI topics with engagement metrics
Ask Grok to summarize the latest news about OpenAI
Sends the query to Grok, which pulls live data from X and news sources, then returns a concise summary with source links
Use Grok to fact-check this claim with real-time data
Passes the claim to Grok, which cross-references it against current X posts and news, then returns a verdict with evidence
将技能文件夹放到 ~/.claude/skills/openclaw-aisa-llm-gateway/ 目录(个人级,所有项目可用),或 .claude/skills/openclaw-aisa-llm-gateway/(项目级)。重启 AI 客户端后,用 /openclaw-aisa-llm-gateway 主动调用,或让 AI 根据上下文自动发现并使用。
One API key for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
One API key for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more 可免费安装使用。请查阅仓库了解许可证信息。
Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.
One API key for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。