by jilin0105
把 WorkBuddy/CodeBuddy 额度封装为本地 OpenAI/Anthropic 兼容 API 的 Android 原生实现 · 无需 Python/Docker,装到手机即用 · Kotlin + 原生 HTTP 服务 + SQLite
# Add to your Claude Code skills
git clone https://github.com/jilin0105/WorkBuddy2API-AndroidGuides for using api integration skills like WorkBuddy2API-Android.
See how WorkBuddy2API-Android compares with popular alternatives.
WorkBuddy2API-Android is an open-source api integration skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by jilin0105. 把 WorkBuddy/CodeBuddy 额度封装为本地 OpenAI/Anthropic 兼容 API 的 Android 原生实现 · 无需 Python/Docker,装到手机即用 · Kotlin + 原生 HTTP 服务 + SQLite. It has 50 GitHub stars.
WorkBuddy2API-Android's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/jilin0105/WorkBuddy2API-Android" and add it to your Claude Code skills directory (see the Installation section above).
WorkBuddy2API-Android is primarily written in Kotlin. It is open-source under jilin0105 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other API Integration skills you can browse and compare side by side. Open the API Integration category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh WorkBuddy2API-Android against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
See comparison
把腾讯 WorkBuddy / CodeBuddy 的积分额度,变成手机本地一个标准的 OpenAI / Anthropic 兼容 API。 纯原生 Android 实现(Kotlin),无需 Python、无需 Docker、无需电脑——装到手机上就能跑。
每次推送到 main 都会自动构建 APK,滚动更新到同一个 Release:
一个跑在 Android 手机上的本地 API 网关。启动后,你的电脑、平板或其它 App 可以通过局域网连到手机上的 API 端口, 用标准 OpenAI / Anthropic 协议直接调用 WorkBuddy 的模型额度。
你的电脑 / Claude Code / Cherry Studio / Codex CLI
│ http://<手机IP>:8788/v1/...
▼
┌─────────────────────────────────┐
│ 手机 (WorkBuddy2API Native) │
│ 原生 HTTP 服务 (ServerSocket) │
│ ├─ 协议适配 → 统一转为上游格式 │
│ ├─ 多账号轮换 / 冷却 / 限速 │
│ └─ SQLite 记录用量 │
└─────────────────────────────────┘
│ https://copilot.tencent.com
▼
WorkBuddy 上游
/v1/chat/completions)、Anthropic Messages (/v1/messages)、OpenAI Responses (/v1/responses),均为流式 + 非流式reasoning_content 多轮回填与 developer 角色归一# 需要 JDK 17+ 与 Android SDK (compileSdk 36)
echo "sdk.dir=/你的/Android/SDK路径" > local.properties
./gradlew assembleDebug
产物:app/build/outputs/apk/debug/app-debug.apk
安装后在应用内点击「启动服务」。
在「账号」页通过扫码登录或上传 auth 文件添加 WorkBuddy / CodeBuddy 账号。
在「应用」页创建一个 API Key(形如 sk-...),用于访问 /v1/* 接口。
# 假设手机 IP 是 192.168.1.100
curl http://192.168.1.100:8788/v1/chat/completions \
-H "Authorization: Bearer sk-你的Key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [{"role": "user", "content": "你好"}],
"stream": true
}'
在 Claude Code / Cherry Studio 等客户端里,把 Base URL 填成 http://<手机IP>:8788/v1 即可。
在应用「设置」页可调整:
| 配置 | 默认 | 说明 |
|---|---|---|
| 端口 | 8788 |
本地 API 监听端口 |
| 使用记录保留天数 | 30 |
超期记录每日自动清理,控制数据体积 |
| 额度刷新间隔 | 30 分钟 |
账号余额刷新频率 |
| 模型缓存时长 | 60 分钟 |
模型列表缓存 TTL |
| 每日签到时刻 | 9,21 |
自动签到时间点 |
| 保活开关 | 开 | 前台服务保活 |
| 层 | 技术 |
|---|---|
| 语言 | Kotlin |
| UI | 原生 View(无 Compose / 无 WebView 界面) |
| HTTP 服务 | java.net.ServerSocket 手写实现 |
| HTTP 客户端 | OkHttp 4.12 |
| 存储 | SQLite(SQLiteOpenHelper,WAL 模式) |
| 加密 | AES-GCM(AndroidKeyStore) |
| 构建 | AGP 8.13.2 / Kotlin 2.2.20 / JDK 17 |
| 最低版本 | Android 7.0(API 24) |
关于 WebView:仅在账号登录(OAuth)时使用,配置为
LOAD_NO_CACHE且退出时清理缓存。
应用数据全部存放在私有目录,不会上传到任何第三方服务器:
| 目录 | 内容 |
|---|---|
databases/ |
SQLite 数据库(账号、应用 Key、用量记录) |
app_webview/ |
登录页 WebView 缓存(自动清理) |
shared_prefs/ |
配置项 |
「设置 → 数据管理」可查看各目录实测占用,并清理数据库记录与 WebView 缓存。
国产 ROM(ColorOS / MIUI / EMUI 等)对后台进程管控严格,本应用做了以下加固:
BOOT_COMPLETED 广播)VISIBLE 优先级| 操作 | 行为 |
|---|---|
| 按住拖动 | 可拖到屏幕任意位置,边界自动夹紧(不让球拖出视野丢失) |
| 松手 | 自动吸附到最近的屏幕边缘 |
| 3 秒不碰 | 贴边半藏,只露半个球在边缘(半透明,不碍事) |
| 点击球体 | 立即展开,重置倒计时 |
| 状态指示 | 绿点=运行中,红点=已停止 |
收起时刻意保留一半可见:露出太少会让人以为球丢了、反而要费力去找; 露一半则一眼看出是"躲在边上",既不挡内容,又随点随到。
收起时只偏移绘制内容、窗口本身仍在屏内 —— 这样"看起来藏起来了", 但触摸热区仍是完整的球体(若把窗口整体移出屏幕,露出的部分就是全部触摸区,会很难点中)。
这个功能不是保活银弹,需要如实理解它的能力范围:
| 它能做到的 | 它做不到的 |
|---|---|
提高 oom_adj 优先级,内存不足(LMK)回收时排在后台服务之后 |
❌ 挡不住系统「一键清理」「强力清理」——那类操作走白名单机制,不在白名单里窗口再多也照杀 |
| 部分 ROM 判定「速冻」时会参考"是否有可见窗口",可降低被速冻概率 | ❌ 无法绕过电池优化、自启动等厂商管控 |
结论:悬浮球是"以观感换存活率"的辅助手段(屏幕上会多一个球),默认关闭。 真正的主力仍是:电池优化白名单 + 自启动 + 后台运行 + 回收后自动重启。
建议同时在系统设置中把本应用加入电池优化白名单并允许自启动。
本项目仅供学习与技术研究使用,请勿用于任何商业用途。
本项目参考了以下开源项目的思路(Python 版后端):
及更多(详见上游 README.md)。