Skip to content

Add Z.AI Coding Plan usage provider with OpenCode key discovery - #28

Merged
TopiCsarno merged 2 commits into
TopiCsarno:mainfrom
Phototonic:feat/zai-coding-plan
Sep 13, 2026
Merged

TopiCsarno merged 2 commits into
TopiCsarno:mainfrom
Phototonic:feat/zai-coding-plan

Conversation

@Phototonic

Copy link
Copy Markdown

Summary

  • Add a managed Z.AI Coding Plan provider with manual API-key setup and one-time OpenCode prefill (zai-coding-plan, then zai).
  • Store accepted keys only in YapCap-managed account storage; detect usable OpenCode API entries without retaining credential data.
  • Fetch fixed-origin quota data with bounded Bearer-to-raw authorization compatibility retry, redirect blocking, conservative error handling, and deterministic 5 Hour / Weekly / MCP display.
  • Add account lifecycle, localization, provider assets, synthetic demo data, sanitized fixtures, specification, and README coverage.

Validation

  • cargo fmt --all
  • just check
  • cargo test --all (772 passed)
  • cargo fmt --all -- --check
  • git diff --check
  • Targeted security/lifecycle review
  • Manual local validation: OpenCode prefill created a Z.AI account and live 5-hour/weekly quotas matched the expected amounts.

Scope

  • Supports global personal Coding Plan accounts only; regional/team/promotional balances, OAuth, OpenCode writes, and alternate endpoints are intentionally excluded.

@TopiCsarno
TopiCsarno merged commit e3acf25 into TopiCsarno:main Sep 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants