
Higress Openclaw Integration
- 1 installs
- 9k repo stars
- Updated August 4, 2026
- alibaba/higress
higress-openclaw-integration is a Claude skill that deploys the Higress AI Gateway and configures OpenClaw to use it as a unified model provider across many LLM providers.
About
higress-openclaw-integration deploys the Higress AI Gateway and configures OpenClaw to use it as a single unified model provider. It collects the provider API keys, runs the gateway install script, sets up optional auto-routing, and installs the OpenClaw provider plugin. Developers use it to route OpenClaw through Higress and access many LLM providers behind one gateway.
- Deploys the Higress AI Gateway and configures OpenClaw to use it as a unified provider
- Sets up model routing and auto-routing across many LLM providers
- Manages LLM provider API keys for z.ai, Claude, OpenAI, DeepSeek, and more
Higress Openclaw Integration by the numbers
- 1 all-time installs (skills.sh)
- Ranked #14,098 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
higress-openclaw-integration capabilities & compatibility
Requires at least one LLM provider API key; gateway deploys locally via install script.
- Capabilities
- gateway deployment · model routing · provider key management
- Works with
- openai · anthropic
- Use cases
- orchestration · devops
- Runs
- Runs locally
- Pricing
- Bring your own API key
What higress-openclaw-integration says it does
Deploy Higress AI Gateway and configure OpenClaw to use it as a unified model provider.
Auto-routing allows using `model="higress/auto"` to automatically route requests based on message content
npx skills add https://github.com/alibaba/higress --skill higress-openclaw-integrationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 9k |
| Last updated | August 4, 2026 |
| Repository | alibaba/higress ↗ |
What it does
Deploy Higress AI Gateway and configure OpenClaw to route across many LLM providers through it.
Who is it for?
Wiring OpenClaw to Higress AI Gateway for multi-provider model access and routing.
Skip if: Stacks that do not use OpenClaw or the Higress gateway.
When should I use this skill?
When a user wants to deploy Higress AI Gateway or configure OpenClaw with more model providers, routing, or provider keys.
What you get
A deployed Higress AI Gateway with OpenClaw configured to route across providers via a higress/ prefix.
By the numbers
- Supports 20+ LLM providers plus Azure, Bedrock, and Vertex cloud providers
Files
Higress AI Gateway Integration
Deploy Higress AI Gateway and configure OpenClaw to use it as a unified model provider.
Quick Start
Step 1: Collect Information from User
Ask the user for the following information upfront:
1. Which LLM provider(s) to use? (at least one required)
Commonly Used Providers:
| Provider | Parameter | Notes |
|---|---|---|
| 智谱 / z.ai | --zhipuai-key | Models: glm-*, Code Plan mode enabled by default |
| Claude Code | --claude-code-key | Requires OAuth token from `claude setup-token` |
| Moonshot (Kimi) | --moonshot-key | Models: moonshot-, kimi- |
| Minimax | --minimax-key | Models: abab-* |
| 阿里云通义千问 (Dashscope) | --dashscope-key | Models: qwen* |
| OpenAI | --openai-key | Models: gpt-, o1-, o3-* |
| DeepSeek | --deepseek-key | Models: deepseep-* |
| Grok | --grok-key | Models: grok-* |
Other Providers:
| Provider | Parameter | Notes |
|---|---|---|
| Claude | --claude-key | Models: claude-* |
| Google Gemini | --gemini-key | Models: gemini-* |
| OpenRouter | --openrouter-key | Supports all models (catch-all) |
| Groq | --groq-key | Fast inference |
| Doubao (豆包) | --doubao-key | Models: doubao-* |
| Mistral | --mistral-key | Models: mistral-* |
| Baichuan (百川) | --baichuan-key | Models: Baichuan* |
| 01.AI (Yi) | --yi-key | Models: yi-* |
| Stepfun (阶跃星辰) | --stepfun-key | Models: step-* |
| Cohere | --cohere-key | Models: command* |
| Fireworks AI | --fireworks-key | - |
| Together AI | --togetherai-key | - |
| GitHub Models | --github-key | - |
Cloud Providers (require additional config):
- Azure OpenAI:
--azure-key(requires service URL) - AWS Bedrock:
--bedrock-key(requires region and access key) - Google Vertex AI:
--vertex-key(requires project ID and region)
Brand Name Display (z.ai / 智谱):
- If user communicates in Chinese: display as "智谱"
- If user communicates in English: display as "z.ai"
2. Enable auto-routing? (recommended)
- If yes:
--auto-routing --auto-routing-default-model <model-name> - Auto-routing allows using
model="higress/auto"to automatically route requests based on message content
3. Custom ports? (optional, defaults: HTTP=8080, HTTPS=8443, Console=8001)
Step 2: Deploy Gateway
Auto-detect region for z.ai / 智谱 domain configuration:
When user selects z.ai / 智谱 provider, detect their region:
# Run region detection script (scripts/detect-region.sh relative to skill directory)
REGION=$(bash scripts/detect-region.sh)
# Output: "china" or "international"Based on detection result:
- If
REGION="china": use default domainopen.bigmodel.cn, no extra parameter needed - If
REGION="international": automatically add--zhipuai-domain api.z.aito deployment command
After deployment (for international users): Notify user in English: "The z.ai endpoint domain has been set to api.z.ai. If you want to change it, let me know and I can update the configuration."
# Create installation directory
mkdir -p higress-install
cd higress-install
# Download script (if not exists)
curl -fsSL https://higress.ai/ai-gateway/install.sh -o get-ai-gateway.sh
chmod +x get-ai-gateway.sh
# Deploy with user's configuration
# For z.ai / 智谱: always include --zhipuai-code-plan-mode
# For non-China users: include --zhipuai-domain api.z.ai
./get-ai-gateway.sh start --non-interactive \
--<provider>-key <api-key> \
[--auto-routing --auto-routing-default-model <model>]z.ai / 智谱 Options:
| Option | Description |
|---|---|
--zhipuai-code-plan-mode | Enable Code Plan mode (enabled by default) |
--zhipuai-domain <domain> | Custom domain, default: open.bigmodel.cn (China), api.z.ai (international) |
Example (China user):
./get-ai-gateway.sh start --non-interactive \
--zhipuai-key sk-xxx \
--zhipuai-code-plan-mode \
--auto-routing \
--auto-routing-default-model glm-5Example (International user):
./get-ai-gateway.sh start --non-interactive \
--zhipuai-key sk-xxx \
--zhipuai-domain api.z.ai \
--zhipuai-code-plan-mode \
--auto-routing \
--auto-routing-default-model glm-5Step 3: Install OpenClaw Plugin
Install the Higress provider plugin for OpenClaw:
# Copy plugin files (PLUGIN_SRC is relative to skill directory: scripts/plugin)
PLUGIN_SRC="scripts/plugin"
PLUGIN_DEST="$HOME/.openclaw/extensions/higress"
mkdir -p "$PLUGIN_DEST"
cp -r "$PLUGIN_SRC"/* "$PLUGIN_DEST/"Tell user to run the following commands manually in their terminal (interactive commands, cannot be executed by AI agent):
# Step 1: Enable the plugin
openclaw plugins enable higress
# Step 2: Configure provider (interactive - will prompt for Gateway URL, API Key, models, etc.)
openclaw models auth login --provider higress --set-default
# Step 3: Restart OpenClaw gateway to apply changes
openclaw gateway restartThe openclaw models auth login command will interactively prompt for: 1. Gateway URL (default: http://localhost:8080) 2. Console URL (default: http://localhost:8001) 3. API Key (optional for local deployments) 4. Model list (auto-detected or manually specified) 5. Auto-routing default model (if using higress/auto)
After configuration and restart, Higress models are available in OpenClaw with higress/ prefix (e.g., higress/glm-5, higress/auto).
Future Configuration Updates (No Restart Needed)
After the initial setup, you can manage your configuration through conversation with OpenClaw:
- Add New Providers: Add new LLM providers (e.g., DeepSeek, OpenAI, Claude) and their models dynamically.
- Update API Keys: Update existing provider API keys without service restart.
- Configure Auto-routing: If you've set up multiple models, ask OpenClaw to configure auto-routing rules. Requests will be intelligently routed based on your message content, using the most suitable model automatically.
All configuration changes are hot-loaded through Higress — no openclaw gateway restart required. Iterate on your model provider setup dynamically without service interruption!
Post-Deployment Management
Add/Update API Keys (Hot-reload)
./get-ai-gateway.sh config add --provider <provider> --key <api-key>
./get-ai-gateway.sh config list
./get-ai-gateway.sh config remove --provider <provider>Provider aliases: dashscope/qwen, moonshot/kimi, zhipuai/zhipu
Update z.ai Domain (Hot-reload)
If user wants to change the z.ai domain after deployment:
# Update domain configuration
./get-ai-gateway.sh config add --provider zhipuai --extra-config "zhipuDomain=api.z.ai"
# Or revert to China endpoint
./get-ai-gateway.sh config add --provider zhipuai --extra-config "zhipuDomain=open.bigmodel.cn"Add Routing Rules (for auto-routing)
# Add rule: route to specific model when message starts with trigger
./get-ai-gateway.sh route add --model <model> --trigger "keyword1|keyword2"
# Examples
./get-ai-gateway.sh route add --model glm-4-flash --trigger "quick|fast"
./get-ai-gateway.sh route add --model claude-opus-4 --trigger "think|complex"
./get-ai-gateway.sh route add --model deepseek-coder --trigger "code|debug"
# List/remove rules
./get-ai-gateway.sh route list
./get-ai-gateway.sh route remove --rule-id 0Stop/Delete Gateway
./get-ai-gateway.sh stop
./get-ai-gateway.sh deleteEndpoints
| Endpoint | URL |
|---|---|
| Chat Completions | http://localhost:8080/v1/chat/completions |
| Console | http://localhost:8001 |
| Logs | ./higress-install/logs/access.log |
Testing
# Test with specific model
curl 'http://localhost:8080/v1/chat/completions' \
-H 'Content-Type: application/json' \
-d '{"model": "<model-name>", "messages": [{"role": "user", "content": "Hello"}]}'
# Test auto-routing (if enabled)
curl 'http://localhost:8080/v1/chat/completions' \
-H 'Content-Type: application/json' \
-d '{"model": "higress/auto", "messages": [{"role": "user", "content": "What is AI?"}]}'Troubleshooting
| Issue | Solution |
|---|---|
| Container fails to start | Check docker logs higress-ai-gateway |
| Port already in use | Use --http-port, --console-port to change ports |
| API key error | Run ./get-ai-gateway.sh config list to verify keys |
| Auto-routing not working | Ensure --auto-routing was set during deployment |
| Slow image download | Script auto-selects nearest registry based on timezone |
Important Notes
1. Claude Code Mode: Requires OAuth token from claude setup-token command, not a regular API key 2. z.ai Code Plan Mode: Enabled by default, uses /api/coding/paas/v4/chat/completions endpoint, optimized for coding tasks 3. z.ai Domain Selection:
- China users:
open.bigmodel.cn(default) - International users:
api.z.ai(auto-detected based on timezone) - Users can update domain anytime after deployment
4. Auto-routing: Must be enabled during initial deployment (--auto-routing); routing rules can be added later 5. OpenClaw Integration: The openclaw models auth login and openclaw gateway restart commands are interactive and must be run by the user manually in their terminal 6. Hot-reload: API key changes take effect immediately; no container restart needed
Higress AI Gateway - Troubleshooting
Common issues and solutions for Higress AI Gateway deployment and operation.
Container Issues
Container fails to start
Check Docker is running:
docker infoCheck port availability:
netstat -tlnp | grep 8080View container logs:
docker logs higress-ai-gatewayGateway not responding
Check container status:
docker ps -aVerify port mapping:
docker port higress-ai-gatewayTest locally:
curl http://localhost:8080/v1/modelsFile System Issues
"too many open files" error from API server
Symptom:
panic: unable to create REST storage for a resource due to too many open files, will dieor
command failed err="failed to create shared file watcher: too many open files"Root Cause:
The system's fs.inotify.max_user_instances limit is too low. This commonly occurs on systems with many Docker containers, as each container can consume inotify instances.
Check current limit:
cat /proc/sys/fs/inotify/max_user_instancesDefault is often 128, which is insufficient when running multiple containers.
Solution:
Increase the inotify instance limit to 8192:
# Temporarily (until next reboot)
sudo sysctl -w fs.inotify.max_user_instances=8192
# Permanently (survives reboots)
echo "fs.inotify.max_user_instances = 8192" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pVerify:
cat /proc/sys/fs/inotify/max_user_instances
# Should output: 8192Restart the container:
docker restart higress-ai-gatewayAdditional inotify tunables (if still experiencing issues):
# Increase max watches per user
sudo sysctl -w fs.inotify.max_user_watches=524288
# Increase max queued events
sudo sysctl -w fs.inotify.max_queued_events=32768To make these permanent as well:
echo "fs.inotify.max_user_watches = 524288" | sudo tee -a /etc/sysctl.conf
echo "fs.inotify.max_queued_events = 32768" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pPlugin Issues
Plugin not recognized
Verify plugin installation:
For Clawdbot:
ls -la ~/.clawdbot/extensions/higress-ai-gatewayFor OpenClaw:
ls -la ~/.openclaw/extensions/higress-ai-gatewayCheck package.json:
Ensure package.json contains the correct extension field:
- Clawdbot:
"clawdbot.extensions" - OpenClaw:
"openclaw.extensions"
Restart the runtime:
# Restart Clawdbot gateway
clawdbot gateway restart
# Or OpenClaw gateway
openclaw gateway restartRouting Issues
Auto-routing not working
Confirm model is in list:
# Check if higress/auto is available
clawdbot models list | grep "higress/auto"Check routing rules exist:
./get-ai-gateway.sh route listVerify default model is configured:
./get-ai-gateway.sh config listCheck gateway logs:
docker logs higress-ai-gateway | grep -i routingView access logs:
tail -f ./higress/logs/access.logConfiguration Issues
Timezone detection fails
Manually check timezone:
timedatectl show --property=Timezone --valueOr check timezone file:
cat /etc/timezoneFallback behavior:
- If detection fails, defaults to Hangzhou mirror
- Manual override: Set
IMAGE_REPOenvironment variable
Manual repository selection:
# For China/Asia
IMAGE_REPO="higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/all-in-one"
# For Southeast Asia
IMAGE_REPO="higress-registry.ap-southeast-7.cr.aliyuncs.com/higress/all-in-one"
# For North America
IMAGE_REPO="higress-registry.us-west-1.cr.aliyuncs.com/higress/all-in-one"
# Use in deployment
IMAGE_REPO="$IMAGE_REPO" ./get-ai-gateway.sh start --non-interactive ...Performance Issues
Slow image downloads
Check selected repository:
echo $IMAGE_REPOManually select closest mirror:
See Configuration Issues → Timezone detection fails for manual repository selection.
High memory usage
Check container stats:
docker stats higress-ai-gatewayView resource limits:
docker inspect higress-ai-gateway | grep -A 10 "HostConfig"Set memory limits:
# Stop container
./get-ai-gateway.sh stop
# Manually restart with limits
docker run -d \
--name higress-ai-gateway \
--memory="4g" \
--memory-swap="4g" \
...Log Analysis
Access logs location
# Default location
./higress/logs/access.log
# View real-time logs
tail -f ./higress/logs/access.logContainer logs
# View all logs
docker logs higress-ai-gateway
# Follow logs
docker logs -f higress-ai-gateway
# Last 100 lines
docker logs --tail 100 higress-ai-gateway
# With timestamps
docker logs -t higress-ai-gatewayNetwork Issues
Cannot connect to gateway
Verify container is running:
docker ps | grep higress-ai-gatewayCheck port bindings:
docker port higress-ai-gatewayTest from inside container:
docker exec higress-ai-gateway curl localhost:8080/v1/modelsCheck firewall rules:
# Check if port is accessible
sudo ufw status | grep 8080
# Allow port (if needed)
sudo ufw allow 8080/tcpDNS resolution issues
Test from container:
docker exec higress-ai-gateway ping -c 3 api.openai.comCheck DNS settings:
docker exec higress-ai-gateway cat /etc/resolv.confGetting Help
If you're still experiencing issues:
1. Collect logs:
docker logs higress-ai-gateway > gateway.log 2>&1
cat ./higress/logs/access.log > access.log2. Check system info:
docker version
docker info
uname -a
cat /proc/sys/fs/inotify/max_user_instances3. Report issue:
- Repository: https://github.com/higress-group/higress-standalone
- Include: logs, system info, deployment command used
#!/bin/bash
# Detect if user is in China region based on timezone
# Returns: "china" or "international"
TIMEZONE=$(cat /etc/timezone 2>/dev/null || timedatectl show --property=Timezone --value 2>/dev/null || echo "Unknown")
# Check if timezone indicates China region (including Hong Kong)
if [[ "$TIMEZONE" == "Asia/Shanghai" ]] || \
[[ "$TIMEZONE" == "Asia/Hong_Kong" ]] || \
[[ "$TIMEZONE" == *"China"* ]] || \
[[ "$TIMEZONE" == *"Beijing"* ]]; then
echo "china"
else
echo "international"
fi
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
const DEFAULT_GATEWAY_URL = "http://localhost:8080";
const DEFAULT_CONSOLE_URL = "http://localhost:8001";
// Model-specific context window and max tokens configurations
const MODEL_CONFIG: Record<string, { contextWindow: number; maxTokens: number }> = {
"gpt-5.3-codex": { contextWindow: 400_000, maxTokens: 128_000 },
"gpt-5-mini": { contextWindow: 400_000, maxTokens: 128_000 },
"gpt-5-nano": { contextWindow: 400_000, maxTokens: 128_000 },
"claude-opus-4-6": { contextWindow: 1_000_000, maxTokens: 128_000 },
"claude-sonnet-4-6": { contextWindow: 1_000_000, maxTokens: 64_000 },
"claude-haiku-4-5": { contextWindow: 200_000, maxTokens: 64_000 },
"qwen3.5-plus": { contextWindow: 960_000, maxTokens: 64_000 },
"deepseek-chat": { contextWindow: 256_000, maxTokens: 128_000 },
"deepseek-reasoner": { contextWindow: 256_000, maxTokens: 128_000 },
"kimi-k2.5": { contextWindow: 256_000, maxTokens: 128_000 },
"glm-5": { contextWindow: 200_000, maxTokens: 128_000 },
"MiniMax-M2.5": { contextWindow: 200_000, maxTokens: 128_000 },
};
// Default values for unknown models
const DEFAULT_CONTEXT_WINDOW = 200_000;
const DEFAULT_MAX_TOKENS = 128_000;
// Common models that Higress AI Gateway typically supports
const DEFAULT_MODEL_IDS = [
// Auto-routing special model
"higress/auto",
// Commonly models
"kimi-k2.5",
"glm-5",
"MiniMax-M2.5",
"qwen3.5-plus",
// Anthropic models
"claude-opus-4-6",
"claude-sonnet-4-6",
"claude-haiku-4-5",
// OpenAI models
"gpt-5.3-codex",
"gpt-5-mini",
"gpt-5-nano",
// DeepSeek models
"deepseek-chat",
"deepseek-reasoner",
] as const;
function normalizeBaseUrl(value: string): string {
const trimmed = value.trim();
if (!trimmed) return DEFAULT_GATEWAY_URL;
let normalized = trimmed;
while (normalized.endsWith("/")) normalized = normalized.slice(0, -1);
if (!normalized.endsWith("/v1")) normalized = `${normalized}/v1`;
return normalized;
}
function validateUrl(value: string): string | undefined {
const normalized = normalizeBaseUrl(value);
try {
new URL(normalized);
} catch {
return "Enter a valid URL";
}
return undefined;
}
function parseModelIds(input: string): string[] {
const parsed = input
.split(/[\n,]/)
.map((model) => model.trim())
.filter(Boolean);
return Array.from(new Set(parsed));
}
function buildModelDefinition(modelId: string) {
const isAutoModel = modelId === "higress/auto";
const config = MODEL_CONFIG[modelId] || { contextWindow: DEFAULT_CONTEXT_WINDOW, maxTokens: DEFAULT_MAX_TOKENS };
return {
id: modelId,
name: isAutoModel ? "Higress Auto Router" : modelId,
api: "openai-completions",
reasoning: true,
input: ["text", "image"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: config.contextWindow,
maxTokens: config.maxTokens,
};
}
async function testGatewayConnection(gatewayUrl: string): Promise<boolean> {
try {
// gatewayUrl already ends with /v1 from normalizeBaseUrl()
// Use chat/completions endpoint with empty body to test connection
// Higress doesn't support /models endpoint
const response = await fetch(`${gatewayUrl}/chat/completions`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({}),
signal: AbortSignal.timeout(5000),
});
// Any response (including 400/401/422) means gateway is reachable
return true;
} catch {
return false;
}
}
async function fetchAvailableModels(consoleUrl: string): Promise<string[]> {
try {
// Try to get models from Higress Console API
const response = await fetch(`${consoleUrl}/v1/ai/routes`, {
method: "GET",
headers: { "Content-Type": "application/json" },
signal: AbortSignal.timeout(5000),
});
if (response.ok) {
const data = (await response.json()) as { data?: { model?: string }[] };
if (data.data && Array.isArray(data.data)) {
return data.data
.map((route: { model?: string }) => route.model)
.filter((m): m is string => typeof m === "string");
}
}
} catch {
// Ignore errors, use defaults
}
return [];
}
const higressPlugin = {
id: "higress",
name: "Higress AI Gateway",
description: "Model provider plugin for Higress AI Gateway with auto-routing support",
configSchema: emptyPluginConfigSchema(),
register(api) {
api.registerProvider({
id: "higress",
label: "Higress AI Gateway",
docsPath: "/providers/models",
aliases: ["higress-gateway", "higress-ai"],
auth: [
{
id: "api-key",
label: "API Key",
hint: "Configure Higress AI Gateway endpoint with optional API key",
kind: "custom",
run: async (ctx) => {
// Step 1: Get Gateway URL
const gatewayUrlInput = await ctx.prompter.text({
message: "Higress AI Gateway URL",
initialValue: DEFAULT_GATEWAY_URL,
validate: validateUrl,
});
const gatewayUrl = normalizeBaseUrl(gatewayUrlInput);
// Step 2: Get Console URL (for auto-router configuration)
const consoleUrlInput = await ctx.prompter.text({
message: "Higress Console URL (for auto-router config)",
initialValue: DEFAULT_CONSOLE_URL,
validate: validateUrl,
});
const consoleUrl = normalizeBaseUrl(consoleUrlInput);
// Step 3: Test connection (create a new spinner)
const spin = ctx.prompter.progress("Testing gateway connection…");
const isConnected = await testGatewayConnection(gatewayUrl);
if (!isConnected) {
spin.stop("Gateway connection failed");
await ctx.prompter.note(
[
"Could not connect to Higress AI Gateway.",
"Make sure the gateway is running and the URL is correct.",
].join("\n"),
"Connection Warning",
);
} else {
spin.stop("Gateway connected");
}
// Step 4: Get API Key (optional for local gateway)
const apiKeyInput = await ctx.prompter.text({
message: "API Key (leave empty if not required)",
initialValue: "",
}) || '';
const apiKey = apiKeyInput.trim() || "higress-local";
// Step 5: Fetch available models (create a new spinner)
const spin2 = ctx.prompter.progress("Fetching available models…");
const fetchedModels = await fetchAvailableModels(consoleUrl);
const defaultModels = fetchedModels.length > 0
? ["higress/auto", ...fetchedModels]
: DEFAULT_MODEL_IDS;
spin2.stop();
// Step 6: Let user customize model list
const modelInput = await ctx.prompter.text({
message: "Model IDs (comma-separated, higress/auto enables auto-routing)",
initialValue: defaultModels.slice(0, 10).join(", "),
validate: (value) =>
parseModelIds(value).length > 0 ? undefined : "Enter at least one model id",
});
const modelIds = parseModelIds(modelInput);
const hasAutoModel = modelIds.includes("higress/auto");
// Always add higress/ provider prefix to create model reference
const defaultModelId = hasAutoModel
? "higress/auto"
: (modelIds[0] ?? "glm-5");
const defaultModelRef = `higress/${defaultModelId}`;
// Step 7: Configure default model for auto-routing
let autoRoutingDefaultModel = "glm-5";
if (hasAutoModel) {
const autoRoutingModelInput = await ctx.prompter.text({
message: "Default model for auto-routing (when no rule matches)",
initialValue: "glm-5",
});
autoRoutingDefaultModel = autoRoutingModelInput.trim(); // FIX: Add trim() here
}
return {
profiles: [
{
profileId: `higress:${apiKey === "higress-local" ? "local" : "default"}`,
credential: {
type: "token",
provider: "higress",
token: apiKey,
},
},
],
configPatch: {
models: {
providers: {
higress: {
// gatewayUrl already ends with /v1 from normalizeBaseUrl()
baseUrl: gatewayUrl,
apiKey: apiKey,
api: "openai-completions",
authHeader: apiKey !== "higress-local",
models: modelIds.map((modelId) => buildModelDefinition(modelId)),
},
},
},
agents: {
defaults: {
models: Object.fromEntries(
modelIds.map((modelId) => {
// Always add higress/ provider prefix to create model reference
const modelRef = `higress/${modelId}`;
return [modelRef, {}];
}),
),
},
},
plugins: {
entries: {
"higress": {
enabled: true,
config: {
gatewayUrl,
consoleUrl,
autoRoutingDefaultModel,
},
},
},
},
},
defaultModel: defaultModelRef,
notes: [
"Higress AI Gateway is now configured as a model provider.",
hasAutoModel
? `Auto-routing enabled: use model "higress/auto" to route based on message content.`
: "Add 'higress/auto' to models to enable auto-routing.",
// gatewayUrl already ends with /v1 from normalizeBaseUrl()
`Gateway endpoint: ${gatewayUrl}/chat/completions`,
`Console: ${consoleUrl}`,
"",
"💡 Future Configuration Updates (No Restart Needed):",
" • Add New Providers: Add LLM providers (DeepSeek, OpenAI, Claude, etc.) dynamically.",
" • Update API Keys: Update existing provider keys without restart.",
" • Configure Auto-Routing: Ask OpenClaw to set up intelligent routing rules.",
" All changes hot-load via Higress — no gateway restart required!",
"",
"🎯 Recommended Skills (install via OpenClaw conversation):",
"",
"1. Auto-Routing Skill:",
" Configure automatic model routing based on message content",
" https://github.com/alibaba/higress/tree/main/.claude/skills/higress-auto-router",
' Say: "Install higress-auto-router skill"',
],
};
},
},
],
});
},
};
export default higressPlugin;
{
"id": "higress",
"name": "Higress AI Gateway",
"description": "Model provider plugin for Higress AI Gateway with auto-routing support",
"providers": ["higress"],
"configSchema": {
"type": "object",
"additionalProperties": true
}
}
{
"name": "@higress/higress",
"version": "1.0.0",
"description": "Higress AI Gateway model provider plugin for OpenClaw with auto-routing support",
"main": "index.ts",
"openclaw": {
"extensions": ["./index.ts"]
},
"keywords": [
"openclaw",
"higress",
"ai-gateway",
"model-router",
"auto-routing"
],
"author": "Higress Team",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/alibaba/higress"
}
}
Higress AI Gateway Plugin
OpenClaw model provider plugin for Higress AI Gateway with auto-routing support.
What is this?
This is a TypeScript-based provider plugin that enables OpenClaw to use Higress AI Gateway as a model provider. It provides:
- Auto-routing support: Use
higress/autoto intelligently route requests based on message content - Dynamic model discovery: Auto-detect available models from Higress Console
- Smart URL handling: Automatic URL normalization and validation
- Flexible authentication: Support for both local and remote gateway deployments
Files
- index.ts: Main plugin implementation
- package.json: NPM package metadata and OpenClaw extension declaration
- openclaw.plugin.json: Plugin manifest for OpenClaw
Installation
This plugin is automatically installed when you use the higress-openclaw-integration skill. See parent SKILL.md for complete installation instructions.
Manual Installation
If you need to install manually:
# Copy plugin files
mkdir -p "$HOME/.openclaw/extensions/higress"
cp -r ./* "$HOME/.openclaw/extensions/higress/"
# Configure provider
openclaw plugins enable higress
openclaw models auth login --provider higressUsage
After installation, configure Higress as a model provider:
openclaw models auth login --provider higressThe plugin will prompt for: 1. Gateway URL (default: http://localhost:8080) 2. Console URL (default: http://localhost:8001) 3. API Key (optional for local deployments) 4. Model list (auto-detected or manually specified) 5. Auto-routing default model (if using higress/auto)
Related Resources
- Parent Skill: higress-openclaw-integration
- Auto-routing Configuration: higress-auto-router
License
Apache-2.0