Admin Guide
Advanced system settings
Advanced system configuration options available to Root only
This page expands on the advanced fields in each System settings tab, covering payment, rate limiting, ratios, chat, drawing, dashboard, models, operations and other operational parameters. Like [System settings](/docs/guide/admin/system-settings), it is a Root-only page (`/console/setting`): settings are read via `GET /api/settings` and saved via `PUT /api/setting`. The detailed tabs in the web console follow the reference design and are still being integrated.
Payment settings
Configure the payment methods and payment parameters supported by the platform. Go to /console/setting → Payment settings tab.
General settings
Payment settings
Top-up group ratio
{
"default": 1,
"vip": 1,
"svip": 1
}Top-up methods
[
{ "name": "Alipay", "color": "rgba(22, 119, 255, 0.15)", "type": "alipay" },
{ "name": "WeChat Pay", "color": "rgba(7, 193, 96, 0.15)", "type": "wxpay" }
]Payment settings example: server address, EPay parameters, group ratio and custom top-up methods JSON
What is EPay
EPay is a third-party checkout that aggregates channels such as Alipay and WeChat Pay. When a user tops up, the form fields are obtained via `POST /api/user/pay`, the browser POSTs them to the EPay gateway to complete payment, and an asynchronous callback updates the quota.
EPay configuration
Fill in the payment address, merchant ID/key and callback address. After saving, check on the Wallet page whether `GET /api/user/recharge/info` returns pay_methods.
Stripe configuration
Configure the Stripe Secret Key, Webhook Secret and related values in the Payment settings tab. User top-ups go through `POST /api/user/stripe/pay` and redirect to Checkout.
Other payment methods
Channels such as Creem are supported (depending on option toggles). The minimum top-up and callback path for each channel are whatever the API returns.
Top-up methods
Use JSON to customize the top-up method buttons shown in the frontend (name, color, type); type maps to the EPay type parameter.
Field reference
See the “EPay parameters” and “Server address” tables below. After changing the key, run a small test top-up again.
Top-up amounts
Configure fixed tiers (such as 10/50/100 USD) or allow custom amounts. Together with MinTopUp and Price, these constrain what users can enter.
Custom top-up amount option
When enabled, the Wallet page shows an input for any amount; when disabled, only the preset tiers are shown.
Top-up bonuses
Configure a top-up bonus ratio per group (TopUpGroupRatio). For example, a user in the vip group who tops up 100 USD receives quota worth 110 USD.
EPay parameters
| Setting | Field | Description |
|---|---|---|
| Server address | ServerAddress | Public root URL of the site; used to generate payment callbacks and redirect links |
| Payment address | PayAddress | EPay gateway address, such as https://pay.example.com |
| EPay merchant ID | EPayId | Merchant number assigned by the EPay platform |
| EPay merchant key | EPayKey | Signing key; keep it secure |
| Callback address | PayCallbackAddress | Asynchronous notification URL, usually {ServerAddress}/api/user/epay/notify |
| Top-up price (CNY per USD) | Price | CNY-to-USD exchange rate used to convert amounts shown in CNY for EPay |
| Minimum top-up (USD) | MinTopUp | Minimum amount per top-up (USD) |
Rate limit settings
Configure site-wide and per-group QPM/QPD in the “Rate limit settings” tab of System settings; requests over the limit return HTTP 429. Web console support is still being integrated.
Global rate limit
Set site-wide QPM/QPD caps in the “Rate limit settings” tab; requests over the limit return 429. Use this to protect the overall capacity of the gateway.
Rate limits by user group
Set independent thresholds for each group; these take precedence over the global limit. Groups without their own setting use the global values.
Group rate limit example
JSON example: `{"default":{"qpm":60},"vip":{"qpm":300}}`. Model-level limits can be refined by model name in the same tab.
Ratio settings
The ratio system determines how fast quota is consumed and matches what users see on the Pricing page. In the “Ratio settings” tab you can sync upstream ratios or adjust model_ratio manually.
Ratio system overview
EasyAPI calculates quota consumption from a combination of model_ratio, completion_ratio, group_ratio, cache_ratio and more; model metadata and the option table both take effect.
How quota relates to ratios
User quota is a unified currency unit. Different models and groups use ratios to convert it into equivalent token or per-call consumption.
Quota formula
Usage-based: cost ≈ (prompt_tokens × model_ratio + completion_tokens × model_ratio × completion_ratio) × group_ratio × base unit price. Per call: cost = model_price × group_ratio.
Usage-based billing (tokens)
quota_type = 0; input and completion tokens are weighted by separate ratios. See the pricing docs for details.
Per-call billing (fixed price)
quota_type = 1; each call deducts model_price regardless of the token count.
Audio models (special handling)
Some audio models are billed by duration or characters; the meaning of model_ratio follows the configuration in Model management.
Pre-deduction and post-deduction
Pre-deduction reserves an estimated quota before the request and settles the difference based on actual tokens afterwards; post-deduction charges once after the response completes.
Billing types
| Type | Identifier | Description |
|---|---|---|
| Per-token | quota_type = 0 | Billed by token usage. Input price ≈ model_ratio × 2 (USD baseline) / 1M tokens; completion = input × completion_ratio. Cache read price appears when cache_ratio is set. |
| Per-call | quota_type = 1 | Fixed charge per request, shown as ¥x.xxxx / call (or your site currency). Completion column shows —. |
Model ratio settings
Controls the base input ratio (model_ratio) of each model. Displayed price (USD) ≈ model_ratio × 2 / 1M tokens. See Model management for details.
Common model ratio examples
| Model | model_ratio | Description |
|---|---|---|
gpt-4o | 2.5 | Flagship multimodal model with a higher input ratio |
gpt-4o-mini | 0.15 | Lightweight model suited to high-frequency calls |
gpt-3.5-turbo | 0.5 | Classic chat model |
claude-3-5-sonnet | 1.5 | Converted from upstream pricing |
deepseek-chat | 0.07 | Cost-effective open-source family |
How to configure
- Edit a single model in “Model management”, fill in model_ratio, completion_ratio or model_price, and save; the change takes effect via `PUT /api/model/`.
- Edit the JSON (ModelRatio) in bulk in the “Ratio settings → Model ratio” tab, which is convenient for adjusting many models at once.
- Use “Upstream ratio sync” to pull the latest ratios from configured channels, fine-tune them manually, then save.
- To reset to the defaults, call `POST /api/setting/rest_model_ratio` (Root only).
Completion ratio settings
Default completion ratio
| Field | Description |
|---|---|
CompletionRatio | Global default completion ratio (option table). Models without their own completion_ratio inherit this value, which is usually 1 |
completion_ratio | Model-level completion ratio that overrides the global default; completion token price = input price × completion_ratio |
Group ratio settings
The group ratio (group_ratio) sets the billing discount for the same model under different API key groups, and matches the ratio field in Group management.
Group ratio configuration
{
"default": 1,
"vip": 0.8,
"svip": 0.6,
"test": 0
}Maintained via GET|POST|PUT|DELETE /api/prefill_group/; after saving, the group_ratio field in GET /api/pricing is updated accordingly.
Group ratio precedence
- For API calls, the group_ratio of the API key group (token.group) is used first.
- If the API key group is auto, the actual group is resolved by the system policy before the ratio is looked up.
- The user group (user.group) affects the available model list and the default pricing display; billing uses the API key group's ratio.
- Groups not declared in group_ratio default to a ratio of 1.
Visual ratio editor
The “Ratio settings” tab offers table-based editing with search, sorting and bulk save, so there is no need to write JSON by hand. Web console support is still being integrated.
| Model | model_ratio | completion_ratio | model_price |
|---|---|---|---|
gpt-4o | 2.5 | 3 | — |
gpt-4o-mini | 0.15 | 1.5 | — |
midjourney | — | — | 0.1 |
Visual ratio table example: inline editing of model_ratio / completion_ratio / model_price
| Column | Field | Description |
|---|---|---|
| Model name | — | Matches the model field in the channel and pricing APIs |
| Model ratio | model_ratio | Edited inline in the table; saved to the option or model table |
| Completion ratio | completion_ratio | Leave empty to inherit the global CompletionRatio |
| Fixed price | model_price | Filled in for per-call models; shown instead of model_ratio |
Models without a ratio
When channel sync or manual creation adds models that have no model_ratio yet, the behavior is controlled by the option accept_unset_model_ratio_model:
- Off (default): calls are rejected and the log shows “model ratio not set”, preventing incorrect billing.
- On: calls are allowed and billed at the default ratio of 1 or the upstream value; useful for onboarding new models quickly and repricing them later.
Keep this off in production and enable models only after configuring them in “Model management” or through ratio sync.
Upstream ratio sync
Pull the latest model_ratio from connected upstream channels to reduce manual maintenance.
- Call
GET /api/ratio_sync/channelsto list channels that support sync - Select a channel, then call
POST /api/ratio_sync/fetchto pull its ratios - Review the differences in the visual table or JSON, then save
- If needed, use
POST /api/setting/rest_model_ratioto restore the default ratios
FAQ
How do I set the ratio for a new model?
Fill in model_ratio under “Model management → Add model” or when editing an existing model. For per-call models, fill in model_price and set quota_type to 1. After saving, verify the displayed price on the Models page. If channel sync brings in new model names, you can also run upstream ratio sync first and then fine-tune.
How do group ratios take effect?
Users choose a group when creating an API key. On each API call, the gateway reads token.group, looks up the matching multiplier in the group_ratio JSON, multiplies it by the model's own ratio and deducts quota. A vip group ratio of 0.8 means the same token usage costs only 80% of the default group.
What does the completion ratio do?
Output tokens are often more expensive than input tokens. completion_ratio is the price multiplier of one completion token relative to one input token. For example, with model_ratio=1 and completion_ratio=3, 100 prompt + 50 completion tokens have a relative weight of 100×1 + 50×1×3 = 250.
How do I set ratios for similar models in bulk?
Use the visual table or the ModelRatio JSON in the Ratio settings tab for bulk edits, or filter by provider in Model management and adjust models one by one. For a model family, you can sync upstream ratios first, then apply a discount factor to all of them and write the result into the JSON.
Quota calculation examples
The examples below show how weights are calculated. The final quota also depends on the site's base unit price and display currency; the exact charge is shown in Usage records.
Example 1: GPT-4 chat for a standard user
default group, gpt-4o, model_ratio=2.5, completion_ratio=3, one conversation with prompt=1000 and completion=500 tokens.
- Input weight = 1000 × 2.5 = 2500
- Completion weight = 500 × 2.5 × 3 = 3750
- Total weight = 6250 (then × group_ratio 1 × base unit price to get quota)
Result: Usage-based charge; the exact USD/quota amount depends on the site's quota base, and the precise deduction is shown in the usage logs.
Example 2: GPT-3.5 chat for a VIP user
vip group with group_ratio=0.8, gpt-3.5-turbo, model_ratio=0.5, completion_ratio=1.5, prompt=2000, completion=800.
- Input weight = 2000 × 0.5 = 1000
- Completion weight = 800 × 0.5 × 1.5 = 600
- Subtotal = 1600 × group_ratio 0.8 = 1280
Result: The VIP group gets a 20% discount; for the same number of tokens it is charged 20% less quota than the default group.
Example 3: Per-call model (such as Midjourney)
quota_type=1, model_price=0.1 (USD equivalent), group_ratio=1, one imagine call.
- Each call deducts a fixed model_price × group_ratio
- Independent of prompt/completion token counts
Result: Each call deducts quota worth 0.1 USD; with the vip group at 0.8, each call deducts 0.08.
Chat settings
Configure the site's built-in chat/Playground and one-click import into third-party chat clients. Corresponds to the “Chat settings” tab in System settings.
Chat app configuration
Controls the default model and visibility of the Playground and chat page; saving affects `/console/playground` and the demo chat entry.
| Setting | Field | Description |
|---|---|---|
| Chat link | ChatLink | External chat page URL; leave empty to use the built-in Playground |
| Default chat model | DefaultChatModel | Default model name when the Playground/chat page first loads |
| Show API info | ChatApiInfoEnabled | Show the API base URL and setup hints on the chat page |
| Real-name verification | ChatRealNameCheckEnabled | When enabled, users without real-name verification cannot use chat |
Chat integration variables
The following placeholders can be used in one-click import URL templates. The frontend replaces them with the current user's API key and the site's API address when opening the third-party app:
- {apiKey} / {token}: the currently selected EasyAPI API key (starts with sk-)
- {baseUrl} / {openAIUrl}: the site's API base URL (NUXT_PUBLIC_API_BASE_URL)
- {openAIBaseUrl}: {baseUrl}/v1, for OpenAI SDK-compatible clients
- {siteName}: the site name, used as the title in some clients
Chat app integration
The “Chat app integration” section on the API keys page supports one-click import into clients such as ChatGPT Next Web, Lobe Chat and OpenCat. See “Chat app integration” in the user guide for how each app's parameters are assembled.
- Create and select the target API key on the API keys page before importing
- Import links open in a new tab, so the full key is not leaked into the current page's URL history (some clients may still briefly show it in the hash)
- For manual integration, use Authorization: Bearer {apiKey} and {openAIBaseUrl}
For the full steps, see the Chat app integration user guide.
Drawing settings
Gateway parameters and billing strategy for asynchronous image tasks such as Midjourney. Corresponds to the “Drawing settings” tab; users can track task progress in the “Task center”.
Midjourney configuration
Controls MJ proxy behavior, notifications and account filtering. Configure a Midjourney channel in “Channel management” first.
| Setting | Field | Description |
|---|---|---|
| MJ notifications | MjNotifyEnabled | Notify users when a task completes or fails (depends on notification channel settings) |
| Account filtering | MjAccountFilterEnabled | Filter or isolate MJ tasks by Discord account |
| Action verification | MjActionCheckSuccessEnabled | Verify success of callbacks for actions such as upscale/variation |
| Drawing proxy URL | MjProxyUrl | Optional; overrides the default MJ proxy gateway |
Drawing billing
Image models such as Midjourney are usually billed per call (quota_type=1). Set model_price in Model management; the group ratio (group_ratio) also applies.
- Actions such as imagine / upscale / variation are each charged once or according to the model configuration
- Quota is pre-deducted when a task is submitted; failed tasks are refunded according to the gateway policy
- Users can view mj_id, progress and charges at `/console/tasks`
- See “Task center” and the per-call billing notes in “Pricing” in the user guide
Related docs: Task center, Pricing.
Dashboard settings
Statistics range, charts and export options for the console dashboard `/console/dashboard`. Corresponds to the “Dashboard settings” tab.
Dashboard - basic settings
Controls the dashboard's default time range and whether key metric cards such as quota and request volume are shown.
| Setting | Field | Description |
|---|---|---|
| Enable dashboard | DashboardEnabled | When disabled, regular users cannot access the statistics page (admins still can) |
| Default statistics period | DashboardDefaultDays | Default range when opening the dashboard, such as 7 / 30 days |
| Show quota usage | DashboardQuotaEnabled | Whether to show quota usage in the overview cards |
| Show request count | DashboardRequestEnabled | Whether to show API request volume statistics |
Dashboard - chart settings
Configure data granularity and displayed series for line and bar charts, helping operators analyze peak hours and model distribution.
| Setting | Field | Description |
|---|---|---|
| Model distribution chart | DashboardModelChartEnabled | Show call share by model |
| Channel distribution chart | DashboardChannelChartEnabled | Show traffic by channel (visible to admins) |
| Statistics granularity | DashboardStatGranularity | hour / day; affects the X-axis ticks of charts |
Dashboard - advanced options
Extended capabilities for Root/admins, such as raw log export and cross-user aggregation.
- Data export: export CSV by time range (available fields depend on the console)
- Admin view: see site-wide totals; regular users only see their own data
- Cache refresh: after changing dashboard options, clear the CDN/browser cache so changes take effect immediately
Model settings
Model list display, call behavior and sync strategy. Used together with “Model management”; corresponds to the “Model settings” tab.
Model display settings
Affects what is shown on the Models page `/models` and in console dropdowns.
| Setting | Field | Description |
|---|---|---|
| Hide disabled models | HideDisabledModels | Do not show models with status=0 in public lists |
| Show model description | ShowModelDescription | Show the description field on model cards and tables |
| Default pricing group | DefaultPriceGroup | Group filter selected by default on the Models page |
| Quota display type | QuotaDisplayType | USD / CNY / TOKEN; linked with General settings |
Model behavior settings
Globally affects API gateway routing, retries and how models without a ratio are handled.
| Setting | Field | Description |
|---|---|---|
| Retry count | RetryTimes | Maximum automatic retries on upstream errors |
| Model request timeout | ModelRequestTimeout | Timeout for a single upstream request (seconds) |
| Accept models without a ratio | AcceptUnsetModelRatioModel | See “Models without a ratio” on this page |
| Stream timeout | StreamTimeout | Maximum idle time for SSE streaming connections |
Model sync settings
Automatically discover model names from channels and write them to the model table; can be combined with ratio sync.
- After enabling channels in “Channel management”, trigger “Sync model list from channels” in model settings
- Sync only updates model names and metadata; ratios must be configured separately or pulled via `POST /api/ratio_sync/fetch`
- Model mapping (model_mapping) is configured per channel and is not duplicated in this tab
For maintaining channels and model lists, see Channel management and Model management.
Operation settings
Operational switches for end users, such as registration, top-ups and redeem codes. Some fields overlap with “Payment settings” and “General settings”; the most recently saved option wins.
Basic operation settings
Controls new user registration, initial quota and the site's operating mode.
| Setting | Field | Description |
|---|---|---|
| Allow registration | RegisterEnabled | When disabled, the sign-up entry is hidden on the home page |
| Email verification | EmailVerificationEnabled | Require email verification for registration or email changes |
| Initial quota for new users | QuotaForNewUser | Quota granted after successful registration |
| Demo site mode | DemoSiteEnabled | Restricts some write operations; suitable for public demos |
| Self-use mode | SelfUseModeEnabled | Disables public registration or external distribution |
Top-up settings
Works with the Payment tab to control top-up capabilities on the Wallet page `/console/wallet`.
| Setting | Field | Description |
|---|---|---|
| Top-up link | TopUpLink | External top-up page URL; leave empty to use the built-in wallet |
| Minimum top-up | MinTopUp | Minimum amount per top-up (USD) |
| Fixed top-up tiers | TopUpAmountOptions | JSON array, such as [10, 20, 50, 100] |
| Allow custom amounts | CustomTopUpEnabled | Whether to show an input for any amount |
Redeem code settings
Controls user self-service redemption and bulk code generation by admins.
| Setting | Field | Description |
|---|---|---|
| Enable redeem codes | RedemptionEnabled | When disabled, users cannot redeem codes at `/console/wallet` |
| Redeem code prefix | RedemptionCodePrefix | Optional prefix for bulk-generated codes |
| Per-user redemption limit | RedemptionLimitPerUser | 0 means unlimited |
- For bulk generation by admins, see the “Redeem code management” docs (admin API: `/api/redeem_codes`)
- User redemption entry: `/console/wallet`, API `POST /api/user/redeem`
For admin operations, see Redeem code management.
Other settings
Home page content, announcements and miscellaneous feature switches. Corresponds to the “Other settings” tab and some “General settings” fields.
Home page settings
Content for the marketing home page and landing pages, returned read-only by public APIs.
| Setting | Field | Description |
|---|---|---|
| Home page content | HomePageContent | Markdown/HTML snippet; returned by `GET /api/home_page_content` |
| Enable custom home page | IndexPageEnabled | Use HomePageContent instead of the default home page layout |
| Announcement | Notice | Scrolling announcement text at the top of the site |
| About page | About | About page Markdown; also available via `GET /api/about` |
Other feature settings
Miscellaneous items such as OAuth, notifications and the footer. For OAuth providers, see the “Custom OAuth” docs (if enabled).
| Setting | Field | Description |
|---|---|---|
| Documentation URL | DocumentationLink | URL that the “Docs” link in the top bar points to |
| Footer HTML | Footer | Custom content for the site-wide footer |
| Turnstile site key | TurnstileSiteKey | Cloudflare Turnstile human verification |
| Data export interval | DataExportInterval | Cooldown for user self-service data export (minutes) |
Related information
- For an overview and the entry to each tab, see System settings
- For the user top-up flow, see Quota top-up
- For how group ratios relate to API keys, see Group management
- For importing into chat clients, see Chat app integration