[providers.zai]
display_name = "Z.ai"
adapter = "openai_compatible"
api_key_url = "https://open.bigmodel.cn/usercenter/apikeys"
base_url = "https://api.z.ai/api/coding/paas/v4"
priority = 60

[providers.zai.auth]
credentials = ["env:ZAI_API_KEY", "vault:ZAI_API_KEY"]

[providers.zai.models."glm-5.2"]
display_name = "GLM 5.2"
family = "glm-5"
default = true
aliases = ["glm", "glm5", "glm52", "glm5.2"]

[providers.zai.models."glm-5.2".limits]
context_window = 1048576
max_output = 131072

[providers.zai.models."glm-5.2".features]
tools = true
vision = false
reasoning = true
reasoning_effort = "levels"
prompt_cache = true

[providers.zai.models."glm-5.2".controls]
reasoning_effort = ["high", "max"]

[providers.zai.models."glm-5.2".costs]
input_cost_per_mtok = 1.4
output_cost_per_mtok = 4.4
cache_input_cost_per_mtok = 0.26

[providers.zai.models."glm-4.7"]
display_name = "GLM 4.7"
family = "glm-4"
estimated_output_tps = 100
aliases = ["glm4"]

[providers.zai.models."glm-4.7".limits]
context_window = 202752
max_output = 16384

[providers.zai.models."glm-4.7".features]
tools = true
vision = false
reasoning = false

[providers.zai.models."glm-4.7".costs]
input_cost_per_mtok = 0.6
output_cost_per_mtok = 2.2
