← all repositories
Sliverkiss/workbuddy2api

OpenAI proxy for Tencent CodeBuddy: account rotation and cat travel

It turns Tencent CodeBuddy into a load-balanced, OpenAI-compatible API so your existing tools can talk to it without waiting for an official endpoint.

workbuddy2api
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does WorkBuddy2API is a self-hosted reverse proxy written in Go that sits between your OpenAI-compatible clients and Tencent’s CodeBuddy (copilot.tencent.com). It handles OAuth login, refreshes tokens, and routes chat requests across a pool of your own accounts while rewriting payloads to match CodeBuddy’s expectations. The gateway also runs scheduled housekeeping—sign-ins, activity reports, token keepalive, and a whimsical “cat travel” mini-game state machine—to keep accounts in good standing without manual intervention.

The interesting bit The real depth is in the traffic governance: a three-factor weighted random selector picks from the top five candidates, with anti-thundering-herd logic, per-account circuit breakers, exponential cooldowns for rate limits, and session stickiness that rebinds if a model hits a quota wall. It even tracks per-account, per-model costs to prioritize free or cheap credits. This is unusually thorough engineering for what is essentially a compatibility shim.

Key highlights

  • OpenAI-compatible /v1/chat/completions endpoint with SSE streaming and non-stream aggregation
  • Multi-account pool with weighted random rotation, circuit breakers, and exponential cooldowns (429 soft cooldown up to 2h, 402 hard cooldown until 04:00)
  • Session stickiness with TTL-based rebinding and optional Upstash Redis mirroring to survive restarts
  • Cost-aware routing that prioritizes accounts with free or cheaper credits for the requested model
  • DeepSeek reasoning chain compatibility, including reasoning_content backfill and effort-level auto-downgrade

Caveats

  • This is an unofficial gateway; the README explicitly warns it is for self-authorized accounts and private testing only.
  • The OAuth device flow in login.sh does not use PKCE; it relies on a server-issued state parameter instead.
  • Configuration is dense, with dozens of knobs for timeouts, cooldowns, weights, and schedules.

Verdict Ideal if you have multiple Tencent CodeBuddy accounts and want to treat them as a single OpenAI-compatible endpoint for personal automation. Skip it if you need an officially supported, managed API or lack the patience to tune a kitchen-sink config.

Frequently asked

What is Sliverkiss/workbuddy2api?
It turns Tencent CodeBuddy into a load-balanced, OpenAI-compatible API so your existing tools can talk to it without waiting for an official endpoint.
Is workbuddy2api open source?
Yes — Sliverkiss/workbuddy2api is open source, released under the MIT license.
What language is workbuddy2api written in?
Sliverkiss/workbuddy2api is primarily written in Go.
How popular is workbuddy2api?
Sliverkiss/workbuddy2api has 658 stars on GitHub.
Where can I find workbuddy2api?
Sliverkiss/workbuddy2api is on GitHub at https://github.com/Sliverkiss/workbuddy2api.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.