zai-org / zai-org/feedback

[建议 / Feature] 支持第三方模型 Provider 的 OAuth 登录(如 OpenAI「Sign in with ChatGPT」/ Codex 订阅)/ OAuth sign-in for third-party model providers

Open
#279 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复提议 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

账号 / 登录 · Account / Login

涉及的 Agent 框架 · Agent framework

Codex

使用场景 · Use case

中文: 我订阅了 ChatGPT(Plus/Pro),日常使用 Codex 模型写代码。在 ZCode 中,第三方自定义 Provider 只支持「API Key + baseURL」(anthropic / openai-compatible 两种 kind)。想在 ZCode 里用 GPT 系模型,就必须另外购买按 token 计费的 OpenAI API key,我的 ChatGPT 订阅完全用不上。目前唯一能利用订阅的方式是把 codex mcp-server 挂成 MCP 服务器、通过 MCP 工具委派任务——模型不会出现在模型选择器里,交互隔了一层,体验不理想。

English: I have a ChatGPT Plus/Pro subscription and use Codex models daily. In ZCode, third-party custom providers only support API key + baseURL (kinds: anthropic / openai-compatible). To use GPT-family models in ZCode I must buy a separate per-token OpenAI API key — my ChatGPT subscription can't be used at all. The only way to leverage the subscription today is wiring codex mcp-server as an MCP server and delegating via MCP tools: the model never shows up in the model picker and the interaction is indirect.

建议方案 · Proposal

中文: 为第三方模型 Provider 增加 OAuth 登录能力,优先支持 OpenAI 的「Sign in with ChatGPT」(用 ChatGPT Plus/Pro 订阅授权,免 API key,解锁 gpt-5.x-codex 系列模型)。可参考 opencode 的实现:/connect → OpenAI → 「ChatGPT Plus/Pro」浏览器 OAuth 流程(文档:https://opencode.ai/docs/providers/ )。ZCode 已经具备 OAuth 基础设施(Z.ai / BigModel 登录在用,credentials 中已有 oauth:* 机制),建议将这套机制扩展到第三方 Provider。

English: Add OAuth sign-in for third-party model providers, starting with OpenAI "Sign in with ChatGPT" (ChatGPT Plus/Pro subscription authorization, no API key, unlocking the gpt-5.x-codex model family). Reference implementation: opencode's /connect → OpenAI → "ChatGPT Plus/Pro" browser OAuth flow (docs: https://opencode.ai/docs/providers/ ). ZCode already has OAuth infrastructure (used for Z.ai / BigModel logins, with an oauth:* mechanism in credentials) — extending it to third-party providers would be a natural evolution.

预期价值 · Expected value

中文: ChatGPT 订阅用户可以在 ZCode 模型选择器中直接使用 Codex 模型,无需另购按 token 计费的 API key(避免双重付费);与 opencode 形成功能对齐,降低用户迁移门槛。

English: ChatGPT subscribers could use Codex models natively in ZCode's model picker without buying a per-token API key (no double billing); feature parity with opencode lowers the switching barrier for their users.

你认为的优先级 · Your perceived priority

高 · High

你使用的 ZCode 版本 / 环境 · ZCode version / environment

Desktop v3.7.7 · Linux (Fedora 44, x64)

补充材料 · Additional context
  • opencode 的同类功能现状:OpenAI 支持 OAuth 登录;但 Anthropic 禁止第三方客户端使用订阅登录,opencode 已在 1.3.0 移除 Claude Pro/Max 登录——说明每个 Provider 的条款需要逐一确认;OpenAI 目前允许第三方客户端使用该流程。
  • 相关 issue:#233(OpenAI API 参数兼容性),说明已有用户通过 API key 方式接入 OpenAI。
  • OpenAI Codex MCP Server 文档(当前的 workaround 方案):https://developers.openai.com/codex/mcp

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing CONTRIBUTING.md and the existing Z.ai/BigModel OAuth infrastructure, especially the credentials oauth:* mechanism. Compare it with the referenced opencode OpenAI flow; done means third-party provider OAuth can be completed and the authorized models appear in ZCode’s model picker.

Written by the indexing model from the issue text.

Assessment

Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.