TL;DR: iFlytek’s desktop AI assistant Loomy gives out a decent amount of quota every day (using a points system), but the client is quite bloated, and I didn’t want to be tied to its interface. So I wrapped its quota in a self-hosted API gateway, with dual OpenAI / Anthropic protocol compatibility, a multi-account pool, a web control panel, and zero dependencies using only the Python standard library. It’s now open source.
What it can do
| Capability | Description |
|---|---|
| OpenAI-compatible | /v1/chat/completions (streaming + non-streaming), /v1/models, /v1/embeddings, /v1/images/generations |
| Anthropic-compatible | /v1/messages; thinking blocks and tool_use / tool_result are translated, so Claude Code can connect directly |
| Multi-account pool | Add accounts with one command; route requests using one of three strategies—points balance, round-robin, or LRU—and automatically switch accounts and retry when a login session expires |
| Web control panel | See each account’s balance, remaining session days, used points, and cooldown status at a glance; add, delete, disable, force-renew, or change the device identity with a single click |
| Fully automatic renewal | Login sessions are valid for 14 days and are automatically renewed with the account credentials before they expire; run it in the background and forget about it |
| Zero dependencies | Python 3.9+; no need to install anything with pip |
| No client installation required | Login is handled entirely server-side (the RSA + HMAC signing flow is implemented in the gateway), so installing or uninstalling the Loomy client makes no difference |
Get started in 5 minutes
git clone https://github.com/Patrick130306/loomy2api.git
cd loomy2api
cp accounts.example.json accounts.json
python -m loomy2api add main --phone your-phone-number --password 'password set in the account center'
python -m loomy2api accounts # View quota and remaining session days
python -m loomy2api serve # http://127.0.0.1:17890
Then open http://127.0.0.1:17890/panel to access the control panel.
You need to set the password once in the iFlytek account center (web or mobile) — there is no password-setting option in the Loomy client.
I confirmed this after searching through the client source code. You can also log in with an SMS verification code without a password.
Connect clients
| Client | Configuration |
|---|---|
| Cherry Studio / LobeChat / NextChat / Open WebUI | Select “OpenAI-compatible”, set the Base URL to http://127.0.0.1:17890/v1, and enter any key |
| Immersive Translate | Custom OpenAI endpoint, using the same Base URL |
| Claude Code | ANTHROPIC_BASE_URL=http://127.0.0.1:17890 |
| OpenAI SDK | base_url="http://127.0.0.1:17890/v1" |
The model list is fetched directly from the upstream service (11 models). Names are used as-is; the gateway does not perform any mapping. The lower the multiplier, the cheaper it is: spark-x is x0.1, GLM-5.3-Flash / qwen3.8-flash are x0.8, deepseek-v4-flash-0731 is x3.0, and the most expensive, qwen-3.8-max, is x12.0.
One detail discovered through testing is worth mentioning: the upstream service silently falls back to its default model when it doesn’t recognize a model name. (I sent gpt-4o-mini; it returned HTTP 200, but the model field in the response was deepseek-v4-flash-0731.) So don’t expect writing gpt-4o to trigger automatic mapping—use the ID of the model you actually want, and when in doubt, check the response’s model field.
About “device identity isolation”
With multiple accounts, each account randomly generates and binds its own device identity (devid / campus device ID) on first login.
It reuses that identity for every subsequent renewal, so all accounts do not present themselves externally as the same device.
But to be honest, this is also exactly what I wrote in the documentation: this is not an anti-ban guarantee. There are only four device-related fields in the protocol,
and the upstream service usually cares more about the outgoing IP anyway. For details, see docs/PROTOCOL.md in the repository—the full reverse-engineering record of the protocol (endpoints, signature strings, error fingerprints, and points ledger) is documented there. This project is designed for “account isolation”; it was never intended to be marketed as anti-ban protection.
Deployment
The README includes a complete deployment guide (in both Chinese and English): Linux systemd services, Windows Task Scheduler / NSSM service registration,
Docker and docker-compose, plus pitfalls such as “set an API key before exposing the service publicly.”
# One-command Docker setup
mkdir -p data && cp accounts.example.json data/accounts.json
docker compose up -d --build
Quality
- 109 tests, all offline: a local mock upstream service + mock account service; running the tests never touches real accounts or consumes a single point
- CI fully green: six combinations of Ubuntu / Windows × Python 3.9 / 3.11 / 3.13
- Tested with real accounts: OpenAI streaming/non-streaming, Anthropic streaming/non-streaming, and image generation / embeddings passthrough
Here’s an interesting detail: CI caught a real bug for me—the quota-refresh function only caught custom exceptions and failed to handle socket/DNS-layer exceptions. As a result, a user who ran loomy2api accounts while offline would get an immediate crash.
It could never be reproduced locally because the machine always had an internet connection; only the CI environment’s inability to reach the upstream service exposed it. It has been fixed, and a regression test has been added.
Disclaimer
- For research and personal use only. Use your own account; do not abuse the service, resell it, or turn it into a public service that overloads the upstream provider
- This project is not affiliated with iFlytek. The signature constants are client constants included in every official client package, and are used only to communicate with the account service
- MIT licensed; feel free to inspect the code
If you find it useful, giving it a Star is the greatest support ![]()
https://github.com/Patrick130306/loomy2api
loomy2api — turn the Loomy (iFlytek desktop AI assistant) quota into a
self-hosted OpenAI- and Anthropic-compatible API gateway: multi-account pool
with balance/round-robin/LRU routing and automatic session renewal, a web control
panel (per-account quota, add/remove/renew, device identity), zero dependencies
(pure Python 3.9+ stdlib), 109 hermetic tests, CI green on Ubuntu/Windows ×
Python 3.9/3.11/3.13. No desktop client required. MIT licensed:
https://github.com/Patrick130306/loomy2api
Special thanks to @user80 for the idea