github QuantumNous/new-api v0.13.0

latest release: v0.13.1
9 hours ago

Highlights

This release introduces powerful support for expr expression-based tiered billing, allowing administrators to configure complex, dynamic pricing rules. A simple use case for this feature is a pricing expression like tokens <= 128000 ? 0.002 : 0.004, where the system will automatically apply a lower rate for usage under 128K tokens and a higher rate for anything above that threshold.

New Features

  • Introduces support for evaluating expr expressions in the billing system, enabling dynamic tiered pricing with configurable presets (#4409).
  • Adds a UI for tool pricing settings and improves tool call quota calculations.
  • Displays the user ID in admin top-up bills for easier tracking (#4349).
  • Adds a 'last used time' column to the tokens table (#4372).
  • Relaxes token key column length requirements to support the migration of longer legacy token keys (#4401).

Bug Fixes

  • Ensures the pricing calculation logic only applies the N ratio to image models (#4412).
  • Preserves text tool surcharges properly during tiered billing settlement (#4162).
  • Corrects the completion ratio configuration for the gpt-5.5 model (#4414).
  • Fixes the model pricing UI to use the correct display type (#4426).
  • Resolves runtime crashes and edge cases within the tiered pricing editor and settlement logic.
  • Updates channel testing to properly support and evaluate tiered billing models.

Improvements

  • Adds preset pricing tiers for Doubao Seed 1.8 to enhance discount calculations.
  • Replaces Card components with divs to improve overall layout consistency.
  • Updates internal billing calculations to use quota per unit for better accuracy.

What's Changed

  • fix(channel-test): support tiered billing model tests by @yyhhyyyyyy in #4145
  • 在管理员充值账单中显示用户 ID by @uskyu in #4349
  • 增加令牌最后使用时间 by @feitianbubu in #4372
  • chore(deps): bump github.com/jackc/pgx/v5 from 5.9.0 to 5.9.2 by @dependabot[bot] in #4397
  • chore(deps-dev): bump @xmldom/xmldom from 0.8.12 to 0.8.13 in /electron by @dependabot[bot] in #4399
  • Relax token key column length for legacy migration compatibility by @XiaoAI1024 in #4401
  • fix(billing): preserve text tool surcharges in tiered settlement by @yyhhyyyyyy in #4162
  • feat: support for tiered billing expressions in the billing system by @Calcium-Ion in #4409
  • fix(image): only price image model use N ratio by @xyfacai in #4412
  • fix: correct gpt-5.5 completion ratio by @jingx8885 in #4414
  • fix: model pricing use correct display type by @feitianbubu in #4426

New Contributors

Full Changelog: v0.12.15...v0.13.0

Don't miss a new new-api release

NewReleases is sending notifications on new releases.