-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add general API endpoints for Z.ai provider #9894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add international_api and china_api options to zaiApiLineSchema - Add corresponding endpoint configurations to zaiApiLineConfigs - Update display names to distinguish between Coding and API endpoints - Add comprehensive tests for new API endpoints Fixes #9879
Review completed. Found 1 issue that needs attention:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| }, | ||
| china_api: { | ||
| name: "China API", | ||
| baseUrl: "https://open.bigmodel.cn/api/paas/v4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The China API endpoint uses paas in the URL path, but the original issue #9879 specifies pass (without the second 'a'). The issue states the endpoint should be https://open.bigmodel.cn/api/pass/v4. This discrepancy could cause the endpoint to fail if pass is the correct path. Please verify the correct URL with Z.ai's API documentation.
Fix it with Roo Code or mention @roomote and request a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct endpoint uses paas
|
Ye that's correct a typo in original issue. Fixed. Should be paas |
|
@hannesrudolph @richtong looks like we removed the other two endpoints here, but I can't remember why: #8693. @richtong just to confirm - you have an API key that works with the regular endpoint and not the coding endpoint? |
They told us to as they would manage the switching at their end |
|
Hmm well they haven't yet and their documentation says to use the two.
We have a full API account so want to use that one. See https://docs.z.ai/guides/develop/http/introduction
We confirmed this is true if you present an API key for an account only with API billing you get a "rate limited error" when presenting to the "coding" endpoint.
—-
API Basic Information
General API Endpoint
https://api.z.ai/api/paas/v4/
Note: When using the GLM Coding Plan, you need to configure the dedicated
Coding endpoint - https://api.z.ai/api/coding/paas/v4
instead of the general endpoint - https://api.z.ai/api/paas/v4
Note: The Coding API endpoint is only for Coding scenarios and is not applicable to general API scenarios. Please use them accordingly.
—-
Sent via Superhuman ( ***@***.*** )
…On Sat, Dec 6, 2025 at 21:05, Hannes Rudolph < ***@***.*** > wrote:
*hannesrudolph* left a comment (RooCodeInc/Roo-Code#9894) (
#9894 (comment) )
>
>
> @hannesrudolph ( https://github.com/hannesrudolph ) @richtong (
> https://github.com/richtong ) looks like we removed the other two endpoints
> here, but I can't remember why: #8693 (
> #8693 ).
>
>
>
> @richtong ( https://github.com/richtong ) just to confirm - you have an API
> key that works with the regular endpoint and not the coding endpoint?
>
>
They told us to as they would manage the switching at their end
—
Reply to this email directly, view it on GitHub (
#9894 (comment) )
, or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AANTCRZTRLHYJAI7QZIMW2D4AOYTHAVCNFSM6AAAAACOIFUIPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRRGYYTIMBWHA
).
You are receiving this because you were mentioned. Message ID: <RooCodeInc/Roo-Code/pull/9894/c3621614068
@ github. com>
|
|
You could also just slow a typing in of an endpoint if you like :-)
Sent via Superhuman ( ***@***.*** )
…On Sun, Dec 7, 2025 at 10:02, Rich Tong < ***@***.*** > wrote:
Hmm well they haven't yet and their documentation says to use the two.
We have a full API account so want to use that one. See
https://docs.z.ai/guides/develop/http/introduction
We confirmed this is true if you present an API key for an account only
with API billing you get a "rate limited error" when presenting to the
"coding" endpoint.
—-
API Basic Information
General API Endpoint
https://api.z.ai/api/paas/v4/
Note: When using the GLM Coding Plan, you need to configure the dedicated
Coding endpoint - https://api.z.ai/api/coding/paas/v4
instead of the general endpoint - https://api.z.ai/api/paas/v4
Note: The Coding API endpoint is only for Coding scenarios and is not
applicable to general API scenarios. Please use them accordingly.
—-
Sent via Superhuman ( ***@***.*** )
On Sat, Dec 6, 2025 at 21:05, Hannes Rudolph < ***@***.*** >
wrote:
> *hannesrudolph* left a comment (RooCodeInc/Roo-Code#9894) (
> #9894 (comment) )
>
>
>>
>>
>> @hannesrudolph ( https://github.com/hannesrudolph ) @richtong (
>> https://github.com/richtong ) looks like we removed the other two endpoints
>> here, but I can't remember why: #8693 (
>> #8693 ).
>>
>>
>>
>> @richtong ( https://github.com/richtong ) just to confirm - you have an API
>> key that works with the regular endpoint and not the coding endpoint?
>>
>>
>
>
>
> They told us to as they would manage the switching at their end
>
>
>
> —
> Reply to this email directly, view it on GitHub (
> #9894 (comment) )
> , or unsubscribe (
> https://github.com/notifications/unsubscribe-auth/AANTCRZTRLHYJAI7QZIMW2D4AOYTHAVCNFSM6AAAAACOIFUIPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRRGYYTIMBWHA
> ).
> You are receiving this because you were mentioned. Message ID: <RooCodeInc/Roo-Code/pull/9894/c3621614068
> @ github. com>
>
>
>
|
This PR attempts to address Issue #9879. Feedback and guidance are welcome.
Problem
The Z.ai provider currently only shows coding plan endpoints but not the regular API endpoints. Users who are using API billing need access to the standard API endpoints.
Solution
Added two new API line options to support regular API billing:
international_api: https://api.z.ai/api/paas/v4china_api: https://open.bigmodel.cn/api/paas/v4Changes
zaiApiLineSchemainpackages/types/src/provider-settings.tszaiApiLineConfigsinpackages/types/src/providers/zai.tssrc/api/providers/__tests__/zai.spec.tsTesting
international_apiandchina_apiendpointsFixes #9879