Skip to content

[Feature]: Manual price override for models without pricing metadata #3667

Closed

Description

@nordz0r

Area

Catalog / models

What are you trying to accomplish?

I want to manually set or override the price (input/output cost per token) for models where pricing metadata is missing or incorrect — especially for self-hosted Ollama models, OpenRouter community models, and KiloCode free-tier models. This would give me accurate usage cost tracking in the Dashboard.

What prevents this today?

When a model's pricing is not provided by the provider API, the usage cost in the Dashboard shows $0.00 or "unknown". There is no UI or CLI command to manually set input/output token costs, so usage tracking is unreliable for mixed free/paid setups.

PR #3582 added pricing-policy resolution for usage tracking, but it works with provider-reported prices only — there is no manual override mechanism exposed in the GUI or CLI.

What should OpenCodex do?

  • In the model detail/edit view (or a new "Pricing" column in the model list), allow the user to manually set:
    • Input cost per 1M tokens
    • Output cost per 1M tokens
  • Manual overrides should take precedence over provider-reported prices in usage cost calculations.
  • Overrides should persist in the local configuration and survive catalog re-sync (ocx sync).
  • A visual indicator (e.g., pencil icon or "custom" badge) should show when a model has manually overridden pricing.
  • Provide a "Reset to auto" action to revert to provider-reported pricing.

Example usage or interface

Manual price override in model settings:

┌─────────────────────────────────────────────────┐
│  Model: ollama/my-custom-model                  │
│                                                 │
│  Pricing:  ○ Auto (from provider)               │
│            ● Manual override                    │
│                                                 │
│  Input:  [___0.50___] per 1M tokens             │
│  Output: [___1.50___] per 1M tokens             │
│                                                 │
│  [Save]  [Reset to auto]                        │
└─────────────────────────────────────────────────┘

CLI equivalent:

# Set custom pricing for a model
ocx model set-price ollama/my-model --input 0.50 --output 1.50

# Reset to auto-detected pricing
ocx model set-price ollama/my-model --auto

Alternatives or workarounds

No workaround exists — models with missing pricing always show $0.00 in usage, making cost tracking unreliable for mixed free/paid setups.

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.

Activity

  1. added
    enhancementNew feature or request
    catalogModel catalog, slugs, visibility, routed entries
    on Sep 5, 2026
  2. lidge-jun commented on Sep 5, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 50 / 80

    이 이슈는 가격 메타데이터가 없거나 틀린 모델(특히 Ollama 자체 호스팅, OpenRouter 커뮤니티, KiloCode 일부)에 대해 입력/출력 토큰당 단가를 손으로 넣고, Dashboard 사용량 비용이 그걸 따르게 하자는 요청입니다. 지금은 공급자 API가 가격을 안 주면 사용량이 $0.00 또는 unknown처럼 보이고, 실험용 무료/유료 혼합에서 비용 추적이 깨집니다. 이슈가 가리킨 #3582 가격 정책 해석은 공급자가 준 가격 쪽이고, “내가 고친 단가” UI/CLI는 빠져 있다는 문제 제기입니다.

    다만 현재 dev(6585e6a70)에는 이미 설정 계층의 수동 오버레이가 있습니다. src/types/provider.ts의 providers.<name>.modelCosts, src/config.ts의 providerModelCostsConfigError / load-time degradation, src/usage/user-cost-overlays.ts의 refreshUserCostOverlays / activeUserCostOverlays가 usage estimator에 들어가고, 주석도 “Display-time estimation only — never affect billing”이라고 못 박아 둡니다. 즉 config.json을 직접 편집하면 이슈가 원하는 precedence(수동 > 공급자 보고)는 이미 동작합니다. 빠진 것은 Dashboard 모델 상세의 Manual override UI, ocx model set-price 같은 친절한 CLI, “custom” 배지와 Reset to auto입니다.

    그래서 이슈를 “백엔드부터 새로”로 받으면 중복이 됩니다. 올바른 범위는 (1) 기존 modelCosts 스키마를 문서/가이드에 드러내기, (2) management API·GUI에서 그 필드를 읽고 쓰기, (3) CLI 단축 명령을 그 필드로 매핑하기입니다. 단위는 이슈 예시처럼 1M 토큰당이 사용자에게 익숙하고, 내부 ProviderCostOverlay flat 필드와 변환만 맞추면 됩니다. 카탈로그 ocx sync 후에도 오버레이가 남는지는 이미 reconciler(user-cost-overlay-reconciler.ts) 쪽이 담당하니, GUI는 그 계약을 깨지 않게만 쓰면 됩니다.

    #3666(무료 필터)와 같이 가면, 수동으로 0을 넣은 모델이 free 배지/필터에 잡힐지 정책을 한곳에서 정하는 게 좋습니다. types.ts/config.ts 대분할에 무효화될 PR은 아니고, enhancement·catalog 라벨과도 맞습니다.

    src/usage/user-cost-overlays.ts - modelCosts → usage 오버레이 이미 존재; GUI/CLI set-price 없음
    src/types/provider.ts modelCosts - 수동 단가 저장소; 이슈 요청과 동일 계층
    Dashboard 모델 상세 - Auto/Manual 토글·Reset to auto·custom 배지 없음
    이슈 본문 “workaround 없음” - config 직접 편집은 가능하나 비전공자·일상 운영 경로로는 부족

    메인테이너의 판단이 필요한 지점

    너의 추천
    이슈는 열어 두되 제목/본문에 “expose existing modelCosts in GUI/CLI”로 범위 좁히기. 첫 PR은 문서 + management PATCH + 모델 상세 폼 + Reset to auto. 새 가격 엔진은 만들지 말 것.

    이 댓글은 grok-bot이 작성했습니다

  3. added a commit that references this issue on Sep 7, 2026
  4. lidge-jun commented on Sep 7, 2026

    @lidge-jun
    Owner

    Shipped on dev in #3904 (merge 29405d314): manual per-model price overrides can be edited and reset from the dashboard model dialog and the CLI over the existing modelCosts store; an explicit zero is honored as a user override (distinct from "no pricing data"), and clearing an override restores automatic pricing. Overrides affect displayed cost estimates only. Ships in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    catalogModel catalog, slugs, visibility, routed entriesenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions