Billing#

Billing controls how the platform records and charges usage. You pick the billing mode, set up payment channels, manage subscription plans and redemption codes, price models and tools, and verify results in usage logs and orders.

Where to find it#

Open Billing in the admin console. The page runs top to bottom:

  1. Billing mode and Payment settings.
  2. Redemption codes.
  3. Plans.
  4. Model pricing.
  5. Tool pricing (native tools and MCP tools).

Usage records and payment orders are on the Logs page, not here.

DEEIX Chat admin billing

Choose a billing mode#

The mode decides what users see and whether balances or plan credits are deducted.

  1. Open the Billing mode select.
  2. Pick one:
ModeWhat it does
Self-useRecords usage only. No deduction and no purchase actions.
Subscription billingLimits usage by plan credits.
Usage billingCalculates cost from model pricing and deducts balance.

The change saves immediately. You see "Switched to {mode}". Existing balances and subscriptions are not converted, so confirm they match the new mode before switching.

Set display currency and rate#

  1. Choose Display currency: US Dollar ($) or Chinese Yuan (¥). It controls user-facing cost display only. Accounting, deductions, and API fields stay in USD and nanousd.
  2. Set USD -> CNY rate. It is the platform-level conversion rate used for cost display and CNY payment amounts. It must be greater than 0.
  3. Click Save if the rate changed.

Set the per-request reservation#

This field appears only when the mode is not self-use.

  1. Enter Per-request reservation in USD. It is the risk budget reserved before each paid call. Final billing still uses actual usage.
  2. Click Save. The value must be 0 or greater.

Set it to 0 to distribute the available budget across up to 5 concurrent paid calls. A higher value raises the balance a user must hold before a call starts.

Set up payment channels#

Stripe and EPay can be enabled together. Users choose the channel at checkout.

Stripe#

  1. Open the Stripe tab.
  2. Turn on Enable Stripe.
  3. Copy the Webhook Endpoint and add it in the Stripe Dashboard. It is read-only.
  4. Fill Publishable Key (pk_...).
  5. Fill Secret Key (sk_...).
  6. Fill Webhook Secret (whsec_...). It verifies Stripe webhook signatures.
  7. Click Save.

Stripe requires Secret Key and Webhook Secret. Missing either shows "Stripe requires Secret Key and Webhook Secret." Existing secrets show a configured placeholder; leave them blank to keep the current value.

EPay#

  1. Open the EPay tab.
  2. Turn on Enable EPay.
  3. Fill Redirect gateway. It supports the submit.php browser redirect protocol. Enter an EPay site URL or an exact submit.php URL.
  4. Fill Merchant ID.
  5. Fill Merchant key.
  6. Fill Payment types JSON. Each entry uses name as the frontend display name and type as the channel value sent to EPay.
  7. Click Save.

EPay requires the gateway URL, merchant ID, and merchant key. The payment types must be a JSON array where every entry has a non-empty name and type, or you see "EPay payment types must be a JSON array containing name and type."

Example payment types:

json

Manage subscription plans#

  1. In Plans, click the pencil on a row to open Subscription plan.
  2. Edit Name.
  3. Edit Description.
  4. Set Price.
  5. Choose Interval: Lifetime, Month, or Year.
  6. Set Period credit. This is the usage amount a user can consume per period.
  7. Choose Permission group. Subscribers automatically gain that group's model access.
  8. Click Save.

The table shows the default price per interval and the period credit with "/ period". Plans are only meaningful in subscription billing; changing a plan affects renewals and upgrades for existing subscribers.

Create and manage redemption codes#

Create a code#

  1. Click Create in Redemption codes.
  2. Optionally enter Code. Leave it blank to generate a UUID. A manual code must be 3-64 letters, numbers, hyphens, or underscores.
  3. Set Quantity. A manual code can only be created once, so quantity must be 1.
  4. Choose Billing mode: Usage billing or Subscription billing.
  5. For usage codes, set Redemption amount greater than 0.
  6. For subscription codes, choose Plan (an active non-Free plan) and set Duration days greater than 0.
  7. Set Total limit. Leave it empty for unlimited.
  8. Set Per-user limit. It cannot exceed the total limit.
  9. Set Expires at. It must be later than the current time; leave it empty for "Never".
  10. Optionally add Description.
  11. Click Save. Generated codes appear in Redemption codes created; copy them individually or with Copy all.

Manage existing codes#

The list shows Code (hint), Mode, Reward, Limit, Status, and Expiry. Filter by Mode, Status, and Availability (Available, Expired, Exhausted), or search the code hint and description.

  • Toggle a code with its Status switch.
  • Use the history icon to open View redemptions, which jumps to the redemption records in Logs.
  • Use the pencil to edit. Only status, limits, expiry, and description can be changed.
  • Select rows to Copy, Export, Enable, Disable, or Delete in bulk. Copy and export decrypt the selected codes; codes that cannot be decrypted are skipped.

Deleting hides a code and blocks redemption, but redemption history is kept.

A code cannot be redeemed when the mode is self-use, when its mode does not match the current billing mode, when it is inactive, expired, or exhausted. The list marks these rows and shows the reason on hover.

Configure model pricing#

  1. In Model pricing, search by platform model or vendor.
  2. Filter by Configuration (Configured, Unconfigured), Free status (Free, Not free), Pricing mode, and Vendor.
  3. Toggle the Free switch to make a model free without opening the dialog.
  4. Click the pencil to open Model base price.

The dialog has a Form and a JSON editor. The JSON editor syncs to the form while it is valid and shows the error inline.

  1. Pricing mode is required:
    • Usage billing (token) — billed by tokens.
    • Per call (call) — billed per request.
    • Per second (duration) — only selectable for video generation models.
    • Tiered (tiered) — billed by raw input token range.
  2. Optionally turn on Free model.
  3. Fill the price fields for the chosen mode:
ModeFields
Usage billingInput / 1M, Output / 1M, Cache read / 1M, Cache write / 1M
Per callPer call
Per secondPer second
TieredPer tier: Token limit, Input / 1M, Output / 1M, Cache read / 1M, Cache write / 1M

For tiered pricing, tier matching uses raw input token ranges. Enter the full token count in Token limit; 0 means the last tier is unlimited. Use Add tier and the trash icon to change the tiers.

Time-of-day multipliers#

Every mode can carry time-of-day multipliers. They apply on top of the base price by server local time.

  1. Click Add period.
  2. Fill Name, up to 32 characters.
  3. Pick at least one day in Weekdays.
  4. Set Start and End in HH:MM. An end not after the start wraps past midnight; the row shows a "next day" badge.
  5. Set Rate. 100 is the base price. It must be an integer from 1 to 10000.
  6. Remove periods with Remove.

At most 32 periods are allowed, and periods must not overlap. Invalid periods are highlighted and listed under Time-of-day multipliers when you save.

Quick setup#

Click Quick setup next to the model name to import prices from the OpenRouter catalog. Prices are USD per 1M tokens. Search the catalog, pick a row, set an Import multiplier, and click Import. Fields the current billing mode does not support are skipped and listed. If the model has no valid input or output token price, it cannot be imported.

Import and export#

  • Click Export to download all configured pricing as JSON keyed by platform model name.
  • Click Import and pick a JSON file. The root must be an object keyed by platform model name, and every name must exist in the model catalog. Unknown models, schema errors, or an empty file are rejected with a specific message.
  • JSON is also the only place to set cacheWritePriceBasis (direct or anthropic_5m).

Configure tool pricing#

Native tools#

  1. Turn on Native tool billing. When enabled, administrator-enabled official native tools are billed using the prices below. Self-use mode still records usage only.
  2. Set a price per call for each row. The table shows Provider, Tool, Type, and Price ($ / call).
  3. Set the price to 0 to disable billing for a tool.
  4. Click Save.

Only successfully executed tool calls are billed outside self-use mode; failed calls are not billed.

MCP tools#

  1. Search by server or tool name, or filter by Server.
  2. Set a per-call price in each row. Prices are in USD per call; 0 disables billing.
  3. To set many at once, select tools, enter a price in Bulk set price, and click Apply. This updates the draft only.
  4. Click Save to persist changes.

MCP tools must be synced first on the Tools page. Only successful calls are billed outside self-use mode.

Read usage logs and orders#

Pricing changes affect future calls. Historical calls keep their billing snapshot.

Usage logs#

Open Logs → Model calls. Each row shows the billing mode, tokens, cache, cost, balance after settlement, and latency. Hover the cost to see the unit-price breakdown for the mode, including tiered ranges, cache write multipliers, and time-of-day rates. Filter by Billing mode, Model, and time range; sort by cost, tokens, or latency.

Orders#

Open Logs → Order records. Filter by Order type (Subscription, Top-up), Provider (Stripe, EPay), Status (Pending, Paid, Expired, Failed), and time range. The detail shows the paid amount, base amount, credited balance, interval and cycles, and the external payment and checkout IDs.

Reference#

AreaField or setting keyMeaning
Billing configmodeself, period, or usage.
Billing configdisplayCurrencyUSD or CNY. Display only.
Billing configusdToCNYRateUSD -> CNY conversion rate.
Billing configprepaidAmountUSDPer-request reservation. 0 spreads budget across up to 5 concurrent paid calls.
Paymentbilling.payment_providersstripe, epay, both, or disabled.
Stripebilling.stripe_publishable_key, billing.stripe_secret_key, billing.stripe_webhook_secretKeys and webhook signature secret.
EPaybilling.epay_gateway_url, billing.epay_pid, billing.epay_key, billing.epay_typesGateway, merchant ID, key, and payment type JSON.
Plansname, description, amountUSD, billingInterval, periodCreditUSD, permissionGroupIDSubscription plan fields.
Redemption codescode, quantity, mode, creditUSD, planID, durationDays, maxRedemptions, perUserLimit, expiresAt, description, statusCreate and edit fields.
Model pricingpricingMode, isFree, inputUSDPerMTokens, outputUSDPerMTokens, cacheReadUSDPerMTokens, cacheWriteUSDPerMTokens, cacheWritePriceBasis, callUSDPerCall, durationUSDPerSecond, tieredPricingJSON, schedulePricingJSONModel price fields.
Tool pricingnativeToolBillingEnabled, nativeToolPricing[], priceNanousdNative tool switch and per-call prices. MCP tool prices are stored on each tool.

Troubleshooting#

What you seeWhat to check
"Payment settings incomplete"Fill the required keys for every enabled channel.
"EPay payment types must be a JSON array containing name and type."Fix the Payment types JSON.
"Invalid reservation amount"Enter a USD amount of 0 or greater.
"Invalid exchange rate"Enter a rate greater than 0.
"Code must be 3-64 letters, numbers, hyphens, or underscores."Fix the manual Code.
"A manual code can only be created once."Set Quantity to 1 when a manual code is entered.
"Per-user limit cannot exceed the total limit."Lower Per-user limit or raise Total limit.
"Choose an active non-Free plan."The subscription code needs an active, non-Free plan.
"Import failed: unknown platform models"The JSON contains model names not in the model catalog.
"Per-second pricing requires the video generation capability."Only video generation models accept duration.
Cost looks wrong for an old callHistorical calls use their own pricing snapshot, not the current price.
  • Logs for model calls, orders, and redemption records.
  • Tools for syncing MCP tools before pricing them.
  • Models for the platform model catalog used by pricing.
  • Billing & pricing for cache, tiered, and multiplier details.
  • Subscription for the user-side view.