Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 6, 2025

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:

Changes

  • Added new API line options to zaiApiLineSchema in packages/types/src/provider-settings.ts
  • Added corresponding endpoint configurations to zaiApiLineConfigs in packages/types/src/providers/zai.ts
  • Updated display names to distinguish between "Coding" and "API" endpoints for clarity
  • Added comprehensive tests for the new API endpoints in src/api/providers/__tests__/zai.spec.ts

Testing

  • All existing tests pass
  • Added new test cases for both international_api and china_api endpoints
  • Verified correct base URLs are used for each endpoint
  • Confirmed proper model selection based on region

Fixes #9879

- 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
@roomote
Copy link
Contributor Author

roomote bot commented Dec 6, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 issue that needs attention:

  • Verify China API endpoint URL - the issue specifies pass but implementation uses paas

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",
Copy link
Contributor Author

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.

Copy link

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 6, 2025
@richtong
Copy link

richtong commented Dec 7, 2025

Ye that's correct a typo in original issue. Fixed. Should be paas

@mrubens
Copy link
Collaborator

mrubens commented Dec 7, 2025

@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?

@hannesrudolph
Copy link
Collaborator

@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

@richtong
Copy link

richtong commented Dec 7, 2025 via email

@richtong
Copy link

richtong commented Dec 7, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Z.ai Provider does not show general API endpoint (only has coding plan endpoints)

5 participants