hermes - 💡(How to fix) Fix [Feature Request]: Configurable pricing and billing routes for custom providers [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#17035Fetched 2026-04-29 06:37:45
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Please consider adding first-class configuration for pricing and billing metadata for custom providers.

Today, deployments that use custom provider routes or Anthropic/OpenAI-compatible proxies may need to patch source code so usage accounting can:

  • classify a custom provider under the correct billing family
  • map a runtime provider to a separate billing_provider
  • define per-model input/output prices
  • define cache read/write pricing behavior
  • handle model-family fallback for custom model names

This is difficult to maintain because every upstream upgrade can overwrite local pricing and billing patches.

Root Cause

Hermes already supports flexible provider routing. Usage accounting should have a matching extension point, otherwise custom-provider deployments end up forking core pricing code for what is fundamentally deployment configuration.

Fix Action

Fix / Workaround

Today, deployments that use custom provider routes or Anthropic/OpenAI-compatible proxies may need to patch source code so usage accounting can:

This is difficult to maintain because every upstream upgrade can overwrite local pricing and billing patches.

A custom provider should be able to work end-to-end with accurate usage accounting using only config files. Upgrades should not require reapplying source patches for pricing tables or billing-provider routing.

Code Example

pricing:
  providers:
    custom:my-anthropic-proxy:
      billing_provider: my-anthropic-billing
      model_family: anthropic
      currency: USD
      models:
        claude-opus-4-7:
          input_per_mtok: 25.0
          output_per_mtok: 125.0
          cache_read_multiplier: 0.10
          cache_write_multiplier: 1.25
      fallback:
        match:
          - claude
          - opus
        input_per_mtok: 25.0
        output_per_mtok: 125.0
RAW_BUFFERClick to expand / collapse

Summary

Please consider adding first-class configuration for pricing and billing metadata for custom providers.

Today, deployments that use custom provider routes or Anthropic/OpenAI-compatible proxies may need to patch source code so usage accounting can:

  • classify a custom provider under the correct billing family
  • map a runtime provider to a separate billing_provider
  • define per-model input/output prices
  • define cache read/write pricing behavior
  • handle model-family fallback for custom model names

This is difficult to maintain because every upstream upgrade can overwrite local pricing and billing patches.

Proposed capability

Allow custom providers to declare pricing and billing behavior in config, for example:

pricing:
  providers:
    custom:my-anthropic-proxy:
      billing_provider: my-anthropic-billing
      model_family: anthropic
      currency: USD
      models:
        claude-opus-4-7:
          input_per_mtok: 25.0
          output_per_mtok: 125.0
          cache_read_multiplier: 0.10
          cache_write_multiplier: 1.25
      fallback:
        match:
          - claude
          - opus
        input_per_mtok: 25.0
        output_per_mtok: 125.0

The exact shape can differ, but the important part is that pricing/billing metadata can be supplied without editing Hermes source.

Use cases

  • Private Anthropic-compatible gateways
  • OpenAI-compatible aggregators with different billing rates
  • Enterprise providers where the runtime provider name differs from the billing entity
  • Local deployments that need accurate cost reporting across multiple providers
  • Providers with cache read/cache write billing multipliers

Expected outcome

A custom provider should be able to work end-to-end with accurate usage accounting using only config files. Upgrades should not require reapplying source patches for pricing tables or billing-provider routing.

Why this matters

Hermes already supports flexible provider routing. Usage accounting should have a matching extension point, otherwise custom-provider deployments end up forking core pricing code for what is fundamentally deployment configuration.

extent analysis

TL;DR

Add a configuration option to declare pricing and billing behavior for custom providers, allowing for accurate usage accounting without modifying source code.

Guidance

  • Introduce a new configuration section, such as pricing.providers, to store custom provider pricing and billing metadata.
  • Define the structure of the configuration section to include necessary fields, such as billing_provider, model_family, and models.
  • Implement logic to read and apply the custom pricing and billing configuration for usage accounting.
  • Test the new configuration option with various custom provider scenarios to ensure accurate usage accounting.

Example

pricing:
  providers:
    custom:my-anthropic-proxy:
      billing_provider: my-anthropic-billing
      model_family: anthropic
      currency: USD
      models:
        claude-opus-4-7:
          input_per_mtok: 25.0
          output_per_mtok: 125.0
          cache_read_multiplier: 0.10
          cache_write_multiplier: 1.25

Notes

The exact implementation details may vary depending on the existing codebase and requirements. It's essential to ensure backward compatibility and handle potential errors or edge cases when introducing the new configuration option.

Recommendation

Apply workaround by introducing a custom configuration option for pricing and billing metadata, as this allows for accurate usage accounting without modifying source code and enables easier maintenance and upgrades.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING