Spaces:
Paused
Paused
fix: switch Zhipu provider to Anthropic-compatible endpoint
Browse filesThe OpenAI-compatible endpoint (paas/v4) returns "insufficient balance"
but the Anthropic-compatible endpoint (open.bigmodel.cn/api/anthropic)
works. Updated api type to "anthropic-messages" and new API key set.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- config_for_dataset.json +2 -2
- scripts/openclaw.json.default +2 -2
- scripts/sync_hf.py +3 -4
config_for_dataset.json
CHANGED
|
@@ -16,9 +16,9 @@
|
|
| 16 |
"mode": "merge",
|
| 17 |
"providers": {
|
| 18 |
"zhipu": {
|
| 19 |
-
"baseUrl": "https://open.bigmodel.cn/api/
|
| 20 |
"apiKey": "<ENV_VAR>",
|
| 21 |
-
"api": "
|
| 22 |
"models": [
|
| 23 |
{ "id": "glm-4.5-air", "name": "GLM-4.5 Air" },
|
| 24 |
{ "id": "glm-4.5", "name": "GLM-4.5" },
|
|
|
|
| 16 |
"mode": "merge",
|
| 17 |
"providers": {
|
| 18 |
"zhipu": {
|
| 19 |
+
"baseUrl": "https://open.bigmodel.cn/api/anthropic",
|
| 20 |
"apiKey": "<ENV_VAR>",
|
| 21 |
+
"api": "anthropic-messages",
|
| 22 |
"models": [
|
| 23 |
{ "id": "glm-4.5-air", "name": "GLM-4.5 Air" },
|
| 24 |
{ "id": "glm-4.5", "name": "GLM-4.5" },
|
scripts/openclaw.json.default
CHANGED
|
@@ -16,9 +16,9 @@
|
|
| 16 |
"mode": "merge",
|
| 17 |
"providers": {
|
| 18 |
"zhipu": {
|
| 19 |
-
"baseUrl": "https://open.bigmodel.cn/api/
|
| 20 |
"apiKey": "${ZHIPU_API_KEY}",
|
| 21 |
-
"api": "
|
| 22 |
"models": [
|
| 23 |
{
|
| 24 |
"id": "glm-4.5-air",
|
|
|
|
| 16 |
"mode": "merge",
|
| 17 |
"providers": {
|
| 18 |
"zhipu": {
|
| 19 |
+
"baseUrl": "https://open.bigmodel.cn/api/anthropic",
|
| 20 |
"apiKey": "${ZHIPU_API_KEY}",
|
| 21 |
+
"api": "anthropic-messages",
|
| 22 |
"models": [
|
| 23 |
{
|
| 24 |
"id": "glm-4.5-air",
|
scripts/sync_hf.py
CHANGED
|
@@ -65,7 +65,7 @@ OPENAI_BASE_URL = os.environ.get("OPENAI_BASE_URL", "https://api.openai.com/v1")
|
|
| 65 |
# OpenRouter API key (optional; alternative to OPENAI_API_KEY + OPENAI_BASE_URL)
|
| 66 |
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "")
|
| 67 |
|
| 68 |
-
# Zhipu AI (z.ai) API key (optional; GLM-4 series,
|
| 69 |
ZHIPU_API_KEY = os.environ.get("ZHIPU_API_KEY", "")
|
| 70 |
|
| 71 |
# Gateway token (default: huggingclaw; override via GATEWAY_TOKEN env var)
|
|
@@ -474,15 +474,14 @@ class OpenClawFullSync:
|
|
| 474 |
print("[SYNC] Set OpenRouter provider")
|
| 475 |
if ZHIPU_API_KEY:
|
| 476 |
providers["zhipu"] = {
|
| 477 |
-
"baseUrl": "https://open.bigmodel.cn/api/
|
| 478 |
"apiKey": ZHIPU_API_KEY,
|
| 479 |
-
"api": "
|
| 480 |
"models": [
|
| 481 |
{"id": "glm-4.5-air", "name": "GLM-4.5 Air"},
|
| 482 |
{"id": "glm-4.5", "name": "GLM-4.5"},
|
| 483 |
{"id": "glm-4.6", "name": "GLM-4.6"},
|
| 484 |
{"id": "glm-4.7", "name": "GLM-4.7"},
|
| 485 |
-
{"id": "glm-5", "name": "GLM-5"},
|
| 486 |
]
|
| 487 |
}
|
| 488 |
print("[SYNC] Set Zhipu AI provider")
|
|
|
|
| 65 |
# OpenRouter API key (optional; alternative to OPENAI_API_KEY + OPENAI_BASE_URL)
|
| 66 |
OPENROUTER_API_KEY = os.environ.get("OPENROUTER_API_KEY", "")
|
| 67 |
|
| 68 |
+
# Zhipu AI (z.ai) API key (optional; GLM-4 series, Anthropic-compatible endpoint)
|
| 69 |
ZHIPU_API_KEY = os.environ.get("ZHIPU_API_KEY", "")
|
| 70 |
|
| 71 |
# Gateway token (default: huggingclaw; override via GATEWAY_TOKEN env var)
|
|
|
|
| 474 |
print("[SYNC] Set OpenRouter provider")
|
| 475 |
if ZHIPU_API_KEY:
|
| 476 |
providers["zhipu"] = {
|
| 477 |
+
"baseUrl": "https://open.bigmodel.cn/api/anthropic",
|
| 478 |
"apiKey": ZHIPU_API_KEY,
|
| 479 |
+
"api": "anthropic-messages",
|
| 480 |
"models": [
|
| 481 |
{"id": "glm-4.5-air", "name": "GLM-4.5 Air"},
|
| 482 |
{"id": "glm-4.5", "name": "GLM-4.5"},
|
| 483 |
{"id": "glm-4.6", "name": "GLM-4.6"},
|
| 484 |
{"id": "glm-4.7", "name": "GLM-4.7"},
|
|
|
|
| 485 |
]
|
| 486 |
}
|
| 487 |
print("[SYNC] Set Zhipu AI provider")
|