Skip to content

Instantly share code, notes, and snippets.

@mohemohe
Created October 12, 2025 02:55
Show Gist options
  • Select an option

  • Save mohemohe/d116737dcebb8f203660210671a17f2b to your computer and use it in GitHub Desktop.

Select an option

Save mohemohe/d116737dcebb8f203660210671a17f2b to your computer and use it in GitHub Desktop.
z.aiが /v1/models 相当のエンドポイントを用意してなくてクライアントによっては死ぬので擬似る
proxy.zai.mohemohe.jp {
route {
handle /v1/* {
uri replace /v1/ /api/coding/paas/v4/
}
handle /api/coding/paas/v4/models {
header Content-Type application/json
respond `{ "object": "list", "data": [
{ "id": "glm-4.6", "object": "model", "created": 0, "owned_by": "zai" },
{ "id": "glm-4.5", "object": "model", "created": 0, "owned_by": "zai" },
{ "id": "glm-4.5-air", "object": "model", "created": 0, "owned_by": "zai" },
{ "id": "glm-4.5v", "object": "model", "created": 0, "owned_by": "zai" }
]}`
}
handle /api/coding/paas/v4/* {
reverse_proxy https://api.z.ai {
header_up Host api.z.ai
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment