### What happened?
**Summary**
When using fine-tuned OpenAI models and specifying `input_cost_per_token` / `output_cost_per_token` in the `model_info` section of the config YAML, LiteLLM does not report `response_cost` in logs or in the `x-litellm-response-cost` header. Instead, it either shows `0.0` or picks the cost from the `base_model` rather than the overridden custom pricing.
---
### Minimal Repro Setup
1. **Config (`config.yaml`)**
```yaml
model_list:
- model_name: openai/ft:gpt-4.1-2025-04-14:*
litellm_params:
model: openai/ft:gpt-4.1-2025-04-14:*
api_key: os.environ/OPENAI_DEFAULT_API_KEY
model_info:
id: openai-fine-tuned
input_cost_per_token: 0.000003
output_cost_per_token: 0.000012
litellm_settings:
json_logs: true
- Run LiteLLM proxy
litellm --config config.yaml
- Send a test request
curl http://localhost:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-<proxy-key>" \
-d '{
"model": "openai/ft:gpt-4.1-2025-04-14:my-org:example",
"messages": [{"role": "user", "content": "Hello!"}]
}' -i
Expected Behavior
- LiteLLM should calculate response cost using the configured
input_cost_per_token / output_cost_per_token.
response_cost should be present in logs.
x-litellm-response-cost header should match the calculated value.
Actual Behavior
response_cost is logged as 0.0 (or absent).
- No
x-litellm-response-cost header is returned.
- If
base_model is set, LiteLLM falls back to base model pricing instead of the custom values.
- Example:
- Configured:
0.000003 * 26 + 0.000012 * 165 = 0.002058
- Reported:
0.0025725 (base model pricing).
Additional Context
- Works correctly with non-fine-tuned models (e.g.
bedrock/anthropic.claude-3-5-haiku-20241022-v1:0).
- @ishaan-jaff confirmed repro on Jul 30.
Expected Behavior
input_cost_per_token/output_cost_per_token.response_costshould be present in logs.x-litellm-response-costheader should match the calculated value.Actual Behavior
response_costis logged as0.0(or absent).x-litellm-response-costheader is returned.base_modelis set, LiteLLM falls back to base model pricing instead of the custom values.0.000003 * 26 + 0.000012 * 165 = 0.0020580.0025725(base model pricing).Additional Context
bedrock/anthropic.claude-3-5-haiku-20241022-v1:0).