QuantumNous / QuantumNous/new-api

订阅套餐支持绑定指定渠道,实现渠道级别的差异化计费

Open
#4,239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
48.5k
Forks
11.6k
Avg merge
1d 13h
Merged PRs (30d)
58

Description

没问题,我按照你提供的模板格式为你整理好了:

提交前必读(请勿删除本节)

您当前的 newapi 版本

v0.12.8

提交确认

我已确认目前没有类似 issue

我已完整查看过文档 https://docs.newapi.ai/ 和项目 README,已确定现有版本无法满足需求

我未删除此模板中的任何引导内容或小节标题,并会按要求完整填写

我理解项目维护者精力有限,不遵循模板要求的 issue 可能会被无视或直接关闭

功能描述
当前机制

New API 目前的订阅套餐(通过令牌额度+过期时间模拟)有一个特点:一旦创建,该套餐对所有可用渠道都是通用的。

也就是说,套餐用户消耗的是所有渠道的聚合池,系统不会区分这个请求走的是渠道A还是渠道B——统统从套餐额度里扣。

我想要的能力
让订阅套餐可以"绑定"到指定的渠道上,实现以下场景:

套餐A(基础版) → 只能使用渠道1、渠道2(比如 DeepSeek、Qwen 等低成本渠道)

套餐B(专业版) → 只能使用渠道3、渠道4(比如 GPT-4、Claude 等高成本渠道)

混合模式:同一个令牌下,指定渠道走套餐额度,其他渠道走按量计费(从单独的余额扣,不走套餐)

核心诉求一句话总结
订阅套餐可以指定"渠道白名单",白名单内的渠道消耗套餐额度,白名单外的渠道要么禁止使用,要么走独立的按量计费模式。

应用场景

场景一:会员等级分级

运营一个 AI 聚合平台:

免费用户:只能用 DeepSeek、通义千问(低成本渠道)

Pro 用户:可以用 GPT-4o、Claude 3.5(高质量渠道)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked documentation and README first, then trace the existing subscription quota and expiry, channel selection, and balance-deduction paths; the issue names no source files, entry points, or tests. Done requires an agreed channel whitelist model and explicit behavior for requests outside the whitelist, including mixed subscription and pay-as-you-go billing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authorization, backend, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.