mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 12:02:27 +08:00
Build composite subscription bucket two
This commit is contained in:
@@ -73,13 +73,53 @@ guessing a provider.
|
||||
- Composite groups can copy accounts from concrete provider groups.
|
||||
- Concrete provider accounts can be assigned directly to composite groups from
|
||||
account create/edit and bulk account workflows.
|
||||
- Subscription payment plans can bind to a composite group when that group's
|
||||
`subscription_type` is `subscription`. The plan grants access to the
|
||||
composite group; each request is still billed and quota-checked against the
|
||||
resolved concrete provider platform.
|
||||
- Channel configuration exposes composite groups in concrete provider sections.
|
||||
The channel `group_ids` payload is still flat; provider-specific model
|
||||
mapping and pricing remain keyed by concrete platform.
|
||||
|
||||
## Bucket 2 Setup: OpenAI + Claude + Gemini + Grok
|
||||
|
||||
Use one composite subscription group when one customer-facing plan should expose
|
||||
model aliases across OpenAI, Claude, Gemini, and Grok without issuing separate
|
||||
keys per provider.
|
||||
|
||||
1. Create concrete provider groups for the upstream account pools, for example
|
||||
`OpenAI Paid`, `Claude Paid`, `Gemini Paid`, and `Grok Paid`.
|
||||
2. Create a `composite` group with `subscription_type` set to `subscription`.
|
||||
3. Assign provider accounts directly to the composite group, or copy accounts
|
||||
from the concrete provider groups during group creation.
|
||||
4. Add explicit routes for public aliases that should not rely on built-in
|
||||
model detection:
|
||||
|
||||
| Public model | Endpoint | Target platform | Upstream model |
|
||||
| --- | --- | --- | --- |
|
||||
| `all/gpt-5` | `responses` | `openai` | `gpt-5` |
|
||||
| `all/claude-sonnet` | `messages` | `anthropic` | `claude-sonnet-4-6` |
|
||||
| `all/gemini-pro` | `gemini` | `gemini` | `gemini-2.5-pro` |
|
||||
| `all/grok` | `responses` | `grok` | `grok-4` |
|
||||
|
||||
5. Configure channel pricing and model mapping under the concrete platforms
|
||||
named in each route. Composite routing does not create pricing records.
|
||||
6. Create a subscription payment plan for the composite group.
|
||||
|
||||
The same composite group can also rely on built-in detection for standard model
|
||||
names such as `gpt-*`, `claude-*`, `gemini-*`, and `grok-*`. Explicit routes are
|
||||
recommended for bundled plan aliases because they make endpoint, provider, and
|
||||
upstream model attribution reviewable in the admin UI.
|
||||
|
||||
## Limits
|
||||
|
||||
Composite routes choose a concrete provider and upstream model; they do not
|
||||
create synthetic model metadata, pricing, or upstream capability records by
|
||||
themselves. Keep channel pricing/model mapping configured for the concrete
|
||||
provider platforms that the routes target.
|
||||
|
||||
This PR intentionally does not implement:
|
||||
|
||||
- AUTO smart-routing among multiple providers for the same abstract task.
|
||||
- Direct API-key binding to several existing groups without a composite group.
|
||||
- Protocol-agnostic provider decoupling or a LiteLLM-style adapter rewrite.
|
||||
|
||||
Reference in New Issue
Block a user