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

Đang mở
#9,003 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
16.9k
Fork
1.3k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
844

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lidge-jun/opencodex

Tất cả issue của lidge-jun/opencodex

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.