logoComputeVault
User GuideAPI ReferenceHelp & SupportBusiness Cooperation

System Settings Detailed Configuration

Root-exclusive advanced system configuration options

This page details the various configuration tabs in System Settings, covering advanced feature configurations such as payment, rate limiting, chat, and drawing.

Payment Settings

Configure the payment methods and parameters supported by the platform.

支付设置页面

What is EPay

EPay is a generic term for the "third-party aggregated payment gateway/interface" model, not a specific website or company. It can refer to commercial aggregated payment services, as well as self-built/open-source gateway implementations that follow the "EPay protocol style."

Core Function: Aggregates channels like WeChat Pay, Alipay, and bank cards, providing merchants with unified order placement, signature verification, and callback interfaces.

Compliance Notice: The gateway itself is not equivalent to a licensed payment institution; fund clearing, settlement, and compliance depend on the licensed channels it integrates with. Please adhere to local regulatory and risk control requirements.

EPay Configuration

EPay is a domestic aggregated payment platform that supports Alipay, WeChat Pay, and more.

  1. On the System Settings page, click the "Payment Settings" tab.
  2. Locate the "EPay" configuration area.
  3. Fill in the following information:
    • API Address: The interface address provided by EPay.
    • Merchant ID (PID): Obtained from the EPay backend.
    • Merchant Key (KEY): Obtained from the EPay backend.
  4. Check "Enable EPay".
  5. Click "Save".

The platform callback parameters include a signature, which the system will verify and automatically credit.

Stripe Configuration

Stripe is an international credit card payment platform.

Stripe 配置

  1. On the Payment Settings page, locate the "Stripe" configuration area.
  2. Fill in the following information:
    • API Key (Secret Key): Obtained from the Stripe console.
    • Publishable Key: Obtained from the Stripe console.
    • Webhook Signing Secret: Obtained after configuring the Webhook.
    • Product Price ID: The price ID of the Stripe product.
  3. Check "Enable Stripe".
  4. Click "Save".

Stripe requires configuring a Webhook to receive payment status notifications. The Webhook URL is: https://your-domain.com/api/payment/stripe/webhook

Other Payment Methods

The platform also supports the following payment methods, with similar configuration steps:

  • Creem: International payment platform.
  • Waffo: International payment platform.

Top-up Method Settings

In "Top-up Methods", you can configure according to the following structure:

[
  {
    "color": "rgba(var(--semi-blue-5), 1)",
    "name": "支付宝",
    "type": "alipay"
  },
  {
    "color": "rgba(var(--semi-green-5), 1)",
    "name": "微信",
    "type": "wxpay"
  },
  {
    "color": "rgba(var(--semi-green-5), 1)",
    "name": "Stripe",
    "type": "stripe",
    "min_topup": "50"
  },
  {
    "name": "自定义1",
    "color": "black",
    "type": "custom1",
    "min_topup": "50"
  }
]

Field Description

  • name: Display text. Shown on the "Select Payment Method" button (e.g., "Alipay/WeChat/Stripe/Custom1").
  • color: The theme or border color for the button/badge. Supports any CSS color value, it is recommended to use existing design tokens (e.g., rgba(var(--semi-blue-5), 1)).
  • type: Channel identifier, used for backend routing and order placement.
    • stripe → Uses Stripe gateway.
    • Others (e.g., alipay, wxpay, custom1, etc.) → Uses EPay-style gateway, and passes this value as a channel parameter.
    • For detailed logic, see the backend controller controller/topup.go.
  • min_topup: Minimum top-up amount (unit consistent with page currency). If the entered amount is less than this value, the page will prompt "The minimum top-up amount for this payment method is X" and restrict payment initiation; the backend will also perform validation.
  • Order: Renders from left to right according to array order.

Top-up Amount Configuration

Custom Top-up Amount Options

Set the top-up amount options that users can choose, for example:

[10, 20, 50, 100, 200, 500]

These values will be displayed in the "Select Top-up Quota" area, and users can directly click to choose the corresponding top-up amount.

Top-up Amount Discount Configuration

Set discounts corresponding to different top-up amounts, where the key is the top-up amount and the value is the discount rate, for example:

{
  "100": 0.95,
  "200": 0.9,
  "500": 0.85
}

Configuration Description:

  • Key: Top-up amount (string format).
  • Value: Discount rate (a decimal between 0-1, e.g., 0.95 means 95% of the price, i.e., a 5% discount).
  • The system will automatically calculate the actual payment amount and savings based on the configuration.
  • For detailed implementation logic, see the backend controller controller/topup.go.

Top-up discounts can incentivize users to top up larger amounts at once, increasing user stickiness.

Rate Limit Settings

Configure API call frequency limits to prevent abuse and protect system stability.

限流设置页面

Global Rate Limiting

  1. On the System Settings page, click the "Rate Limit Settings" tab.
  2. Configure global rate limit parameters:
    • Requests per Minute: Maximum requests per minute for a single IP.
    • Requests per Hour: Maximum requests per hour for a single IP.
    • Requests per Day: Maximum requests per day for a single IP.
  3. Click "Save".

Rate Limiting by Token

Rate limit parameters can be set individually for each Token:

  1. Edit the Token on the Token Management page.
  2. Set the rate limit parameters for this Token in "Advanced Configuration".
  3. Token-level rate limits take precedence over global rate limits.

Rate Limiting by User Group

Different rate limiting strategies can be set for different user Groups:

  1. Edit the Group on the Group Management page.
  2. Set the rate limit parameters for this Group.
  3. All users within the Group share this rate limit configuration.

Group Rate Limit Configuration Example

{
  "default": [200, 100],
  "vip": [0, 1000]
}

Configuration Description:

  • Key: Group name.
  • Value: An array containing two numbers.
    • First number: Requests per minute limit.
    • Second number: Requests per hour limit.
    • Setting to 0 means no limit.

Example Explanation:

  • default group: Maximum 200 requests per minute, maximum 100 requests per hour.
  • vip group: No limit per minute, maximum 1000 requests per hour.

Setting rate limits too low may affect normal usage. It is recommended to configure them reasonably based on actual business needs.

Ratio Settings

Ratio settings are the core configuration of the ComputeVault billing system. By setting different Ratios, you can flexibly control the billing standards for various models and user groups.

Ratio System Overview

ComputeVault uses a three-tier Ratio system to calculate user Quota consumption:

  1. Model Ratio - Defines the base billing multiplier for different AI models.
  2. Completion Ratio - Applies additional billing adjustments for output tokens.
  3. Group Ratio - Sets differentiated billing multipliers for different user groups.

Relationship between Quota and Ratio

In the ComputeVault system, Ratios are key parameters for calculating Quota consumption. Quota is the internal billing unit of the system, and all API calls are ultimately converted into Quota points for deduction.

Quota Unit Conversion:

  • 1 USD = 500,000 Quota points.
  • Quota points are the basic unit for internal system billing.
  • User balances and consumption records are based on Quota points.

Quota Calculation Formula

Pay-as-you-go Models (Based on Token Consumption)

Quota Consumption = (Input Token Count + Output Token Count × Completion Ratio) × Model Ratio × Group Ratio

Per-call Billing Models (Fixed Price)

Quota Consumption = Model Fixed Price × Group Ratio × Quota Unit (500,000)

Audio Models (Special handling, automatically processed internally by new-api)

Quota Consumption = (Text Input Token + Text Output Token × Completion Ratio + Audio Input Token × Audio Ratio + Audio Output Token × Audio Ratio × Audio Completion Ratio) × Model Ratio × Group Ratio

Pre-consumption and Post-consumption Mechanism

ComputeVault employs a dual billing mechanism of pre-consumption and post-consumption:

  1. Pre-consumption Stage: Before an API call, Quota consumption is calculated based on estimated Token count and pre-deducted.
  2. Post-consumption Stage: After an API call is completed, Quota consumption is recalculated based on the actual Token count.
  3. Difference Adjustment: If the actual consumption differs from the pre-consumption, the system will automatically adjust the user's Quota balance.
Pre-consumption Quota = Estimated Token Count × Model Ratio × Group Ratio
Actual Quota = Actual Token Count × Model Ratio × Group Ratio
Quota Adjustment = Actual Quota - Pre-consumption Quota

Model Ratio Settings

Model Ratios define the base billing multipliers for different AI models. The system pre-sets default Ratios for various models.

Common Model Ratio Examples

Model NameModel RatioCompletion RatioOfficial Price (Input)Official Price (Output)
gpt-4o1.254$2.5/1M Tokens$10/1M Tokens
gpt-3.5-turbo0.251.33$0.5/1M Tokens$1.5/1M Tokens
gpt-4o-mini0.0754$0.15/1M Tokens$0.6/1M Tokens
o17.54$15/1M Tokens$60/1M Tokens

Ratio Meaning Explanation:

  • Model Ratio: A multiplier relative to the base billing unit, reflecting cost differences between models.
  • Completion Ratio: The billing multiplier for output tokens relative to input tokens, reflecting output cost differences.
  • Higher Ratios consume more Quota; lower Ratios consume less Quota.

Setup Method

模型倍率设置 - 页面1

  1. On the System Settings page, click the "Ratio Settings" tab.
  2. Find the target model in the model Ratio list.

模型倍率设置 - 页面2

  1. Modify the following parameters:
    • Input Ratio: Billing Ratio for input Tokens.
    • Output Ratio: Billing Ratio for output Tokens.
    • Completion Ratio: Billing Ratio for completion interfaces.

模型倍率设置 - 页面3

  1. Click "Save".

Setting Methods:

  1. JSON Format Setting: Directly edit the model Ratio JSON configuration.
  2. Visual Editor: Set Ratios through a graphical interface.

Completion Ratio Settings

Completion Ratios are used for additional billing of output tokens, primarily to balance the input and output cost differences of various models.

Default Completion Ratios

Model TypeOfficial Price (Input)Official Price (Output)Completion RatioDescription
gpt-4o2.5$/1M Tokens10$/1M Tokens4Output is 4 times input
gpt-3.5-turbo0.5$/1M Tokens1$/1M Tokens2Output is 2 times input
gpt-image-15$/1M Tokens40$/1M Tokens8Output is 8 times input
gpt-4o-mini0.15$/1M Tokens0.6$/1M Tokens4Output is 4 times input
Other Models111Output is 1 time input

Setting Description:

  • Completion Ratios primarily affect the billing of output tokens.
  • Setting to 1 means output token billing is the same as input token billing.
  • Greater than 1 means output token billing is higher, less than 1 means output token billing is lower.

Group Ratio Settings

Group Ratios allow for setting differentiated billing multipliers for different user groups, enabling flexible pricing strategies.

Group Ratio Configuration

{
  "vip": 0.5,
  "premium": 0.8,
  "standard": 1.0,
  "trial": 2.0
}

Group Ratio Priority

  1. User-specific Ratio: Individual Ratio set for a specific user.
  2. Group Ratio: The Ratio of the Group the user belongs to.
  3. Default Ratio: System default Ratio (usually 1.0).

分组倍率设置 - 页面4

Set differentiated billing Ratios for different user groups:

  1. On the Ratio Settings page, find the "Group Ratio" area.
  2. Select the target Group.
  3. Set the global Ratio coefficient for this Group (e.g., 0.8 means an 80% price, or 20% discount).

分组倍率设置 - 页面5

  1. Click "Save".

Group Ratio is calculated by stacking with Model Ratio:

Final Consumption = Token Count × Model Ratio × Group Ratio

Visual Ratio Settings

The visual editor provides an intuitive Ratio management interface, supporting:

  • Batch editing of model Ratios.
  • Real-time preview of Ratio configurations.
  • Conflict detection and prompts.
  • One-click synchronization of upstream Ratios.

Models with Unset Ratios

For models with unset Ratios, the system will:

  1. Self-use Mode: Use a default Ratio of 37.5.
  2. Commercial Mode: Prompt a "Ratio or price not configured" error.
  3. Automatic Detection: Display unconfigured models in the management interface.

Upstream Ratio Synchronization

The system supports automatic synchronization of Ratio settings from upstream Channels:

  • Automatically retrieve upstream model Ratios.
  • Batch update local Ratio configurations.
  • Keep in sync with upstream prices.
  • Supports manual adjustment and override.

Frequently Asked Questions

Q: How to set Ratios for new models?

A: You can add new models through the visual editor or directly in the JSON configuration. It is recommended to set conservative Ratios first and adjust them based on actual usage.

Q: How do Group Ratios take effect?

A: Group Ratios are multiplied by model Ratios, ultimately affecting the calculation of user Quota consumption. A user's actual Ratio = Model Ratio × Group Ratio.

Q: What is the purpose of the Completion Ratio?

A: The Completion Ratio is mainly used to balance the cost differences between input and output tokens. For some models, output costs are significantly higher than input costs, requiring adjustment via the Completion Ratio.

Q: How to batch set Ratios for similar models?

A: You can perform batch operations through the visual editor, or directly add Ratio settings for similar models in the JSON configuration.

Quota Calculation Examples

Example 1: GPT-4 Standard User Conversation

Scenario Parameters:

  • Input tokens: 1,000
  • Output tokens: 500
  • Model Ratio: 15
  • Completion Ratio: 2
  • Group Ratio: 1.0 (Standard user)

Calculation Process:

Quota Consumption = (1,000 + 500 × 2) × 15 × 1.0
         = (1,000 + 1,000) × 15
         = 2,000 × 15
         = 30,000 Quota points

Equivalent USD Cost: 30,000 ÷ 500,000 = $0.06

Example 2: GPT-3.5 VIP User Conversation

Scenario Parameters:

  • Input tokens: 2,000
  • Output tokens: 1,000
  • Model Ratio: 0.25
  • Completion Ratio: 1.33
  • Group Ratio: 0.5 (VIP user 50% discount)

Calculation Process:

Quota Consumption = (2,000 + 1,000 × 1.33) × 0.25 × 0.5
         = (2,000 + 1,330) × 0.125
         = 3,330 × 0.125
         = 416.25 Quota points

Equivalent USD Cost: 416.25 ÷ 500,000 = $0.00083

Example 3: Per-call Billing Model (e.g., Midjourney)

Scenario Parameters:

  • Model Fixed Price: $0.02
  • Group Ratio: 1.0 (Standard user)
  • Quota Unit: 500,000

Calculation Process:

Quota Consumption = 0.02 × 1.0 × 500,000
         = 10,000 Quota points

Equivalent USD Cost: 10,000 ÷ 500,000 = $0.02

For more billing rules, please see Frequently Asked Questions.

Chat Settings

Configure parameters related to the built-in chat function.

聊天设置页面

Chat Application Configuration

  1. On the System Settings page, click the "Chat Settings" tab.
  2. Configure the following options:
    • Enable Chat Function: Toggle to enable or disable the built-in chat.
    • Default Model: The model selected by default on the chat page.
    • Max History Messages: Number of historical conversation turns to retain.
    • Streaming Output: Whether streaming output is enabled by default.
  3. Click "Save".

Chat Integration Variables

When configuring chat application integration, the following variables can be used:

  • {key}: Replaced with the key (API Key).
  • {address}: Replaced with the server address (without / and /v1 at the end).

Usage Example:

Configuration Template:

https://{address}/v1

After actual replacement:

https://api.example.com/v1

These variables are automatically replaced with actual values when importing configurations into the chat application with one click.

Chat Application Integration

Configure integration parameters for third-party chat applications:

  • ChatGPT Next Web: Configure deployment address.
  • Lobe Chat: Configure recommended settings.
  • Other Applications: Configure integration parameters.

Drawing Settings

Configure parameters related to drawing functions like Midjourney.

绘图设置页面

Midjourney Configuration

  1. On the System Settings page, click the "Drawing Settings" tab.
  2. Configure Midjourney parameters:
    • Enable Midjourney: Toggle to enable or disable the drawing function.
    • Midjourney Proxy Address: Midjourney-Proxy service address.
    • API Key: Midjourney-Proxy's key.
    • Timeout: Drawing task timeout (seconds).
  3. Click "Save".

Drawing Billing

Configure billing rules for drawing tasks:

  • Per-call Billing: Each drawing consumes a fixed Quota.
  • Time-based Billing: Billed according to drawing duration.
  • Resolution-based Billing: Billed according to image resolution.

The Midjourney feature requires additional deployment of the Midjourney-Proxy service. See the deployment documentation for details.

Dashboard Settings

Configure the display content and statistical dimensions of the data dashboard.

Dashboard Configuration - Basic Settings

数据看板设置 - 页面1

  1. On the System Settings page, click the "Dashboard Settings" tab.
  2. Configure display options:
    • Show User Statistics: Whether to display user count statistics.
    • Show Channel Statistics: Whether to display Channel usage statistics.
    • Show Model Statistics: Whether to display model call statistics.

Dashboard Configuration - Chart Settings

数据看板设置 - 页面2

  1. Configure chart parameters:
    • Default Time Range: The default time range displayed on the dashboard.
    • Refresh Interval: The time interval for automatic refresh.
    • Chart Type: Line chart, bar chart, or pie chart.

Dashboard Configuration - Advanced Options

数据看板设置 - 页面3

  1. Configure advanced options:
    • Data Cache Time: Cache duration for statistical data.
    • Show Real-time Data: Whether to display real-time statistics.
  2. Click "Save".

Model Settings

Configure model display and behavior parameters.

Model Display Settings

模型设置 - 页面1

  1. On the System Settings page, click the "Model Settings" tab.
  2. Configure model display options:
    • Show Model Description: Whether to display descriptions in the model list.
    • Show Model Icon: Whether to display model vendor icons.
    • Model Grouping Display: Group by vendor or type.

Model Behavior Settings

模型设置 - 页面2

  1. Configure model behavior:
    • Auto-disable Failed Models: Automatically disable after consecutive failures.
    • Failure Threshold: Number of failures to trigger automatic disabling.
    • Auto-recovery Time: Time (in minutes) for automatic recovery after disabling.

Model Synchronization Settings

模型设置 - 页面3

  1. Configure model synchronization:
    • Auto-sync Upstream Models: Periodically synchronize the latest model list from service providers.
    • Sync Interval: Time interval (in hours) for automatic synchronization.
    • Retain Custom Configuration on Sync: Do not overwrite manually modified configurations during synchronization.
  2. Click "Save".

Operation Settings

Configure parameters related to platform operations.

Basic Operation Configuration

运营设置 - 页面1

  1. On the System Settings page, click the "Operation Settings" tab.
  2. Configure operation parameters:
    • New User Initial Quota: Initial Quota for newly registered users.
    • Invitation Reward Quota: Reward Quota for inviting new users to register.
    • Rebate Ratio: Rebate Ratio (%) for consumption by invited users.

Top-up Configuration

运营设置 - 页面2

  1. Configure top-up options:
    • Minimum Top-up Amount: Minimum amount for a single top-up.
    • Top-up Bonus Ratio: Ratio of extra Quota given for top-ups.
    • Top-up Tiers: Preset top-up amount options.

Redemption Code Configuration

运营设置 - 页面3

  1. Configure redemption codes:
    • Redemption Code Validity: Default validity period (days) for redemption codes.
    • Single User Redemption Limit: Number of times each user can redeem.
  2. Click "Save".

Other Settings

Configure other miscellaneous parameters.

Homepage Configuration

其他设置 - 页面1

  1. On the System Settings page, click the "Other Settings" tab.
  2. Configure homepage content:
    • Homepage Announcement: Announcement content displayed on the homepage (supports Markdown).
    • Homepage Background Image: Homepage background image URL.
    • Show Statistics: Whether to display platform statistics on the homepage.

Other Feature Configuration

其他设置 - 页面2

  1. Configure other features:
    • Enable Log Export: Allow users to export their usage logs.
    • Log Retention Days: How many days of logs the system automatically cleans up.
    • Enable API Documentation: Whether to display the API documentation entry point.
  2. Click "Save".

All the above settings are only visible and modifiable by Root users; regular administrators do not have access.

How is this guide?

Last updated on

On this page

Payment Settings
What is EPay
EPay Configuration
Stripe Configuration
Other Payment Methods
Top-up Method Settings
Field Description
Top-up Amount Configuration
Custom Top-up Amount Options
Top-up Amount Discount Configuration
Rate Limit Settings
Global Rate Limiting
Rate Limiting by Token
Rate Limiting by User Group
Group Rate Limit Configuration Example
Ratio Settings
Ratio System Overview
Relationship between Quota and Ratio
Quota Calculation Formula
Pay-as-you-go Models (Based on Token Consumption)
Per-call Billing Models (Fixed Price)
Audio Models (Special handling, automatically processed internally by new-api)
Pre-consumption and Post-consumption Mechanism
Model Ratio Settings
Common Model Ratio Examples
Setup Method
Completion Ratio Settings
Default Completion Ratios
Group Ratio Settings
Group Ratio Configuration
Group Ratio Priority
Visual Ratio Settings
Models with Unset Ratios
Upstream Ratio Synchronization
Frequently Asked Questions
Q: How to set Ratios for new models?
Q: How do Group Ratios take effect?
Q: What is the purpose of the Completion Ratio?
Q: How to batch set Ratios for similar models?
Quota Calculation Examples
Example 1: GPT-4 Standard User Conversation
Example 2: GPT-3.5 VIP User Conversation
Example 3: Per-call Billing Model (e.g., Midjourney)
Chat Settings
Chat Application Configuration
Chat Integration Variables
Chat Application Integration
Drawing Settings
Midjourney Configuration
Drawing Billing
Dashboard Settings
Dashboard Configuration - Basic Settings
Dashboard Configuration - Chart Settings
Dashboard Configuration - Advanced Options
Model Settings
Model Display Settings
Model Behavior Settings
Model Synchronization Settings
Operation Settings
Basic Operation Configuration
Top-up Configuration
Redemption Code Configuration
Other Settings
Homepage Configuration
Other Feature Configuration