litellm - 💡(How to fix) Fix Advanced custom pricing fields not persisted/applied via /model/update [1 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
BerriAI/litellm#25839Fetched 2026-04-17 08:28:47
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

When updating model pricing via POST /model/update, basic pricing fields are persisted, but several advanced pricing fields are not persisted or not reflected back in GET /model/info.

Root Cause

When updating model pricing via POST /model/update, basic pricing fields are persisted, but several advanced pricing fields are not persisted or not reflected back in GET /model/info.

Code Example

{
  "model_info": { "id": "15b0d336-0b21-4337-87cb-9b1669d06799" },
  "model_name": "openrouter/openai/gpt-5.4",
  "litellm_params": {
    "input_cost_per_token": 0.0000025,
    "output_cost_per_token": 0.000015,
    "cache_read_input_token_cost": 0.00000025,
    "input_cost_per_token_above_272k_tokens": 0.000005,
    "output_cost_per_token_above_272k_tokens": 0.0000225,
    "cache_read_input_token_cost_above_272k_tokens": 0.0000005
  }
}

---

{
  "status": 200,
  "model_id": "15b0d336-0b21-4337-87cb-9b1669d06799"
}

---

{
  "model_name": "openrouter/openai/gpt-5.4",
  "input_cost_per_token": 2.5e-06,
  "output_cost_per_token": 1.5e-05,
  "cache_read_input_token_cost": null,
  "input_cost_per_token_above_272k_tokens": null,
  "output_cost_per_token_above_272k_tokens": null,
  "cache_read_input_token_cost_above_272k_tokens": null
}

---

{
  "model_info": { "id": "8fa27d55-2e90-4095-b6d4-8f325ced1dbc" },
  "model_name": "openrouter/google/gemini-2.5-flash",
  "litellm_params": {
    "input_cost_per_token": 0.0000003,
    "output_cost_per_token": 0.0000025,
    "cache_read_input_token_cost": 0.00000003,
    "cache_creation_input_token_cost": 0.00000008333,
    "input_cost_per_audio_token": 0.000001
  }
}

---

{
  "status": 200,
  "model_id": "8fa27d55-2e90-4095-b6d4-8f325ced1dbc"
}

---

{
  "model_name": "openrouter/google/gemini-2.5-flash",
  "input_cost_per_token": 3e-07,
  "output_cost_per_token": 2.5e-06,
  "cache_read_input_token_cost": null,
  "cache_creation_input_token_cost": null,
  "input_cost_per_audio_token": 7e-07
}

---

{
  "model_info": { "id": "c4890ba0-cce0-43f8-9935-eb46a6addcfe" },
  "model_name": "openrouter/google/gemini-3.1-flash-lite-preview",
  "litellm_params": {
    "input_cost_per_token": 0.00000025,
    "output_cost_per_token": 0.0000015,
    "cache_read_input_token_cost": 0.000000025,
    "cache_creation_input_token_cost": 0.00000008333,
    "input_cost_per_audio_token": 0.0000005
  }
}

---

{
  "status": 200,
  "model_id": "c4890ba0-cce0-43f8-9935-eb46a6addcfe"
}

---

{
  "model_name": "openrouter/google/gemini-3.1-flash-lite-preview",
  "input_cost_per_token": 2.5e-07,
  "output_cost_per_token": 1.5e-06,
  "cache_read_input_token_cost": null,
  "cache_creation_input_token_cost": null,
  "input_cost_per_audio_token": null
}
RAW_BUFFERClick to expand / collapse

Summary

When updating model pricing via POST /model/update, basic pricing fields are persisted, but several advanced pricing fields are not persisted or not reflected back in GET /model/info.

Basic fields that appear to work

  • input_cost_per_token
  • output_cost_per_token

Advanced fields that appear not to persist / not to be reflected

  • cache_read_input_token_cost
  • cache_creation_input_token_cost
  • input_cost_per_token_above_272k_tokens
  • output_cost_per_token_above_272k_tokens
  • cache_read_input_token_cost_above_272k_tokens
  • some input_cost_per_audio_token updates

Environment

  • LiteLLM Proxy URL: private hosted instance
  • Tested on: 2026-04-16
  • Auth used: admin key with successful access to /model/update and /model/info

Expected behavior

After POST /model/update, all supported pricing fields should be persisted and reflected in GET /model/info, not just basic input/output pricing.

Actual behavior

POST /model/update returns 200 OK, but GET /model/info only reflects a subset of the fields.


Reproduction Case 1: GPT-5.4 advanced pricing

Request sent

{
  "model_info": { "id": "15b0d336-0b21-4337-87cb-9b1669d06799" },
  "model_name": "openrouter/openai/gpt-5.4",
  "litellm_params": {
    "input_cost_per_token": 0.0000025,
    "output_cost_per_token": 0.000015,
    "cache_read_input_token_cost": 0.00000025,
    "input_cost_per_token_above_272k_tokens": 0.000005,
    "output_cost_per_token_above_272k_tokens": 0.0000225,
    "cache_read_input_token_cost_above_272k_tokens": 0.0000005
  }
}

API response

{
  "status": 200,
  "model_id": "15b0d336-0b21-4337-87cb-9b1669d06799"
}

Readback from GET /model/info

{
  "model_name": "openrouter/openai/gpt-5.4",
  "input_cost_per_token": 2.5e-06,
  "output_cost_per_token": 1.5e-05,
  "cache_read_input_token_cost": null,
  "input_cost_per_token_above_272k_tokens": null,
  "output_cost_per_token_above_272k_tokens": null,
  "cache_read_input_token_cost_above_272k_tokens": null
}

Result

  • persisted: input_cost_per_token, output_cost_per_token
  • not reflected: cache_read_input_token_cost, input_cost_per_token_above_272k_tokens, output_cost_per_token_above_272k_tokens, cache_read_input_token_cost_above_272k_tokens

Reproduction Case 2: Gemini 2.5 Flash advanced pricing

Request sent

{
  "model_info": { "id": "8fa27d55-2e90-4095-b6d4-8f325ced1dbc" },
  "model_name": "openrouter/google/gemini-2.5-flash",
  "litellm_params": {
    "input_cost_per_token": 0.0000003,
    "output_cost_per_token": 0.0000025,
    "cache_read_input_token_cost": 0.00000003,
    "cache_creation_input_token_cost": 0.00000008333,
    "input_cost_per_audio_token": 0.000001
  }
}

API response

{
  "status": 200,
  "model_id": "8fa27d55-2e90-4095-b6d4-8f325ced1dbc"
}

Readback from GET /model/info

{
  "model_name": "openrouter/google/gemini-2.5-flash",
  "input_cost_per_token": 3e-07,
  "output_cost_per_token": 2.5e-06,
  "cache_read_input_token_cost": null,
  "cache_creation_input_token_cost": null,
  "input_cost_per_audio_token": 7e-07
}

Result

  • persisted: input_cost_per_token, output_cost_per_token
  • not reflected: cache_read_input_token_cost, cache_creation_input_token_cost
  • unexpected readback for audio pricing: requested 1e-06, read back 7e-07

Reproduction Case 3: Gemini 3.1 Flash Lite Preview advanced pricing

Request sent

{
  "model_info": { "id": "c4890ba0-cce0-43f8-9935-eb46a6addcfe" },
  "model_name": "openrouter/google/gemini-3.1-flash-lite-preview",
  "litellm_params": {
    "input_cost_per_token": 0.00000025,
    "output_cost_per_token": 0.0000015,
    "cache_read_input_token_cost": 0.000000025,
    "cache_creation_input_token_cost": 0.00000008333,
    "input_cost_per_audio_token": 0.0000005
  }
}

API response

{
  "status": 200,
  "model_id": "c4890ba0-cce0-43f8-9935-eb46a6addcfe"
}

Readback from GET /model/info

{
  "model_name": "openrouter/google/gemini-3.1-flash-lite-preview",
  "input_cost_per_token": 2.5e-07,
  "output_cost_per_token": 1.5e-06,
  "cache_read_input_token_cost": null,
  "cache_creation_input_token_cost": null,
  "input_cost_per_audio_token": null
}

Result

  • persisted: input_cost_per_token, output_cost_per_token
  • not reflected: cache_read_input_token_cost, cache_creation_input_token_cost, input_cost_per_audio_token

Additional notes

The field names above match LiteLLM pricing field naming used in pricing schemas / model info, e.g.:

  • input_cost_per_token
  • output_cost_per_token
  • cache_creation_input_token_cost
  • cache_read_input_token_cost
  • input_cost_per_token_above_272k_tokens
  • output_cost_per_token_above_272k_tokens

This may indicate one of the following:

  1. /model/update only persists a subset of pricing fields
  2. advanced pricing fields should be sent in model_info instead of litellm_params
  3. provider/model pricing map overrides custom advanced pricing fields on readback
  4. /model/info does not expose all persisted fields

Questions

  1. Which pricing fields are officially supported in POST /model/update?
  2. Should advanced custom pricing fields be passed under litellm_params or model_info?
  3. Why do these fields return 200 OK on update but not appear in GET /model/info?
  4. Is there a known issue where provider pricing overrides custom advanced pricing values?

extent analysis

TL;DR

The issue can be resolved by verifying the supported pricing fields in POST /model/update and ensuring that advanced custom pricing fields are passed correctly, either under litellm_params or model_info, depending on the official documentation.

Guidance

  1. Verify supported pricing fields: Check the official documentation to confirm which pricing fields are supported in POST /model/update.
  2. Check field naming and structure: Ensure that the field names used in the request match the expected naming convention, and that advanced pricing fields are passed in the correct structure (litellm_params or model_info).
  3. Test with a minimal request: Try sending a request with only the basic pricing fields (input_cost_per_token and output_cost_per_token) to see if they are persisted and reflected correctly.
  4. Investigate provider pricing overrides: If custom advanced pricing fields are being overridden by provider pricing, investigate if there is a known issue or a configuration option to prevent this.

Example

No code snippet is provided as the issue is more related to the understanding of the API and its expected input/output structure.

Notes

The solution may depend on the specific implementation of the POST /model/update endpoint and the GET /model/info endpoint, as well as the official documentation of the API. It is essential to verify the supported pricing fields and the correct way to pass advanced custom pricing fields.

Recommendation

Apply a workaround by verifying the supported pricing fields and ensuring that advanced custom pricing fields are passed correctly. This approach allows for a more targeted solution and helps to identify potential issues with the API implementation.

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…

FAQ

Expected behavior

After POST /model/update, all supported pricing fields should be persisted and reflected in GET /model/info, not just basic input/output pricing.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING