[Feature] Support Venice USD and DIEM balances and automatic model pricing for custom provider aliases

オープン
#9,003 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
api, backend

調査の方向性

Start with the Venice quota probe in src/providers/quota/vendor-probes-key.ts, which currently runs only for the exact provider ID venice, calls /billing/balance, and reads balance or balance_usd. Check how providers using the official Venice base URL are matched, then switch the probe to GET /api/v1/api_keys/rate_limits and read data.balances.USD and data.balances.DIEM. Done when custom-named Venice providers show both balances in the dashboard and in ocx provider quota --json; the automatic pricing part is a separate, larger change.

索引モデルが issue の本文から書いたものです。

説明

catalog enhancement
Area

Multiple areas

What are you trying to accomplish?

I use Venice through OpenCodex with a custom provider name. I want to see the remaining USD and DIEM balances in the Providers dashboard and have OpenCodex use Venice's current catalog prices for cost estimates in Logs and Usage. If I configure multiple Venice providers, I want each balance report to appear under its configured provider name.

What prevents this today?

On OpenCodex Desktop 2.100.6 for Windows, inference works with a custom Venice provider such as venice-custom, but the provider has no balance entry in the dashboard or in ocx provider quota --json.

The balance probe only runs for the exact provider ID venice. It calls /billing/balance, which requires an Admin key, and looks for balance and balance_usd. Venice's current documentation shows balances.diem and balances.usd for that endpoint.

When automatic model pricing is unavailable, I have to look up and enter the rates manually, then repeat the process when Venice changes its prices.

What should OpenCodex do?
  • Show the remaining USD and DIEM balances separately for providers using the official Venice API URL, including providers with custom names. Reuse each provider's existing Inference key.
  • If feasible, populate and refresh cost estimates from Venice's published model prices when its catalog is refreshed. Match models by exact upstream ID and include input, output, cache read/write, and long-context rates where Venice publishes them.
  • Keep manually configured prices as overrides.
Example usage or interface
  1. Configure venice-custom with the base URL https://api.venice.ai/api/v1 and a Venice Inference key.
  2. Open the provider in the dashboard. Its balance section shows separate rows such as USD 25.00 and DIEM 90.50 when Venice reports those values. (internally the values could be aggregated in case a single USD balance is needed)
  3. Run ocx provider quota --json. The quota report includes venice-custom.
  4. Refresh the model catalog. An enabled Venice model with published pricing shows an estimated cost in Logs and Usage without manual price entry. An existing manual price still takes precedence.
Alternatives or workarounds

I can check the actual balances in Venice's API settings and manually enter per-model prices in OpenCodex. I also considered using the canonical venice ID, but that only covers one configured provider and still leaves the Admin-key requirement and response-format mismatch in v2.100.6.

Additional context
Checks
  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.
主要言語
TypeScript
スター
16.9k
フォーク
1.3k
平均マージ
1日 2時間
マージ済み PR(30日)
844

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lidge-jun/opencodex のほかの issue

lidge-jun/opencodex の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。