No description
  • Go 78.3%
  • JavaScript 21.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nex 7a5cffcff8
Some checks failed
neorouter docker image / build-and-push (push) Has been cancelled
Financial dialect tests / financial-dialects (push) Has been cancelled
docs(explainers): explain relay, cleanup, and product changes
Add plain-language visual guides for provider retry isolation,
model-not-found failover, deferred Responses stream commitment,
Responses namespace compatibility, controlled Chat web-search
passthrough, safe consumption-log cleanup, and the two-step ModelPrice
market redesign. Use each source commit date in the corresponding
explainer filename.
2026-08-30 00:23:18 +08:00
.codex chore(repo): remove beads integration 2026-08-20 23:02:34 +08:00
.compound-engineering feat(branding): rename product to NeoRouter 2026-06-08 01:36:59 +08:00
.github feat(payment): harden rolling WeChat settlement migration 2026-08-24 10:44:30 +08:00
bin first commit 2025-06-09 16:10:03 +08:00
cli merge(done-hub): integrate reviewed branch 2026-08-09 16:14:36 +08:00
common fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
controller fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
cron fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
docs docs(explainers): explain relay, cleanup, and product changes 2026-08-30 00:23:18 +08:00
hack/scripts Merge branch 'done-hub' 2026-07-24 21:42:16 +08:00
i18n feat(points): add configurable quota display 2026-08-03 10:40:17 +08:00
mcp feat(payment): harden rolling WeChat settlement migration 2026-08-24 10:44:30 +08:00
metrics Merge branch 'done-hub' 2026-08-02 15:19:32 +08:00
middleware feat(pricing): add account group price catalog API 2026-08-24 10:44:43 +08:00
model fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
payment Merge branch '微信支付对接' 2026-08-24 10:45:01 +08:00
providers fix(relay): isolate provider retry state 2026-08-27 12:58:17 +08:00
relay fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
router fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
safty fix(safety): fail closed on system prompt checks 2026-06-13 14:59:31 +08:00
scripts feat(pricing): restrict model visibility by user group 2026-07-13 08:05:24 +08:00
service feat(diagnostics): expose reviewed financial diagnostics via MCP 2026-08-09 16:06:19 +08:00
testdata/official-client-fixtures feat(providers): harden official-client consistency 2026-06-22 13:20:01 +08:00
third_party/go-mcp-v0.2.14 feat(diagnostics): expose reviewed financial diagnostics via MCP 2026-08-09 16:06:19 +08:00
types fix(relay): isolate provider retry state 2026-08-27 12:58:17 +08:00
web fix(logs): harden consumption-log cleanup and statistics watermark 2026-08-29 20:27:16 +08:00
.air.toml chore(repo): remove beads integration 2026-08-20 23:02:34 +08:00
.cursorignore first commit 2025-06-09 16:10:03 +08:00
.dockerignore feat(payment): harden rolling WeChat settlement migration 2026-08-24 10:44:30 +08:00
.editorconfig first commit 2025-06-09 16:10:03 +08:00
.env.example feat(docker-compose): parameterize POSTGRES_USER via env var 2026-06-11 01:38:17 +08:00
.gitattributes feat(diagnostics): expose reviewed financial diagnostics via MCP 2026-08-09 16:06:19 +08:00
.gitignore feat(payment): harden rolling WeChat settlement migration 2026-08-24 10:44:30 +08:00
.golangci.yml first commit 2025-06-09 16:10:03 +08:00
.roborev.toml chore(repo): remove beads integration 2026-08-20 23:02:34 +08:00
.sembleignore setup(aiad): add Semble local semantic search guidance 2026-06-02 17:43:43 +08:00
AGENTS.md chore(repo): remove beads integration 2026-08-20 23:02:34 +08:00
CLAUDE.md chore(repo): remove beads integration 2026-08-20 23:02:34 +08:00
CONCEPTS.md Merge branch 'main-fork' 2026-08-24 10:46:29 +08:00
docker-compose.yml merge(upstream): integrate U3 relay-only and provider auth into main 2026-07-17 09:52:02 +08:00
Dockerfile merge(done-hub): integrate reviewed branch 2026-08-09 16:14:36 +08:00
Dockerfile-action chore: rename distribution artifacts 2026-06-06 01:11:37 +08:00
DONEHUB_BACKPORT_REVIEW.md feat(video): harden durable recovery lifecycle 2026-07-26 02:37:29 +08:00
findings.md docs(points): plan configurable points display 2026-08-02 23:04:49 +08:00
go.mod merge(done-hub): integrate reviewed branch 2026-08-09 16:14:36 +08:00
go.sum merge(track-a): consume U2 legal consent checkpoint a19dcac8 2026-07-20 23:03:04 +08:00
init.sh deploy(docker-compose): update 2026-06-09 18:42:24 +08:00
LICENSE first commit 2025-06-09 16:10:03 +08:00
main.go feat(pricing): add account group price catalog API 2026-08-24 10:44:43 +08:00
main_test.go feat(diagnostics): expose reviewed financial diagnostics via MCP 2026-08-09 16:06:19 +08:00
makefile build(aube): consolidate web and docs tooling 2026-06-19 23:47:54 +08:00
mise.toml fix(channel): make manual model tests protocol-aware 2026-08-25 13:26:32 +08:00
neorouter.service chore: rename distribution artifacts 2026-06-06 01:11:37 +08:00
progress.md docs(points): plan configurable points display 2026-08-02 23:04:49 +08:00
pull_request_template.md first commit 2025-06-09 16:10:03 +08:00
README.en.md feat(branding): rename product to NeoRouter 2026-06-08 01:36:59 +08:00
README.md feat(branding): rename product to NeoRouter 2026-06-08 01:36:59 +08:00
shutdown_test.go feat(diagnostics): expose reviewed financial diagnostics via MCP 2026-08-09 16:06:19 +08:00
task_plan.md docs(points): plan configurable points display 2026-08-02 23:04:49 +08:00
Taskfile.yml Merge branch 'done-hub' 2026-07-24 21:42:16 +08:00
VERSION first commit 2025-06-09 16:10:03 +08:00

中文 | English

image__3_-removebg-preview.png

This project is a secondary development based on done-hub

Telegram Group

AI Wave Community · (Offering public API and AI bots in-group)

📚 View Original Project Documentation


About

NeoRouter is a fork / secondary development of one-hub. It stays fully database- and image-compatible with the upstream while adding substantial improvements around reverse-proxying modern clients (Claude Code / Gemini CLI / Codex / Antigravity, etc.), fine-grained channel control, an invitation & rebate system, analytics, and multi-instance deployment stability.

The database schema is compatible with the upstream — existing one-hub users can migrate by simply pulling the nexzhu/neorouter image.


Differences from Upstream (Latest one-hub Image)

The additions are grouped into ten categories: new providers, native-route compatibility, channel-level enhancements, invitation & rebates, batch management, analytics & logging, auth, UI/UX, bug fixes, and performance / reliability.

1. New Provider / Channel Types

Channel Description
Codex (reverse proxy) New provider that reverse-proxies Codex CLI / Codex API as a standard upstream channel.
Claude Code (reverse proxy) New ClaudeCode provider — terminates the Claude Code client (including the native /v1/messages protocol).
Gemini CLI (reverse proxy) New GeminiCli channel (type 57) for transparently relaying native Gemini CLI requests.
Antigravity (reverse proxy) New Antigravity channel (type 60) targeting alternative endpoints such as daily-cloudcode-pa.googleapis.com.
Vertex AI Express New Vertex AI Express channel (type 61) — a lighter-weight Vertex AI integration.

2. Native-Route Compatibility Across Channels

Upstream providers can normally only be called via their own protocol. NeoRouter bridges different native protocols so that a single channel can simultaneously serve multiple client types:

  • Custom channels can expose the native Claude route (/v1/messages) — ready to plug into Claude Code.
  • Vertex AI channels can expose the native Gemini route (/gemini/*) — ready to plug into Gemini CLI.
  • Vertex AI channels can expose the native Claude route — ready to plug into Claude Code.
  • Vertex AI channels support multiple regions; one region is randomly chosen per request, giving free per-request load balancing.
  • Google Gemini channels support native video generation (Veo series) via the /gemini route.
  • gemini-2.0-flash-preview-image-generation is supported for text-to-image / image-to-image, and is also compatible with the OpenAI Chat Completions interface.

3. Channel-Level Enhancements

  • Request parameter pass-through / filtering
    • Native /gemini image-generation requests support extra-parameter pass-through.
    • Claude channels (both OpenAI format and native format) support extra-parameter pass-through.
    • remove_params supports nested fields, e.g. "remove_params": ["generationConfig.thinkingConfig"].
  • Model name mapping
    • Configurable case-insensitive model name matching.
    • Configurable unified request / response model name mapping.
    • Model redirection supports auto-mapping the key to model configuration.
  • BaseURL templating
    • Channel BaseURL supports model-variable substitution for dynamic upstream URLs based on the request model.
  • Per-channel toggles
    • Bill empty responses toggle (default: billed).
    • Built-in chat feature toggle.
    • Per-channel allow_extra_body to allow extra request body fields.

4. Invitation & Rebate System (new)

  • Invite Code module
    • Manual / automatic code generation, batch create (up to 100 at a time), and batch delete.
    • Per-code max uses, start / expiry timestamps, and enable / disable flag.
    • Tracks usage and status statistics.
  • Recharge rebate for inviters
    • When an invitee recharges, the inviter can be rewarded:
      • Fixed amount or percentage types.
    • Coexists with the original "invite bonus quota" feature, forming a full referral incentive loop.
  • Decouple third-party login from invite-code authorization
    • Fixes the coupling that forced invite codes on third-party logins; the open-registration policy can now be configured independently.

5. Batch Management

  • Batch delete channels
  • Batch add models to multiple channels at once
  • Batch attach user groups to multiple channels
  • Batch operations are also available for invite codes, system logs, etc.

6. Analytics & Logging

  • Live RPM / TPM / CPM metrics in the analytics dashboard.
  • Recharge statistics now supports time-period filters (all / year / month / week / day).
  • The system log (system_log) supports conditional queries and pagination.
  • Logs can be exported as CSV for offline analysis and reconciliation.
  • Removed the meaningless "original price" styling from log views.

7. Auth & Login

  • LinuxDo OAuth login with Trust Level–based access control (Basic / Member / Regular / Leader).
  • Third-party login flow decoupled from invite-code authorization.

8. UI / UX

  • System Information module rebuilt — denser, more readable.
  • Dark mode follows the OS automatically.
  • Improved email validation rules.
  • Many backend UI polish items (table sorting, icons, forms, hints, etc.).
  • Better disabled-channel email notification logic to avoid duplicates / false positives.

9. Bug Fixes

Covers billing, caching, statistics, payments, security — the critical paths:

  • Fixed broken user-facing API endpoints.
  • Fixed missing fields in invitation records.
  • Fixed hardcoded timezone affecting statistical data (now respects TZ / time.Local).
  • Fixed channels not reloading into memory after updates.
  • Fixed payment-callback failures in multi-instance deployments.
  • Fixed floating-point token math for Zhipu GLM models.
  • Fixed CDN-caching on API routes that led to privilege escalation.
  • Fixed inconsistent time-type formatting across MySQL versions.
  • Fixed multiple user-quota cache / DB inconsistencies that caused billing anomalies.
  • Fixed missing cached_tokens field in the Responses API.
  • Fixed parsing of Anthropic-style cache tokens in OpenAI-compatible usage.
  • Fixed context propagation in the Gemini CLI provider during token refresh / error handling.

10. Performance & Reliability

  • Vertex AI auth caching — significantly fewer redundant auth round-trips.
  • Key cache pre-warming — higher cache hit rate at startup.
  • Channel cache reloads on update — no restart required.
  • Improved retry / cooldown logic for more stable failover.
  • Cleaner google_search responses for /gemini requests.
  • Unified and trimmed log formatting across the codebase for faster triage.
  • Alipay payment pipeline refactor; Epay and related fixes.

Deployment

Follow the upstream deployment guide and swap the image for nexzhu/neorouter.

Database-compatible — existing one-hub deployments can migrate by simply pulling this image.

Quick start:

docker pull nexzhu/neorouter:latest

docker run -d \
  --name neorouter \
  -p 3000:3000 \
  -e TZ=Asia/Shanghai \
  -v $(pwd)/data:/data \
  nexzhu/neorouter:latest

Full deployment, configuration, billing, and model-pricing docs live in the upstream documentation: https://one-hub-doc.vercel.app/


Feedback & Community

  • Telegram: AI Wave Community (public API and AI bots available in-group)
  • Issues / PRs are welcome on this repository.

Acknowledgments

  • This program builds on the following open-source project:
    • done-hub — the foundation of this project.
    • one-hub — done-hub's upstream.

Thanks to the authors and contributors of the upstream project.