fix: correct API endpoints for z.ai, opencode, and glm providers (#167)

Fixes #167

- z.ai: https://api.z.aihttps://api.z.ai/api/paas/v4
- opencode: https://api.opencode.aihttps://opencode.ai/zen/v1  
- glm: https://open.bigmodel.cn/api/paashttps://open.bigmodel.cn/api/paas/v4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Argenis 2026-02-15 11:22:03 -05:00 committed by GitHub
parent b8c6937fbc
commit 716fb382ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 3 deletions

View file

@ -524,4 +524,38 @@ mod tests {
let p = make_provider("test", "https://api.example.com/v1", None);
assert_eq!(p.chat_completions_url(), "https://api.example.com/v1/chat/completions");
}
// ══════════════════════════════════════════════════════════
// Provider-specific endpoint tests (Issue #167)
// ══════════════════════════════════════════════════════════
#[test]
fn chat_completions_url_zai() {
// Z.AI uses /api/paas/v4 base path
let p = make_provider("zai", "https://api.z.ai/api/paas/v4", None);
assert_eq!(
p.chat_completions_url(),
"https://api.z.ai/api/paas/v4/chat/completions"
);
}
#[test]
fn chat_completions_url_glm() {
// GLM (BigModel) uses /api/paas/v4 base path
let p = make_provider("glm", "https://open.bigmodel.cn/api/paas/v4", None);
assert_eq!(
p.chat_completions_url(),
"https://open.bigmodel.cn/api/paas/v4/chat/completions"
);
}
#[test]
fn chat_completions_url_opencode() {
// OpenCode Zen uses /zen/v1 base path
let p = make_provider("opencode", "https://opencode.ai/zen/v1", None);
assert_eq!(
p.chat_completions_url(),
"https://opencode.ai/zen/v1/chat/completions"
);
}
}