Skip to content

fix(responses): log and bill every round of non-stream MCP auto-execute - #43667

Merged
mateo-berri merged 21 commits into
mainfrom
litellm_mcp_auto_execute_log_final_round
Oct 16, 2026
Merged

mateo-berri merged 21 commits into
mainfrom
litellm_mcp_auto_execute_log_final_round

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Non-stream MCP auto-execute on /v1/responses logged round 1's function_call
  • It billed one of its two model calls, under an id the client never got

How it solves it:

  • The request logs once with the client's response, billing both rounds
  • Failed follow-ups, disconnects, and failed retries still bill round 1
  • MCP tool rows join the request's session and trace
  • Bridged providers like Anthropic answer instead of a 400

Intentional product change: usage and x-litellm-response-cost cover both model calls, and a bridged MCP request answers 200, not 400

User Flow

Before: the request answers right, but the logs show the tool call at half the cost

  1. The proxy admin adds an MCP server and a gpt-5.6 deployment
  2. The developer sends POST https://litellm-domain/v1/responses with an mcp tool on litellm_proxy/mcp/<server>, "require_approval": "never", no streaming
  3. The reply is 200 with the answer and x-litellm-response-cost: 0.000692
  4. https://litellm-domain/ui/?page=logs shows the tool call logged at $0.00066, under an id the client never got

After: one row logs the answer and both model calls' cost

  1. The proxy admin adds an MCP server and a gpt-5.6 deployment
  2. The developer sends the same request
  3. The reply is 200 with the answer, usage summed over both calls, and x-litellm-response-cost: 0.001352
  4. https://litellm-domain/ui/?page=logs shows the answer logged at $0.001352 under the client's response id

Affected release

Regression in v1.103.0 with a post-call guardrail, which flipped the logged response to the tool call. Without one, every release had the bug

Design decisions

Sixteen choices this PR makes and why
  • Rounds become internal sub-calls on the request's logging object, like RAG sub-calls, so the outer call stays the one place that logs
  • Cost sums each round's own price, since tiered rates and tool charges do not show in usage. A round with no numeric cost makes the outer call price the summed usage instead
  • The cost breakdown sums every charge, keeps the last round's discount_percent and margin_percent since they are rates, and is dropped when a round has none, since a partial one would disagree with the billed cost
  • Usage sums field by field, nested token details included, and flags like is_byok keep the last round's value
  • A failed follow-up call or tool step, or a client disconnect that cancels one, puts round 1's usage and cost on the request's failure row, since the provider already charged for it. The client still gets the original error. A router retry or fallback sets that stash aside for the request's failure row, so a recovered request's row bills only the attempt the client got, and a request that fails every attempt bills each attempt's paid round 1 once
  • The tool call's id is the request's call id plus the model's tool call id, <x-litellm-call-id>_<call id>. Main reused the request's call id as is, so the tool's spend row and the request's failure row collided, and the failure row was dropped on insert. A fresh uuid would avoid the collision but lose the link to the request, so the id is derived instead. The tool row also gets the request's trace id, so it shares the request's session_id
  • The request's success event now runs from the tool listing to the final answer, so its logged duration and the latency that lowest-latency routing reads include the MCP tool's time. The alternatives were moving the logged start time, which would misreport when the request ran, or a per-round latency event just for the router, which this PR does not add
  • The tool call's log continues the request's trace through existing_trace_id, so Langfuse keeps one trace per request, named litellm-aresponses, instead of the tool call taking over the trace and its name
  • The tool listing joins the request's session and trace the same way, reading the trace id from the metadata the Langfuse logger reads, litellm_metadata when the request has one. It runs before the model call, so it takes the trace id the request has at that point. On a bridged first turn that is the caller's trace id, which the bridged chat completion logs under
  • On a provider bridged through chat completions, the follow-up no longer chains on round 1's id, since round 1 now writes no row of its own to chain from. It sends the client's input, the tool calls and their results, and round 1's reasoning, which a thinking model needs back. Main answered this request with 400, because its follow-up replayed round 1's tool_use with no tool_result
  • The tools are fetched once per request. The second fetch after the answer only rebuilt the list the response already carried
  • A later turn's previous_response_id lookup finds the MCP turn under the id the client got, in the proxy-issued form or the decoded one, skips the tool rows, and replays the turn's answer and reasoning from the logged response, leaving out the tool list and tool results that response carries. The ids go to Postgres as one array parameter
  • A sub-call served from the response cache fires no callbacks of its own and adds $0, the price main gives every cache hit. A parent row whose final response came from the cache gets the cache-hit id suffix, since that response id already belongs to the row that cached it
  • The internal-call gate now covers sync success callbacks too, so round 1 cannot take their first-wins slot. RAG and emulated file search sub-calls stop firing sync callbacks early as well, which is the intent those paths already had for async callbacks. Their Langfuse traces match main's, one trace per request carrying the request's cost
  • A cost_margin_config fixed_amount is a per-request fee by its docs, so when both rounds were charged the sum drops the repeated one. A round served from the cache charged no fee, so nothing is dropped then
  • Streaming MCP auto-execute is left unchanged

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Last updated: 1dda7a9. QA and /live-pr-risk ran on 6abed9d, the last commit with a product diff

Live runs on OpenAI gpt-5.6 and Anthropic claude-haiku-5-5, each leg a 2-worker proxy with its own Postgres and Redis, read through /spend/logs and Langfuse

Case Before (f81e657) After (6abed9d)
With or without guardrail tool call logged, $0.00066 answer logged, $0.001352
Claude MCP, reasoning on or off 400, tool_use without tool_result 200 answer
Next turn after Claude MCP no MCP turn to continue recalls PING
Sessions and Langfuse traces 3 of each, one trace renamed 1 of each, 3 observations
Claude Langfuse trace 400, trace renamed 1 trace, 3 observations
Follow-up call fails success row, $0.000508 failure row, $0.000508
Retry or fallback recovers tool call logged, $0.00066 answer logged, $0.001352
Every retry fails 500, success row $0.00066 500, failure row $0.00132
Retry fails on its first call 500, success row $0.00066 500, failure row $0.00066
Tool row id the request's call id call id plus tool call id
Disconnect mid-tool $0 failure row, stray $0.000728 row failure row, $0.000728
Fixed margin fee round 1 + fee, $0.00166 both rounds + one fee, $0.002352
First round cached paid round unbilled, $0 paid round billed, $0.000724

Unchanged cases and the fallback case are in more cases

Configs, MCP servers, and shell helpers are in the shared setup

Before (f81e657)

Without a guardrail

Config noguard.yaml

  1. Send the request
curl -s -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -i '^x-litellm-response-cost:' h.txt
summarize_response body.json
HTTP 200
x-litellm-response-cost: 0.000692
{"id":"resp_KJOLnDrSob-_kkp","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":148,"output_tokens":5}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"5e5526ec-eaf3-4b30-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"9edbcdf0-0caf-47d3-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"8b977e2b-45ef-46b8-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the response each row logged
logged_types "$START" "$END"
{"logged_output_types":["function_call"],"logged_message":null}
{"logged_output_types":[],"logged_message":null}
With a post-call guardrail

Config guard.yaml

  1. Send the request
curl -s -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -i '^x-litellm-response-cost:' h.txt
summarize_response body.json
HTTP 200
x-litellm-response-cost: 0.000692
{"id":"resp_pxDHBrQpa1HcrL-","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":148,"output_tokens":5}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"566efd53-8fb0-49de-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"2a735cec-ccda-420d-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"8664127d-0b8a-4910-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the response each row logged
logged_types "$START" "$END"
{"logged_output_types":["function_call"],"logged_message":null}
{"logged_output_types":[],"logged_message":null}
Claude through the chat completions bridge

Config bridged.yaml

  1. Send the MCP request to claude-haiku-5-5
send_any claude "$REQ_CLAUDE_MCP"
HTTP 400
x-litellm-response-cost: 0
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: t"}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id claude.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"c5399a8a-2592-4d5e-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"d87a899f","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"chatcmpl-7553f3a0-b3","spend":0.0000663,"prompt_tokens":413,"completion_tokens":50,"cache_hit":"None","session":"d87a899f","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"cc4d611c-4f9b-44d6-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"d87a899f","matches_client_response_id":false}
  1. Send it with reasoning on
send_any claude_think "$REQ_CLAUDE_THINK"
HTTP 400
x-litellm-response-cost: 0
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: t"}
  1. Read that request's spend rows
session_rows "$START" "$END" "$(jq -r .id claude_think.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"b113b074-2101-41e2-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"877331a8","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"chatcmpl-d3ad28cf-63","spend":0.0001567,"prompt_tokens":432,"completion_tokens":227,"cache_hit":"None","session":"877331a8","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"1499db11-79d9-41ff-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"877331a8","matches_client_response_id":false}
A next turn on Claude after the MCP turn

Config bridged.yaml, with 20 seconds between a turn and its next turn

  1. Send a plain turn
send_any plain_turn "$REQ_CLAUDE_PLAIN"
HTTP 200
x-litellm-response-cost: 4.6e-06
{"id":"resp_rDegBro9re5yv6P","output_types":["message"],"text":["OK"],"usage":{"input_tokens":26,"output_tokens":4}}
  1. Ask about it with previous_response_id
send_any plain_next "$(next_turn plain_turn)"
HTTP 200
x-litellm-response-cost: 3.5799999999999996e-05
{"id":"resp_spuwyRcp_IDw83s","output_types":["reasoning","message"],"text":["PING"],"usage":{"input_tokens":63,"output_tokens":59}}
  1. Send the MCP turn
send_any mcp_turn "$REQ_CLAUDE_MCP"
HTTP 400
x-litellm-response-cost: 0
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: t"}
  1. Ask about it with previous_response_id
send_any mcp_next "$(next_turn mcp_turn)"
skipped: the MCP turn returned no response id
The request's Langfuse trace

Config bridged.yaml, with TAG a fresh tag per run

  1. Send the MCP request with the tag
send_any lf "$REQ_MCP" -H "x-litellm-tags: $TAG"
HTTP 200
x-litellm-response-cost: 0.000692
{"id":"resp_2LHjpVA7-e3IlEX","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":148,"output_tokens":5}}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id lf.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"9d664064-ab76-4969-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"7cce59f5","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"cache_hit":"None","session":"f8c730a1","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"0595d131-6951-47cd-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"7cce59f5","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"3a53321c-1ab8-481a-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"5b98e166","matches_client_response_id":false}
  1. Read the tagged traces
langfuse_traces $TAG | jq -c '.data | sort_by(.timestamp)[] | {name, tags, observations: (.observations | length), cost: .totalCost}'
{"name":"litellm-call_mcp_tool","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-e02b4d84"],"observations":2,"cost":0}
{"name":"litellm-aresponses","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-e02b4d84"],"observations":1,"cost":0.00066}
{"name":"litellm-list_mcp_tools","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-e02b4d84"],"observations":1,"cost":0}
  1. Read each trace's observations
for id in $(langfuse_traces $TAG | jq -r '.data[].id'); do
  langfuse_observations $id | jq -c '[.data | sort_by(.startTime)[] | {name, type}]'
done
[{"name":"litellm-list_mcp_tools","type":"GENERATION"}]
[{"name":"litellm-aresponses","type":"GENERATION"}]
[{"name":"litellm-list_mcp_tools","type":"GENERATION"},{"name":"litellm-call_mcp_tool","type":"GENERATION"}]
The Langfuse trace of a Claude MCP request

Config bridged.yaml, with TAG a fresh tag per run

  1. Send the MCP request with the tag
send_any lf_claude "$REQ_CLAUDE_MCP" -H "x-litellm-tags: $TAG"
HTTP 400
x-litellm-response-cost: 0
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.2: `tool_use` ids were found without `tool_result` blocks immediately after: t"}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id lf_claude.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"338ba318-f139-4291-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"dce4b837","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"chatcmpl-24a9f97d-61","spend":0.0000663,"prompt_tokens":413,"completion_tokens":50,"cache_hit":"None","session":"dce4b837","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"b1c43f10-5f71-4efa-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"dce4b837","matches_client_response_id":false}
  1. Read the tagged traces
langfuse_traces $TAG | jq -c '.data | sort_by(.timestamp)[] | {name, tags, observations: (.observations | length), cost: .totalCost}'
{"name":"litellm-call_mcp_tool","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-48998f4c"],"observations":3,"cost":0.0000663}
  1. Read each trace's observations
for id in $(langfuse_traces $TAG | jq -r '.data[].id'); do
  langfuse_observations $id | jq -c '[.data | sort_by(.startTime)[] | {name, type}]'
done
[{"name":"litellm-list_mcp_tools","type":"GENERATION"},{"name":"litellm-aresponses","type":"GENERATION"},{"name":"litellm-call_mcp_tool","type":"GENERATION"}]
A follow-up call fails

Config noguard.yaml, with the big server's tool result too large for the follow-up call

  1. Send the request
curl -s -m 600 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_BIG" -o fail.json -w 'HTTP %{http_code}\n'
jq -c '{error_type: .error.type, error_code: .error.code, message: (.error.message // "")[0:160]}' fail.json
HTTP 400
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: OpenAIException - {\n  \"error\": {\n    \"message\": \"Your input exceeds the context window of this model. Please adjust your input and try "}
  1. Read the request's spend rows
show_rows "$START" "$END" ""
{"call_type":"list_mcp_tools","status":"success","request_id":"69b14d0c-0f4a-4ab9-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.000508,"prompt_tokens":52,"completion_tokens":15,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"074dfa9f-2fc3-4b5a-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Compare each row's full id with the request's call id
row_ids "$START" "$END" h.txt
x-litellm-call-id: 074dfa9f-2fc3-4b5a-9a83-94fe1672b2d9
{"call_type":"list_mcp_tools","status":"success","request_id":"69b14d0c-0f4a-4ab9-921b-514f63e9cb3d"}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN0b21fbGxtX3Byb3ZpZGVyOm9wZW5haTttb2RlbF9pZDphZTIyN2Q0MjEzNThhOGM4YWUzMDYxMjVjYjllZDcyOWQ1NzcwNjM3NjA2ZGJmOTcwM2VlNTU5YWRhYzkwMDhkO3Jlc3BvbnNlX2lkOnJlc3BfMGRhMWEwMTZmZDRkNjc3ZjAwNmFkMjQ2MjY2MDMwODdkMjlhMzZhZjY1NTZjZDRmOTM="}
{"call_type":"call_mcp_tool","status":"success","request_id":"074dfa9f-2fc3-4b5a-9a83-94fe1672b2d9"}
A retry recovers a failed follow-up

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2, then send the request
curl -s "$FLAKY/__reset?fail_on=2"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 200
x-litellm-call-id: 12235692-36d8-4653-b4ac-731eeca28780
x-litellm-response-cost: 0.000692
x-litellm-model-group: gpt-5.6
x-litellm-attempted-retries: 1
x-litellm-attempted-fallbacks: 0
{"id":"resp_Z8yYpR4WbCH8A-K","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":148,"output_tokens":5}}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> api.openai.com
POST /v1/responses #4 -> api.openai.com
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"15f8a910-9b98-474c-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"aresponses","status":"success","model_group":"gpt-5.6","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"12235692-36d8-4653-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"8deb5e44-659e-41bc-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"b0574bff-c4aa-43e7-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
Every retry fails with no fallback

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2 and 4, then send the request
curl -s "$FLAKY/__reset?fail_on=2,4"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "${REQ_MCP/gpt-5.6/gpt-5.6-no-fallback}" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 500
x-litellm-call-id: b194a248-c373-442c-8c1f-e499fe3c1c04
x-litellm-response-cost: 0
{"error_type":"internal_server_error","message":"litellm.InternalServerError: InternalServerError: OpenAIException - {\"error\": {\"message\": \"The server had an error while"}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2, 4]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> api.openai.com
POST /v1/responses #4 -> injected 500
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"1a761439-dc04-4d28-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"aresponses","status":"success","model_group":"gpt-5.6-no-fallback","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"b194a248-c373-442c-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"9d809ac8-b6ac-4a1e-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
The retry fails on its first call

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2 and 3, then send the request
curl -s "$FLAKY/__reset?fail_on=2,3"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "${REQ_MCP/gpt-5.6/gpt-5.6-no-fallback}" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 500
x-litellm-call-id: f32310ac-4986-4a39-8423-51cbec74b75b
x-litellm-response-cost: 0
{"error_type":"internal_server_error","message":"litellm.InternalServerError: InternalServerError: OpenAIException - {\"error\": {\"message\": \"The server had an error while"}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2, 3]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> injected 500
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"2dd56655-036e-491c-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"aresponses","status":"success","model_group":"gpt-5.6-no-fallback","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"f32310ac-4986-4a39-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"e24943c5-1388-4be9-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
The client disconnects during the tool call

Config disconnect.yaml, with curl -m 20 against a tool that takes 40 seconds

  1. Send the request and hang up after 20 seconds
curl -s -m 20 "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_SLOW" -o disconnect.body.json -w 'HTTP %{http_code}\n'
print "curl exit $?"
HTTP 000
curl exit 28
  1. Read the request's spend rows after the tool would have finished
show_rows "$START" "$END" ""
{"call_type":"aresponses","status":"failure","request_id":"328f7294-2622-4056-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"False","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"8e5f6576-fd05-4281-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.000728,"prompt_tokens":77,"completion_tokens":21,"cache_hit":"None","matches_client_response_id":false}
A fixed margin fee

Config margin.yaml

  1. Send the request
send_mcp margin "$REQ_MCP"
HTTP 200
x-litellm-response-cost: 0.001692
{"id":"resp_ED83WHgb2UvRkKT","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":148,"output_tokens":5}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id margin.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"ff9ee52f-a473-4303-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.00166,"prompt_tokens":70,"completion_tokens":19,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"65f5a3cc-abae-4a6d-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"d915f20c-f286-4666-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the logged cost breakdown
rows "$START" "$END" | jq -c '.data | sort_by(.startTime)[] | select(.call_type=="aresponses") | .metadata.cost_breakdown | {original_cost, margin_fixed_amount, margin_total_amount, total_cost}'
{"original_cost":0.00066,"margin_fixed_amount":0.001,"margin_total_amount":0.001,"total_cost":0.00166}
First round served from the cache

Config cache.yaml, a new prompt sent with require_approval: always first, which caches round 1 only

  1. Send the approval request
send_mcp rc_warm "$REQ_PONG_ALWAYS"
HTTP 200
x-litellm-response-cost: 0.00068
{"id":"resp_9nLJ6COL-uVy2Lv","output_types":["function_call"],"text":[],"usage":{"input_tokens":70,"output_tokens":20}}
  1. Send the same prompt with require_approval: never
send_mcp rc_mixed "$REQ_PONG_NEVER"
HTTP 200
{"id":"resp_EG9FrR6tQO-0hle","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PONG"],"usage":{"input_tokens":151,"output_tokens":6}}
  1. Read that request's spend rows
show_rows "$START" "$END" "$(jq -r .id rc_mixed.body.json)"
{"call_type":"list_mcp_tools","status":"success","request_id":"c5705c3e-1b04-4ba5-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"aresponses","status":"success","request_id":"resp_bGl0ZWxsbTpjdXN","spend":0.0,"prompt_tokens":70,"completion_tokens":20,"cache_hit":"True","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"80aefd17-2136-467b-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"e5236515-65f6-424a-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}

After (6abed9d)

Without a guardrail

Config noguard.yaml

  1. Send the request
curl -s -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -i '^x-litellm-response-cost:' h.txt
summarize_response body.json
HTTP 200
x-litellm-response-cost: 0.001352
{"id":"resp_20APBdXxRKeJWu2","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":218,"output_tokens":24}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_20APBdXxRKeJWu2","spend":0.001352,"prompt_tokens":218,"completion_tokens":24,"cache_hit":"None","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"194b38af-3a90-4cbb-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"d9cd73e4-3fd2-4a95-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the response each row logged
logged_types "$START" "$END"
{"logged_output_types":["message","mcp_tools_fetched","tool_execution_results"],"logged_message":null}
{"logged_output_types":[],"logged_message":null}
With a post-call guardrail

Config guard.yaml

  1. Send the request
curl -s -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -i '^x-litellm-response-cost:' h.txt
summarize_response body.json
HTTP 200
x-litellm-response-cost: 0.001352
{"id":"resp_KQYGrphoMoy8q-E","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":218,"output_tokens":24}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_KQYGrphoMoy8q-E","spend":0.001352,"prompt_tokens":218,"completion_tokens":24,"cache_hit":"None","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"72d00d75-d7ca-4a9f-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"b493d194-3738-4856-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the response each row logged
logged_types "$START" "$END"
{"logged_output_types":["message","mcp_tools_fetched","tool_execution_results"],"logged_message":null}
{"logged_output_types":[],"logged_message":null}
Claude through the chat completions bridge

Config bridged.yaml

  1. Send the MCP request to claude-haiku-5-5
send_any claude "$REQ_CLAUDE_MCP"
HTTP 200
x-litellm-response-cost: 0.0001153
{"id":"resp_TFFZWzmlvfA3BAt","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":883,"output_tokens":54}}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id claude.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_TFFZWzmlvfA3BAt","spend":0.0001153,"prompt_tokens":883,"completion_tokens":54,"cache_hit":"None","session":"03d59a7f","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"a9d4f63c-5e4f-41a6-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"03d59a7f","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"c5c68977-dc76-42ad-9","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"03d59a7f","matches_client_response_id":false}
  1. Send it with reasoning on
send_any claude_think "$REQ_CLAUDE_THINK"
HTTP 200
x-litellm-response-cost: 0.0002529
{"id":"resp_6X5k4GtFA5bJO1f","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":1144,"output_tokens":277}}
  1. Read that request's spend rows
session_rows "$START" "$END" "$(jq -r .id claude_think.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_6X5k4GtFA5bJO1f","spend":0.0002529,"prompt_tokens":1144,"completion_tokens":277,"cache_hit":"None","session":"fa962b31","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"affc93e4-0303-44be-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"fa962b31","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"9009613d-e972-4d9e-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"fa962b31","matches_client_response_id":false}
A next turn on Claude after the MCP turn

Config bridged.yaml, with 20 seconds between a turn and its next turn

  1. Send a plain turn
send_any plain_turn "$REQ_CLAUDE_PLAIN"
HTTP 200
x-litellm-response-cost: 4.6e-06
{"id":"resp_sWeXZeJ09ZeX6Od","output_types":["message"],"text":["OK"],"usage":{"input_tokens":26,"output_tokens":4}}
  1. Ask about it with previous_response_id
send_any plain_next "$(next_turn plain_turn)"
HTTP 200
x-litellm-response-cost: 3.18e-05
{"id":"resp_bBw7Lpu5qRfrDC_","output_types":["reasoning","message"],"text":["PING"],"usage":{"input_tokens":63,"output_tokens":51}}
  1. Send the MCP turn
send_any mcp_turn "$REQ_CLAUDE_MCP"
HTTP 200
x-litellm-response-cost: 0.0001153
{"id":"resp_RBgpSdvnEkR9Lo0","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":883,"output_tokens":54}}
  1. Ask about it with previous_response_id
send_any mcp_next "$(next_turn mcp_turn)"
HTTP 200
x-litellm-response-cost: 4.4999999999999996e-05
{"id":"resp_xTf8LGGWzDvhJzV","output_types":["reasoning","message"],"text":["PING"],"usage":{"input_tokens":75,"output_tokens":75}}
The request's Langfuse trace

Config bridged.yaml, with TAG a fresh tag per run

  1. Send the MCP request with the tag
send_any lf "$REQ_MCP" -H "x-litellm-tags: $TAG"
HTTP 200
x-litellm-response-cost: 0.001352
{"id":"resp_qbwfqOOxzUcUJoF","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":218,"output_tokens":24}}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id lf.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_qbwfqOOxzUcUJoF","spend":0.001352,"prompt_tokens":218,"completion_tokens":24,"cache_hit":"None","session":"511827e9","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"b186f4eb-6b15-4a43-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"511827e9","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"73d3d8ff-5f95-48ee-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"511827e9","matches_client_response_id":false}
  1. Read the tagged traces
langfuse_traces $TAG | jq -c '.data | sort_by(.timestamp)[] | {name, tags, observations: (.observations | length), cost: .totalCost}'
{"name":"litellm-aresponses","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-903ef634"],"observations":3,"cost":0.001352}
  1. Read each trace's observations
for id in $(langfuse_traces $TAG | jq -r '.data[].id'); do
  langfuse_observations $id | jq -c '[.data | sort_by(.startTime)[] | {name, type}]'
done
[{"name":"litellm-aresponses","type":"GENERATION"},{"name":"litellm-list_mcp_tools","type":"GENERATION"},{"name":"litellm-call_mcp_tool","type":"GENERATION"}]
The Langfuse trace of a Claude MCP request

Config bridged.yaml, with TAG a fresh tag per run

  1. Send the MCP request with the tag
send_any lf_claude "$REQ_CLAUDE_MCP" -H "x-litellm-tags: $TAG"
HTTP 200
x-litellm-response-cost: 0.0001153
{"id":"resp_c9_fcDKXjzI1TmN","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":883,"output_tokens":54}}
  1. Read the request's spend rows
session_rows "$START" "$END" "$(jq -r .id lf_claude.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_c9_fcDKXjzI1TmN","spend":0.0001153,"prompt_tokens":883,"completion_tokens":54,"cache_hit":"None","session":"4ad61ae1","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"de98c26f-0746-4275-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"4ad61ae1","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"0fa729a7-556e-4f8d-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","session":"4ad61ae1","matches_client_response_id":false}
  1. Read the tagged traces
langfuse_traces $TAG | jq -c '.data | sort_by(.timestamp)[] | {name, tags, observations: (.observations | length), cost: .totalCost}'
{"name":"litellm-aresponses","tags":["User-Agent: curl","User-Agent: curl/8.5.0","qa-mcp-dc7075bd"],"observations":3,"cost":0.0001153}
  1. Read each trace's observations
for id in $(langfuse_traces $TAG | jq -r '.data[].id'); do
  langfuse_observations $id | jq -c '[.data | sort_by(.startTime)[] | {name, type}]'
done
[{"name":"litellm-aresponses","type":"GENERATION"},{"name":"litellm-list_mcp_tools","type":"GENERATION"},{"name":"litellm-call_mcp_tool","type":"GENERATION"}]
A follow-up call fails

Config noguard.yaml, with the big server's tool result too large for the follow-up call

  1. Send the request
curl -s -m 600 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_BIG" -o fail.json -w 'HTTP %{http_code}\n'
jq -c '{error_type: .error.type, error_code: .error.code, message: (.error.message // "")[0:160]}' fail.json
HTTP 400
{"error_type":"invalid_request_error","error_code":"400","message":"litellm.BadRequestError: OpenAIException - {\n  \"error\": {\n    \"message\": \"Your input exceeds the context window of this model. Please adjust your input and try "}
  1. Read the request's spend rows
show_rows "$START" "$END" ""
{"call_type":"aresponses","status":"failure","request_id":"76bbf129-c6f2-4da6-a","spend":0.000508,"prompt_tokens":52,"completion_tokens":15,"cache_hit":"False","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"a700781b-db7a-4394-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"76bbf129-c6f2-4da6-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Compare each row's full id with the request's call id
row_ids "$START" "$END" h.txt
x-litellm-call-id: 76bbf129-c6f2-4da6-a07b-dd04ead04a8e
{"call_type":"aresponses","status":"failure","request_id":"76bbf129-c6f2-4da6-a07b-dd04ead04a8e"}
{"call_type":"list_mcp_tools","status":"success","request_id":"a700781b-db7a-4394-a99a-052f8643318d"}
{"call_type":"call_mcp_tool","status":"success","request_id":"76bbf129-c6f2-4da6-a07b-dd04ead04a8e_call_WBiUZom0PbwAdhudfZPVZsbv"}
A retry recovers a failed follow-up

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2, then send the request
curl -s "$FLAKY/__reset?fail_on=2"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_MCP" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 200
x-litellm-call-id: 9151abbd-a449-4bdc-ae31-29e3cc467d7c
x-litellm-response-cost: 0.001352
x-litellm-model-group: gpt-5.6
x-litellm-attempted-retries: 1
x-litellm-attempted-fallbacks: 0
{"id":"resp_cNLEZ-J46En6p_o","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":218,"output_tokens":24}}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> api.openai.com
POST /v1/responses #4 -> api.openai.com
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"0157adf0-99a5-4833-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"9151abbd-a449-4bdc-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"aresponses","status":"success","model_group":"gpt-5.6","request_id":"resp_cNLEZ-J46En6p_o","spend":0.001352,"prompt_tokens":218,"completion_tokens":24,"matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"75c76d87-f044-4c6b-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"9151abbd-a449-4bdc-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
Every retry fails with no fallback

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2 and 4, then send the request
curl -s "$FLAKY/__reset?fail_on=2,4"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "${REQ_MCP/gpt-5.6/gpt-5.6-no-fallback}" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 500
x-litellm-call-id: 2d08cbd1-0df4-4d70-8993-10bd2ba7e02a
x-litellm-response-cost: 0
{"error_type":"internal_server_error","message":"litellm.InternalServerError: InternalServerError: OpenAIException - {\"error\": {\"message\": \"The server had an error while"}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2, 4]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> api.openai.com
POST /v1/responses #4 -> injected 500
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"aresponses","status":"failure","model_group":"gpt-5.6-no-fallback","request_id":"2d08cbd1-0df4-4d70-8","spend":0.00132,"prompt_tokens":140,"completion_tokens":38,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"1df01844-e401-495e-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"2d08cbd1-0df4-4d70-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"6acc683a-1a16-484e-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"2d08cbd1-0df4-4d70-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
The retry fails on its first call

Config retry.yaml, with $FLAKY a forwarder in front of api.openai.com that answers the numbered POST /v1/responses calls with OpenAI's 500 server_error

  1. Make the forwarder fail call 2 and 3, then send the request
curl -s "$FLAKY/__reset?fail_on=2,3"
curl -s -m 300 -D h.txt "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "${REQ_MCP/gpt-5.6/gpt-5.6-no-fallback}" -o body.json -w 'HTTP %{http_code}\n'
grep -iE '^x-litellm-(response-cost|call-id|attempted-retries|attempted-fallbacks|model-group):' h.txt
jq -c 'if .error then {error_type: .error.type, message: (.error.message // "")[0:120]} else {id: .id[0:20], output_types: [.output[]?.type], text: [.output[]? | select(.type=="message") | .content[].text], usage: {input_tokens: .usage.input_tokens, output_tokens: .usage.output_tokens}} end' body.json
HTTP 500
x-litellm-call-id: 642f7480-bd36-4cae-8040-16eef0041224
x-litellm-response-cost: 0
{"error_type":"internal_server_error","message":"litellm.InternalServerError: InternalServerError: OpenAIException - {\"error\": {\"message\": \"The server had an error while"}
  1. Read the forwarder's log
cat flaky.log
reset fail_on=[2, 3]
POST /v1/responses #1 -> api.openai.com
POST /v1/responses #2 -> injected 500
POST /v1/responses #3 -> injected 500
  1. Read the request's spend rows
rows "$START" "$END" | jq -c --arg cid "$(jq -r .id body.json)" '.data | sort_by(.startTime)[] | {call_type, status, model_group, request_id: .request_id[0:20], spend, prompt_tokens, completion_tokens, matches_client_response_id: (.request_id==$cid)}'
{"call_type":"aresponses","status":"failure","model_group":"gpt-5.6-no-fallback","request_id":"642f7480-bd36-4cae-8","spend":0.00066,"prompt_tokens":70,"completion_tokens":19,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"52ab6759-fc00-43ec-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","model_group":"","request_id":"642f7480-bd36-4cae-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","model_group":"","request_id":"563d6ac9-c8bd-4531-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"matches_client_response_id":false}
The client disconnects during the tool call

Config disconnect.yaml, with curl -m 20 against a tool that takes 40 seconds

  1. Send the request and hang up after 20 seconds
curl -s -m 20 "$B/v1/responses" "${H[@]}" "${JSON[@]}" -d "$REQ_SLOW" -o disconnect.body.json -w 'HTTP %{http_code}\n'
print "curl exit $?"
HTTP 000
curl exit 28
  1. Read the request's spend rows after the tool would have finished
show_rows "$START" "$END" ""
{"call_type":"aresponses","status":"failure","request_id":"5f00428d-d455-4e4a-a","spend":0.000728,"prompt_tokens":77,"completion_tokens":21,"cache_hit":"False","matches_client_response_id":false}
{"call_type":"list_mcp_tools","status":"success","request_id":"4141465c-75bb-471e-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
A fixed margin fee

Config margin.yaml

  1. Send the request
send_mcp margin "$REQ_MCP"
HTTP 200
x-litellm-response-cost: 0.002352
{"id":"resp_4BpVz8AmVWH9-Df","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PING"],"usage":{"input_tokens":218,"output_tokens":24}}
  1. Read the request's spend rows
show_rows "$START" "$END" "$(jq -r .id margin.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_4BpVz8AmVWH9-Df","spend":0.002352,"prompt_tokens":218,"completion_tokens":24,"cache_hit":"None","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"c2b971ef-7dd7-477c-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"69f2c739-a22b-4a7c-8","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
  1. Read the logged cost breakdown
rows "$START" "$END" | jq -c '.data | sort_by(.startTime)[] | select(.call_type=="aresponses") | .metadata.cost_breakdown | {original_cost, margin_fixed_amount, margin_total_amount, total_cost}'
{"original_cost":0.001352,"margin_fixed_amount":0.001,"margin_total_amount":0.001,"total_cost":0.002352}
First round served from the cache

Config cache.yaml, a new prompt sent with require_approval: always first, which caches round 1 only

  1. Send the approval request
send_mcp rc_warm "$REQ_PONG_ALWAYS"
HTTP 200
x-litellm-response-cost: 0.00068
{"id":"resp_uXQgUiM2Buy5WjA","output_types":["function_call"],"text":[],"usage":{"input_tokens":70,"output_tokens":20}}
  1. Send the same prompt with require_approval: never
send_mcp rc_mixed "$REQ_PONG_NEVER"
HTTP 200
x-litellm-response-cost: 0.0007239999999999999
{"id":"resp_cR1vQeEFD1fHRzm","output_types":["message","mcp_tools_fetched","tool_execution_results"],"text":["PONG"],"usage":{"input_tokens":221,"output_tokens":26}}
  1. Read that request's spend rows
show_rows "$START" "$END" "$(jq -r .id rc_mixed.body.json)"
{"call_type":"aresponses","status":"success","request_id":"resp_cR1vQeEFD1fHRzm","spend":0.0007239999999999999,"prompt_tokens":221,"completion_tokens":26,"cache_hit":"None","matches_client_response_id":true}
{"call_type":"list_mcp_tools","status":"success","request_id":"7284d5e2-e6b1-40bf-a","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
{"call_type":"call_mcp_tool","status":"success","request_id":"492c5e52-f6f6-4954-b","spend":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_hit":"None","matches_client_response_id":false}
Observations
  • Streaming MCP still logs only round 1, both legs
  • Streaming usage 102/5 differs from its row, both legs
  • Cache-hit /v1/responses sends no cost header, both legs

This PR leaves all three alone, since each one shows on both legs

/audit at 6abed9d, PASS

Base f81e657 and head 6abed9d ran on three rigs that share nothing, each a 2-worker proxy with its own Postgres, Redis, scripted upstream, and MCP peer. All 47 cells in tests/integration/mcp/test_mcp_llm_endpoints.py ran, since the audit changed that file's model double. The new cells are committed in 1dda7a9, tests only

Contract Base Head, twice
Answer row bills both rounds red green
Failed follow-up bills round 1 red green
Bridged follow-up answers 200 red green
Next turn replays the MCP answer red green
43 existing MCP cells green green

The controls lane ran the 43 existing cells again at the head, all green. Node ids, base failure messages, the Langfuse live rows, unit evidence, and exclusions are in the audit matrix

/live-pr-risk report at 6abed9d

Verdict: no Breaking entry. Every dependent the PR touches was driven live on two 2-worker proxies with forwarding recorders in front of OpenAI, Anthropic, and Langfuse (SDK and OTEL callbacks). The full scenario set ran at 5ed3629 and c70896f. The later commits change tool spend rows, session and trace ids, and OTEL spans, so those scenarios ran again at f81e657 and 6abed9d beside the /qa matrix. Every difference outside the ones below matched on both legs

Breaking

None found. The bridged previous_response_id turn that sends client_response_ids answers a provider 400 on both legs, 3 of 3 runs each

Backward incompatible

  • usage and x-litellm-response-cost now cover both model calls. This is the fix the PR exists for, asked for by Mateo in the ticket it resolves
  • A bridged MCP request answers 200 where main answered 400. A failing path now works, fixed in this PR
  • The tool row id is <x-litellm-call-id>_<tool call id>, so a join on the bare call id stops matching. Main's id collided with the failure row, which then failed to insert. Approved by mateo-berri in this PR's approving review
  • Logged duration and lowest-latency routing include the MCP tool's time. Approved by mateo-berri in this PR's approving review
  • usage.input_tokens sums both rounds. Approved by mateo-berri in this PR's approving review
  • A langfuse_otel span now carries langfuse.trace.existing_id, and the aresponses span carries the answer, not the function_call. Langfuse still files each logged event as its own trace on both legs. Approved by mateo-berri in this PR's approving review

Regression risk

  • A non-string trace_id in metadata makes tool row ids fall back to the call id, as on main. It needs a hostile client

Dependency graph

Dependent Status
/v1/responses non-stream MCP verified live
/v1/responses stream MCP verified live, unchanged
bridged Anthropic MCP verified live
previous_response_id lookup verified live
spend logs and failure rows verified live
router retry and fallback verified live
response cache, Redis verified live
Langfuse traces and sessions verified live
cost_margin_config verified live
post-call guardrail deferral verified live
RAG and file search sub-calls verified live, unchanged
langfuse_otel spans verified live
Rust success path unreachable

The session header plus body metadata case splits the answer and the tool into 2 Langfuse traces on f81e657 and keeps 1 trace with 3 observations on 6abed9d, shown in this case

Not verified

  • The Rust success path, since no internal sub-call reaches it today

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • Logged duration and lowest-latency routing include MCP tool time

Low

  • Streaming /v1/responses, chat completions and /v1/messages MCP, and emulated file search still bill one round, as on main
  • A disconnect during the follow-up bills round 1 only, though the provider may have charged part of round 2
  • When a retry or fallback recovers a failed follow-up, the failed attempt's round 1 goes unbilled. Main bills one round in total there
  • The tool row id is now <x-litellm-call-id>_<tool call id>, so a join on the bare call id stops matching
  • A bridged previous_response_id turn replays a stored Responses API turn's text, where main replayed an empty message
  • usage.input_tokens sums both rounds, so it is not the final call's context size
  • The Rust success path lacks the new sync callback gate, and no internal sub-call reaches it today
  • On a bridged provider, a follow-up turn's tool listing logs in that turn's own session
  • A follow-up turn on a cached bridged MCP response starts without history

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
  • 6abed9d passes /live-pr-risk

Both model rounds run as internal sub-calls on the request's logging object, and the outer call logs the response the client received with usage, cost, and cost breakdown summed across the rounds. The internal-call gate now also covers the sync success callbacks, so an inner round no longer takes their first-wins slot
@devin-ai-integration

devin-ai-integration Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Critical impact] Overhauls billing and logging for multi-round API calls.

The repository’s test requirements must be satisfied before merging

Findings

  1. P2 Required annotations are missing ▶
  2. P2 Tests still depend on time ▶
  3. P2 Changed parameters lack types ▶

Summary

The PR logs the final non-stream MCP response once and combines both model rounds’ usage and charges

  • Non-streaming MCP requests log one answer with both rounds’ usage and cost.
  • MCP listing and tool-call logs stay connected to the request trace.
  • Bridged MCP turns keep their tool results and reasoning in the conversation.
  • Spend records include MCP tools that the response ran automatically.

mateo-berri accepted tool time affecting latency-based routing because the request span intentionally includes tool execution. mateo-berri disputed the breaking-change requirement for tool-row joins because no supported field or configuration key changes and the caveat is documented

Reviews (5) · Last reviewed commit: "fix(responses): join MCP spans to the La..." · Reviewed by Greptile

Comment thread litellm/responses/mcp/round_billing.py Resolved
@codspeed

codspeed Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚠️ 1 benchmark spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 32 untouched benchmarks


Comparing litellm_mcp_auto_execute_log_final_round (1dda7a9) with main (e4dc696)

Open in CodSpeed

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.16850% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/responses/main.py 94.80% 4 Missing ⚠️
...tellm_completion_transformation/session_handler.py 95.65% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

Comment thread litellm/responses/main.py Resolved
… cache hit

A round of non-stream MCP auto-execute that the response cache served fired the
cache-hit callbacks on the shared logging object, so the spend log kept round 1's
function_call row and dropped the billed row for the answer. Internal sub-call cache
hits now fire no callbacks and carry a zero cost, and the summed cost breakdown leaves
out rounds served from the cache
…e response cache

A RAG query or an MCP turn whose final round is served from the cache hands back the cached response's id, which already belongs to the row that cached it, so SpendLogs dropped the new row as a duplicate. Such a row now gets the cache-hit id suffix, and it is logged as a cache hit when it cost nothing.
…he cache at no charge

A non-stream MCP auto-execute request whose rounds the response cache served is priced
at $0 before the parent marks it a cache hit, so it logged a false 'priced at $0'
warning and counted in litellm_zero_cost_requests_total. The diagnostic now treats a
response the cache served at no charge the same as a marked cache hit
…ute_log_final_round

# Conflicts:
#	tests/unit/responses/mcp/test_aresponses_api_with_mcp.py
Comment thread litellm/responses/main.py Resolved
@veria-ai

veria-ai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 2 · PR risk: 0/10

…ollow-up keeps its spend row

The non-stream auto-execute path passed the request's call id to the tool call, so the tool's spend row and the request's failure row shared one request_id and the failure row was dropped on insert, leaving the paid first round unbilled.
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@litereview

litereview Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ code-review

5/5 · Ready for human review

Scope: full · Full PR review.

Completed · Some checks not run.

No correctness findings.

The earlier finding about replaying MCP tool output as system messages stays fixed in this checkout.

Checks and execution details
  • Passed · Real testing evidence (required): Not applicable: no LLM translation changes in the scoped paths. The PR changes nothing under litellm/llms/** or litellm/litellm_core_utils/prompt_templates/**. Its changes are in litellm/responses/**, litellm/proxy/**, logging, caching and RAG.
  • Passed · Targeted unit suites (optional): I ran .venv/bin/python -m pytest -q -n 8 on tests/unit/responses/mcp, tests/unit/responses/litellm_completion_transformation, tests/unit/caching/test_caching_handler.py, tests/unit/litellm_core_utils/test_hidden_params.py, tests/unit/litellm_core_utils/test_litellm_logging.py, tests/unit/proxy/db/test_spend_log_tool_index.py, tests/unit/proxy/spend_tracking/test_spend_tracking_utils.py and tests/unit/rag. Result: 1817 passed in 46.41s.
  • Not run · Integration tests tests/integration/mcp/test_mcp_llm_endpoints.py (optional): I did not run this suite. It needs a live proxy with Postgres and Redis plus provider credentials. The scoped evidence rule does not require it for this PR.

View review · Reviewed 1dda7a9f64eb

…ws in the request's session, and charge a fixed margin once per request
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

…e and continue its conversation

The bridged follow-up no longer chains on round 1, so a thinking model keeps its reasoning and the request stays in one session. The tool call log continues the request trace without renaming it, the tools are fetched once, and a later turn finds the MCP turn under the id the client got, skipping the tool rows.
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@kerry-berri

Copy link
Copy Markdown
Contributor

@greptileai

assert response_tool_call_names(response) == ("ant_get_weather",)

def test_auto_executed_mcp_tools_count_from_the_final_responses_api_response(self):
final_round = ResponsesAPIResponse.model_validate(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Required annotations are missing

The new final_round and logged assignments omit Final. The repository requires it on every new variable. Add the annotations before merging

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

greptile-apps Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Automatic reviews are disabled for this repository.

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1dda7a9. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit 86a91f3 into main Oct 16, 2026
107 of 108 checks passed
@mateo-berri
mateo-berri deleted the litellm_mcp_auto_execute_log_final_round branch October 16, 2026 17:37
mateo-berri added a commit that referenced this pull request Nov 10, 2026
…sync cache hit

When the response cache served the speech bridge's inner completion, its cache-hit success handler still ran on the speech call's logging object. Sync loggers then got the cached chat response, and the speech call's logging payload could take the cached response's id

This ports the sync cache-read gate of #43667 from main. The async cache-read gates of that PR are left out, since only the speech bridge runs a sync internal sub call on this line
mateo-berri added a commit that referenced this pull request Nov 11, 2026
An internal sub-call under an async parent no longer schedules sync success callbacks
of its own, and a cache hit inside an internal sub-call fires no callbacks, since the
parent call that folds it in logs it. This matches main
GiorgioAresu pushed a commit to GiorgioAresu/home-ops that referenced this pull request Nov 15, 2026
…109.1) (#2608)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | minor | `v1.108.2` → `v1.109.1` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/6) for more information.

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.109.1`](https://github.com/BerriAI/litellm/releases/tag/v1.109.1)

[Compare Source](https://github.com/BerriAI/litellm/compare/v1.109.0...v1.109.1)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). This release is signed with the key introduced in [commit `e82a3c6`](https://github.com/BerriAI/litellm/commit/e82a3c646908ba0a6ee0beddc4310d7a6cac4065).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the published signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.1
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.109.1/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.1
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- security(proxy): backport [#&#8203;51254](https://github.com/BerriAI/litellm/issues/51254) to stable/1.109.x by [@&#8203;shrey-berri](https://github.com/shrey-berri) in [#&#8203;51264](https://github.com/BerriAI/litellm/pull/51264)
- chore: bump litellm 1.109.0 -> 1.109.1 by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;51298](https://github.com/BerriAI/litellm/pull/51298)

**Full Changelog**: <https://github.com/BerriAI/litellm/compare/v1.109.0...v1.109.1>

### [`v1.109.0`](https://github.com/BerriAI/litellm/releases/tag/v1.109.0)

[Compare Source](https://github.com/BerriAI/litellm/compare/v1.108.9...v1.109.0)

#### Verify this release

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.0
```

Same command for `litellm-database`, `litellm-non_root` and the `docker.io/litellm/*` images

#### What's new in 1.109.0

982 PRs. 144 added, 424 fixed, 60 changed, 17 improved, 9 removed. 5 need action

##### Action required

- **Routing and fallbacks:** Change string fallback targets to lists of model names ([#&#8203;48943](https://github.com/BerriAI/litellm/issues/48943))
- **Caching:** Switch `cache_params.type` from `disk` to `local` or `redis`, since the `disk` cache backend (diskcache) has been removed ([#&#8203;48114](https://github.com/BerriAI/litellm/issues/48114))
- **Routing and fallbacks:** Add `optional_pre_call_checks: ["enforce_model_rate_limits"]` to keep a hard `rpm` cap on deployments ([#&#8203;48873](https://github.com/BerriAI/litellm/issues/48873))
- **Vertex AI and Gemini:** Set `drop_params: true` or stop sending `temperature`, `top_p` and `top_k` to Gemini 3.6 Flash, 3.5 Flash-Lite and newer ([#&#8203;47645](https://github.com/BerriAI/litellm/issues/47645))
- **Deployment:** Deploy Lens from its own chart and set `lens.*` in your values ([#&#8203;49169](https://github.com/BerriAI/litellm/issues/49169))

##### Highlights

- **Admin UI:** Added a Chat UI with a model hub, image generation and usage metrics ([#&#8203;48108](https://github.com/BerriAI/litellm/issues/48108))
- **Routing and fallbacks:** Added mid-stream fallback continuation so a streaming chat cut off mid-answer continues on the configured fallback ([#&#8203;41127](https://github.com/BerriAI/litellm/issues/41127))
- **Deployment:** Added `LITELLM_OFFLINE_MODE` to turn off every fetch LiteLLM makes on its own with one switch ([#&#8203;48096](https://github.com/BerriAI/litellm/issues/48096))
- **Cost tracking and pricing:** Added `model_info.pricing_provider` to price a deployment from another provider's catalog rates instead of $0 ([#&#8203;47620](https://github.com/BerriAI/litellm/issues/47620))
- **Vertex AI and Gemini:** Added Gemini 3.1 Flash TTS support, including multi-speaker voices and `mp3`, `opus`, `alaw` and `mulaw` output ([#&#8203;31915](https://github.com/BerriAI/litellm/issues/31915))
- **SDK:** Fixed tool calls on `completion()` and `responses()` failing with `No module named 'mcp'` on base SDK installs ([#&#8203;45961](https://github.com/BerriAI/litellm/issues/45961)) <sup>Also in [1.108.4](https://github.com/BerriAI/litellm/releases/tag/v1.108.4)</sup>

##### All changes

<details><summary><b>OpenAI</b> (19)</summary>

- Added per-deployment workload identity on non-chat routes, realtime and the moderation guardrail ([#&#8203;39966](https://github.com/BerriAI/litellm/issues/39966))
- Added the 12-hour cache write rate for `gpt-5.6-cyber` ([#&#8203;48246](https://github.com/BerriAI/litellm/issues/48246))
- Added OpenAI `gpt-6.1-terra` with pricing ([#&#8203;48429](https://github.com/BerriAI/litellm/issues/48429))
- Added Batch and Ultrafast 12-hour cache write rates for OpenAI models ([#&#8203;48433](https://github.com/BerriAI/litellm/issues/48433))
- Added `gpt-6-rosalind` to the model cost map with its published prices ([#&#8203;49268](https://github.com/BerriAI/litellm/issues/49268))
- Added `gpt-6-astra-law` with pricing from the OpenAI pricing page ([#&#8203;49444](https://github.com/BerriAI/litellm/issues/49444))
- Fixed 400 errors and $0 spend logs on `gpt-transcribe` calls without `response_format` ([#&#8203;44021](https://github.com/BerriAI/litellm/issues/44021))
- Fixed nonstreaming `aiohttp_openai` responses dropping `service_tier` ([#&#8203;47263](https://github.com/BerriAI/litellm/issues/47263))
- Fixed `prompt_cache_retention` such as `24h` being silently dropped instead of sent upstream ([#&#8203;47480](https://github.com/BerriAI/litellm/issues/47480))
- Fixed `/health` marking OpenAI and Azure audio chat models unhealthy ([#&#8203;47730](https://github.com/BerriAI/litellm/issues/47730))
- Fixed OpenAI `context_length_exceeded` errors raising `BadRequestError` instead of `ContextWindowExceededError` ([#&#8203;47954](https://github.com/BerriAI/litellm/issues/47954))
- Fixed 12-hour prompt cache writes on `openai/gpt-5.6` and newer billing at the 30-minute rate ([#&#8203;48088](https://github.com/BerriAI/litellm/issues/48088))
- Fixed uncatalogued ChatGPT models hitting an unsupported Chat Completions endpoint ([#&#8203;48244](https://github.com/BerriAI/litellm/issues/48244))
- Fixed the whole `reasoning_effort` dict not being sent when chat is bridged to Responses ([#&#8203;48807](https://github.com/BerriAI/litellm/issues/48807))
- Fixed 400 `invalid_beta` on Agents API calls through the OpenAI passthrough ([#&#8203;49009](https://github.com/BerriAI/litellm/issues/49009))
- Fixed empty `e.response.text` on OpenAI and Azure errors so the upstream error body is readable ([#&#8203;49079](https://github.com/BerriAI/litellm/issues/49079))
- Changed OpenAI 401 and 404 `invalid_request_error` to raise matching exceptions, not `BadRequestError` ([#&#8203;32537](https://github.com/BerriAI/litellm/issues/32537))
- Changed the ChatGPT session id to derive from `prompt_cache_key` for stable cache affinity ([#&#8203;42014](https://github.com/BerriAI/litellm/issues/42014))
- Changed `gpt-6-luna` Decisions cache rates to the standard cached and write rates ([#&#8203;48066](https://github.com/BerriAI/litellm/issues/48066))

</details>

<details><summary><b>Azure</b> (18)</summary>

- Added Entra ID auth, including keyless auth, for Azure Decisions on `/v1/decisions` and `/v1/systemone` ([#&#8203;46539](https://github.com/BerriAI/litellm/issues/46539), [#&#8203;48529](https://github.com/BerriAI/litellm/issues/48529))
- Added access to Foundry agents through the project Responses API for `azure_ai/agents/<name>` ([#&#8203;47717](https://github.com/BerriAI/litellm/issues/47717))
- Added `azure_ai/MAI-Code-1.1-Flash` ([#&#8203;47779](https://github.com/BerriAI/litellm/issues/47779))
- Added `max_input_tokens` of 32768 for `azure_ai/Microsoft-Decision-1` ([#&#8203;48434](https://github.com/BerriAI/litellm/issues/48434))
- Added `outputContentFormat=markdown` support on `/ocr` for Azure Document Intelligence ([#&#8203;48926](https://github.com/BerriAI/litellm/issues/48926))
- Fixed Foundry chat requests losing OpenAI prompt cache breakpoints ([#&#8203;45299](https://github.com/BerriAI/litellm/issues/45299))
- Fixed `/v1/responses` 404 on dated `api_version` deployments and `azure_ai` Grok reasoning token billing ([#&#8203;46377](https://github.com/BerriAI/litellm/issues/46377))
- Fixed under-billed Grok reasoning tokens on `azure_ai` when the deployment name lacks "grok" ([#&#8203;46969](https://github.com/BerriAI/litellm/issues/46969))
- Fixed Azure realtime over WebRTC failing with a 404 on `client_secrets` and an invalid token on the SDP exchange ([#&#8203;47316](https://github.com/BerriAI/litellm/issues/47316))
- Fixed 400 from Foundry when tool results contain `tool_reference` parts on chat ([#&#8203;48032](https://github.com/BerriAI/litellm/issues/48032))
- Fixed 400 on `azure_ai/claude-*` when using `thinking.block_binding` ([#&#8203;48033](https://github.com/BerriAI/litellm/issues/48033))
- Fixed Responses API calls that use an explicit v1 Azure base URL ([#&#8203;48118](https://github.com/BerriAI/litellm/issues/48118))
- Fixed 404 on Azure vector store retrieve, update and delete ([#&#8203;48224](https://github.com/BerriAI/litellm/issues/48224))
- Fixed null audio capability metadata on two Azure audio snapshot models ([#&#8203;48475](https://github.com/BerriAI/litellm/issues/48475))
- Fixed Azure `context_length_exceeded` raising `BadRequestError` so `context_window_fallbacks` never ran ([#&#8203;48616](https://github.com/BerriAI/litellm/issues/48616))
- Fixed batch calls on unversioned `azure/` o3, o4-mini, o3-mini, gpt-4o and gpt-4o-mini billing at the standard rate ([#&#8203;49182](https://github.com/BerriAI/litellm/issues/49182))
- Changed `max_input_tokens` to 128000 for `gpt-chat-latest` on Azure ([#&#8203;48252](https://github.com/BerriAI/litellm/issues/48252))
- Improved Entra auth by reusing credentials and tokens across requests and refreshing them off the event loop ([#&#8203;46421](https://github.com/BerriAI/litellm/issues/46421), [#&#8203;47348](https://github.com/BerriAI/litellm/issues/47348), [#&#8203;48769](https://github.com/BerriAI/litellm/issues/48769))

</details>

<details><summary><b>Anthropic</b> (16)</summary>

- Fixed a fake `[System: ...]` message being added to tool-call-only assistant turns sent to Anthropic ([#&#8203;34822](https://github.com/BerriAI/litellm/issues/34822))
- Fixed PDFs sent as chat `image_url` being rejected with 400 by sending them as document blocks ([#&#8203;46984](https://github.com/BerriAI/litellm/issues/46984))
- Fixed Claude `json_schema` answers losing keys listed only in `required` and escaping non-ASCII characters ([#&#8203;47478](https://github.com/BerriAI/litellm/issues/47478))
- Fixed replayed `redacted_thinking` blocks being dropped, and Bedrock Converse 400s when sent twice ([#&#8203;47489](https://github.com/BerriAI/litellm/issues/47489))
- Fixed `clear_tool_uses` `input_tokens` trigger ignoring the system prompt, which delayed clearing ([#&#8203;47857](https://github.com/BerriAI/litellm/issues/47857))
- Fixed native Anthropic responses omitting a null `stop_sequence` ([#&#8203;47987](https://github.com/BerriAI/litellm/issues/47987))
- Fixed streamed responses leaving native web search fees out of the reconstructed usage cost ([#&#8203;48528](https://github.com/BerriAI/litellm/issues/48528))
- Fixed `drop_params` not dropping `speed` on `claude-opus-4-7`, which Anthropic rejects with 400 ([#&#8203;48764](https://github.com/BerriAI/litellm/issues/48764))
- Fixed 400 from beta-gated body fields when `drop_params: true`, including Claude Code and Codex traffic ([#&#8203;48793](https://github.com/BerriAI/litellm/issues/48793))
- Fixed `model_context_window_exceeded` being reported as `stop` instead of `length` ([#&#8203;48874](https://github.com/BerriAI/litellm/issues/48874))
- Fixed 400 on `/v1/messages` with many strict tools under `drop_params` by retrying without `strict` ([#&#8203;49102](https://github.com/BerriAI/litellm/issues/49102))
- Fixed Claude `pause_turn` reported as finished and refusal explanations dropped on chat and Responses ([#&#8203;49192](https://github.com/BerriAI/litellm/issues/49192))
- Fixed 500 on a non-string role or tool call id, now a 400 that names the field ([#&#8203;49237](https://github.com/BerriAI/litellm/issues/49237))
- Fixed `metadata.user_id` being dropped on Anthropic `/v1/messages` pass-through routes ([#&#8203;49333](https://github.com/BerriAI/litellm/issues/49333))
- Changed the default `max_tokens` for unmapped Anthropic models from 4096 to 128000 ([#&#8203;48502](https://github.com/BerriAI/litellm/issues/48502))
- Changed the opening prompt usage estimate in the Chat Completions adapter to be off by default ([#&#8203;48633](https://github.com/BerriAI/litellm/issues/48633))

</details>

<details><summary><b>AWS Bedrock</b> (28)</summary>

- Added context and output token limits for the Nova Sonic models ([#&#8203;48247](https://github.com/BerriAI/litellm/issues/48247))
- Added pricing for native `guardrailConfig` trace usage to spend and `x-litellm-response-cost` ([#&#8203;48278](https://github.com/BerriAI/litellm/issues/48278))
- Added `global.openai.gpt-6.1-terra` and `us.openai.gpt-6.1-terra` Bedrock models with pricing ([#&#8203;48441](https://github.com/BerriAI/litellm/issues/48441))
- Added token counting for three Mantle-native Bedrock Claude models ([#&#8203;48682](https://github.com/BerriAI/litellm/issues/48682))
- Added published Priority, Batch and Flex prices to 46 Bedrock regional rows ([#&#8203;49113](https://github.com/BerriAI/litellm/issues/49113))
- Fixed Bedrock Voxtral transcription returning 400, logging $0 spend and ignoring `language` ([#&#8203;41565](https://github.com/BerriAI/litellm/issues/41565))
- Fixed `Unknown provider=None` 404 for Bedrock models missing from the cost map ([#&#8203;43290](https://github.com/BerriAI/litellm/issues/43290))
- Fixed 400 errors on Bedrock Kimi K3 Converse calls with `max_tokens` below 16 ([#&#8203;43875](https://github.com/BerriAI/litellm/issues/43875))
- Fixed 400 `invalid beta flag` on Claude Code auto mode requests that carry no `safeguards` ([#&#8203;44471](https://github.com/BerriAI/litellm/issues/44471))
- Fixed a malformed Bedrock batch JSONL line failing the upload with a 500 instead of a 400 ([#&#8203;45992](https://github.com/BerriAI/litellm/issues/45992))
- Fixed `post_call` guardrails not scanning Claude output on `invoke-with-response-stream` passthrough ([#&#8203;46524](https://github.com/BerriAI/litellm/issues/46524))
- Fixed Claude `json_schema` streams dropping reasoning and thinking blocks and ending on `tool_calls` with no tool calls ([#&#8203;46863](https://github.com/BerriAI/litellm/issues/46863))
- Fixed JSON schema requests failing on Fable 5 and Sonnet 4.6 and losing adaptive thinking on Haiku 5.5 ([#&#8203;46870](https://github.com/BerriAI/litellm/issues/46870))
- Fixed `bedrock_request_metadata_fields` being ignored on the `/bedrock` pass-through routes ([#&#8203;47040](https://github.com/BerriAI/litellm/issues/47040))
- Fixed Bedrock Opus 4.8 and Sonnet 5 dropping reasoning on `json_schema` requests by trying native output first ([#&#8203;47100](https://github.com/BerriAI/litellm/issues/47100))
- Fixed Bedrock batch jobs ignoring a configured control-plane endpoint ([#&#8203;47260](https://github.com/BerriAI/litellm/issues/47260))
- Fixed AWS region lookups through Vault blocking the event loop and stalling other requests on the worker ([#&#8203;47331](https://github.com/BerriAI/litellm/issues/47331))
- Fixed $0 spend and `ModelNotMappedError` for `bedrock/claude_platform/<id>` calls ([#&#8203;48150](https://github.com/BerriAI/litellm/issues/48150))
- Fixed `max_input_tokens` to 922000 on Bedrock GPT models and added Mantle token counting for `claude-opus-5-5` ([#&#8203;48479](https://github.com/BerriAI/litellm/issues/48479))
- Fixed Bedrock rejecting `strict` tool schemas by retrying without `strict` under `drop_params` ([#&#8203;48733](https://github.com/BerriAI/litellm/issues/48733))
- Fixed 400 on Bedrock when Codex repeats its tool list across turns ([#&#8203;49006](https://github.com/BerriAI/litellm/issues/49006))
- Fixed region-prefixed Bedrock embedding models not routing to their region or billing its price ([#&#8203;49072](https://github.com/BerriAI/litellm/issues/49072))
- Fixed `bedrock_mantle/openai.gpt-5.6-cyber` token limits and endpoints to match its model card ([#&#8203;49350](https://github.com/BerriAI/litellm/issues/49350))
- Fixed `max_output_tokens` for Bedrock GovCloud West Llama 3 models, now 8192 ([#&#8203;49543](https://github.com/BerriAI/litellm/issues/49543))
- Changed `converse-stream` pass-through to stream frames through post_call guardrails instead of buffering the reply ([#&#8203;46307](https://github.com/BerriAI/litellm/issues/46307))
- Changed `/bedrock` pass-through routes to apply a model's `guardrailConfig`, returning 400 if Bedrock cannot use it ([#&#8203;47429](https://github.com/BerriAI/litellm/issues/47429))
- Changed Bedrock pass-through to use request metadata as the session id, fixing 400s with `missing_session_id: reject` ([#&#8203;49193](https://github.com/BerriAI/litellm/issues/49193))
- Changed Bedrock Invoke and Mantle Claude to use the model's own default `max_tokens` ([#&#8203;49724](https://github.com/BerriAI/litellm/issues/49724))

</details>

<details><summary><b>Vertex AI and Gemini</b> (34)</summary>

- Added Gemini 3.1 Flash TTS support, including multi-speaker voices and `mp3`, `opus`, `alaw` and `mulaw` output ([#&#8203;31915](https://github.com/BerriAI/litellm/issues/31915))
- Added a setting to drop chosen `anthropic-beta` values on the Vertex AI pass-through routes ([#&#8203;47185](https://github.com/BerriAI/litellm/issues/47185))
- Added `LITELLM_GEMINI_DEFAULT_MAX_OUTPUT_TOKENS` to set the output limit for requests that set none ([#&#8203;47542](https://github.com/BerriAI/litellm/issues/47542))
- Added `thought_signature_in_tool_call_id` to keep Gemini tool call ids short for clients that cap them ([#&#8203;47692](https://github.com/BerriAI/litellm/issues/47692))
- Added a 2026-06-30 deprecation date to `vertex_ai/veo-2.0-generate-001` ([#&#8203;47847](https://github.com/BerriAI/litellm/issues/47847))
- Added Batch rates for two Llama 4 MaaS models so Vertex batch jobs no longer bill at on-demand rates ([#&#8203;48085](https://github.com/BerriAI/litellm/issues/48085))
- Added Vertex batch prices above 200k tokens and image output prices for Gemini models ([#&#8203;48945](https://github.com/BerriAI/litellm/issues/48945))
- Fixed the Gemini 3 sampling deprecation warning logging on every request, now once per model per worker ([#&#8203;40868](https://github.com/BerriAI/litellm/issues/40868))
- Fixed `vertex_ai/*` keys not listing partner, Veo and embedding models and dropping publisher prefixes ([#&#8203;41959](https://github.com/BerriAI/litellm/issues/41959))
- Fixed Gemini TTS `/v1/audio/speech` calling Google twice and logging 0 tokens in spend ([#&#8203;44551](https://github.com/BerriAI/litellm/issues/44551))
- Fixed 400 from compaction, thinking display and tool change betas on Claude via Vertex AI and Azure AI ([#&#8203;44747](https://github.com/BerriAI/litellm/issues/44747))
- Fixed context caching on Vertex AI failing when a custom `api_base` is set ([#&#8203;44783](https://github.com/BerriAI/litellm/issues/44783))
- Fixed streamed Vertex AI pass-through calls missing the regional 10% uplift and custom deployment prices ([#&#8203;44795](https://github.com/BerriAI/litellm/issues/44795))
- Fixed Gemini not receiving integer enum values in tool parameters ([#&#8203;44908](https://github.com/BerriAI/litellm/issues/44908))
- Fixed Vertex Claude batches returning 404 at create ([#&#8203;45715](https://github.com/BerriAI/litellm/issues/45715))
- Fixed cache-marked requests listing all `cachedContents` on every call and creating duplicate caches ([#&#8203;46857](https://github.com/BerriAI/litellm/issues/46857))
- Fixed Vertex AI rate limit errors returned as 403 when the error text contains 403 ([#&#8203;47134](https://github.com/BerriAI/litellm/issues/47134))
- Fixed Gemini audio input and cached audio billed at the Standard rate on flex, priority and batch tiers ([#&#8203;48086](https://github.com/BerriAI/litellm/issues/48086))
- Fixed `gemini-2.5-flash-native-audio` video input billed at the text rate instead of the audio/video rate ([#&#8203;48248](https://github.com/BerriAI/litellm/issues/48248))
- Fixed Gemini 2.5 rejecting tool results with images and the history replay that follows ([#&#8203;48428](https://github.com/BerriAI/litellm/issues/48428))
- Fixed Vertex AI shared credential cache growing without bound across credential and project pairs ([#&#8203;48442](https://github.com/BerriAI/litellm/issues/48442))
- Fixed Vertex AI image sizes outside the old lookup table silently producing square output ([#&#8203;48463](https://github.com/BerriAI/litellm/issues/48463))
- Fixed slow Google credential requests blocking the proxy worker on Claude `/v1/messages` ([#&#8203;48523](https://github.com/BerriAI/litellm/issues/48523))
- Fixed explicit Gemini and Vertex embedding timeouts silently becoming 300 seconds ([#&#8203;48690](https://github.com/BerriAI/litellm/issues/48690))
- Fixed Gemini grounding keeping only the first web source for a passage ([#&#8203;48745](https://github.com/BerriAI/litellm/issues/48745))
- Fixed `labels` on `vertex_ai/claude-*` returning 400 by sending them as `X-Vertex-AI-Labels` ([#&#8203;48753](https://github.com/BerriAI/litellm/issues/48753))
- Fixed 400 on `countTokens` and `generateContent` when repeated fields are a single object or null ([#&#8203;48771](https://github.com/BerriAI/litellm/issues/48771))
- Fixed Vertex Claude `/v1/messages` returning 400 when the SDK sends `anthropic-version` as a header ([#&#8203;48814](https://github.com/BerriAI/litellm/issues/48814))
- Fixed Claude web search billing per request on Vertex AI deployments priced in `model_info` ([#&#8203;49160](https://github.com/BerriAI/litellm/issues/49160))
- Fixed batch image output billed at the Standard rate on `gemini-nano-banana-2.1` and `gemini-3.1-flash-lite-image` ([#&#8203;49317](https://github.com/BerriAI/litellm/issues/49317), [#&#8203;49358](https://github.com/BerriAI/litellm/issues/49358))
- Changed Gemini 3.6 Flash, 3.5 Flash-Lite and newer to refuse `temperature`, `top_p` and `top_k` without `drop_params` ([#&#8203;47645](https://github.com/BerriAI/litellm/issues/47645))
- Improved rerank latency by reusing cached Google credentials on every request ([#&#8203;48430](https://github.com/BerriAI/litellm/issues/48430))
- Improved failure logs for Gemini and Vertex pass-through calls by adding the URL model and declared provider ([#&#8203;49075](https://github.com/BerriAI/litellm/issues/49075))
- Removed the floor `deprecation_date` from `gemini-3.1-flash-lite-image` ([#&#8203;48587](https://github.com/BerriAI/litellm/issues/48587))

</details>

<details><summary><b>Other providers</b> (3)</summary>

- Added 11 new providers: ai&, BigModel, CLF AI Gateway, Hostinger Router, Kyma API, Nace, OpenCode Go, OpenInfer, Refuseless, StreamLake and ZeroGPU ([#&#8203;38958](https://github.com/BerriAI/litellm/issues/38958), [#&#8203;39324](https://github.com/BerriAI/litellm/issues/39324), [#&#8203;41006](https://github.com/BerriAI/litellm/issues/41006), [#&#8203;41034](https://github.com/BerriAI/litellm/issues/41034), [#&#8203;43874](https://github.com/BerriAI/litellm/issues/43874), [#&#8203;44863](https://github.com/BerriAI/litellm/issues/44863), [#&#8203;46523](https://github.com/BerriAI/litellm/issues/46523), [#&#8203;48140](https://github.com/BerriAI/litellm/issues/48140), [#&#8203;48497](https://github.com/BerriAI/litellm/issues/48497), [#&#8203;48563](https://github.com/BerriAI/litellm/issues/48563), [#&#8203;48756](https://github.com/BerriAI/litellm/issues/48756))
- Added models, endpoints and options for smaller providers (31 PRs) ([#&#8203;41021](https://github.com/BerriAI/litellm/issues/41021), [#&#8203;41522](https://github.com/BerriAI/litellm/issues/41522), [#&#8203;46156](https://github.com/BerriAI/litellm/issues/46156), [#&#8203;46875](https://github.com/BerriAI/litellm/issues/46875), [#&#8203;47401](https://github.com/BerriAI/litellm/issues/47401), [#&#8203;47473](https://github.com/BerriAI/litellm/issues/47473), [#&#8203;47610](https://github.com/BerriAI/litellm/issues/47610), [#&#8203;47690](https://github.com/BerriAI/litellm/issues/47690), [#&#8203;47785](https://github.com/BerriAI/litellm/issues/47785), [#&#8203;47812](https://github.com/BerriAI/litellm/issues/47812), [#&#8203;48158](https://github.com/BerriAI/litellm/issues/48158), [#&#8203;48251](https://github.com/BerriAI/litellm/issues/48251), [#&#8203;48335](https://github.com/BerriAI/litellm/issues/48335), [#&#8203;48448](https://github.com/BerriAI/litellm/issues/48448), [#&#8203;48450](https://github.com/BerriAI/litellm/issues/48450), [#&#8203;48453](https://github.com/BerriAI/litellm/issues/48453), [#&#8203;48498](https://github.com/BerriAI/litellm/issues/48498), [#&#8203;48621](https://github.com/BerriAI/litellm/issues/48621), [#&#8203;48651](https://github.com/BerriAI/litellm/issues/48651), [#&#8203;48676](https://github.com/BerriAI/litellm/issues/48676), [#&#8203;48677](https://github.com/BerriAI/litellm/issues/48677), [#&#8203;48735](https://github.com/BerriAI/litellm/issues/48735), [#&#8203;48871](https://github.com/BerriAI/litellm/issues/48871), [#&#8203;48998](https://github.com/BerriAI/litellm/issues/48998), [#&#8203;49252](https://github.com/BerriAI/litellm/issues/49252), [#&#8203;49280](https://github.com/BerriAI/litellm/issues/49280), [#&#8203;49281](https://github.com/BerriAI/litellm/issues/49281), [#&#8203;49282](https://github.com/BerriAI/litellm/issues/49282), [#&#8203;49287](https://github.com/BerriAI/litellm/issues/49287), [#&#8203;49297](https://github.com/BerriAI/litellm/issues/49297), [#&#8203;49542](https://github.com/BerriAI/litellm/issues/49542))
- Fixed issues and updated behavior on smaller providers (41 PRs) ([#&#8203;38736](https://github.com/BerriAI/litellm/issues/38736), [#&#8203;40152](https://github.com/BerriAI/litellm/issues/40152), [#&#8203;43390](https://github.com/BerriAI/litellm/issues/43390), [#&#8203;44723](https://github.com/BerriAI/litellm/issues/44723), [#&#8203;45092](https://github.com/BerriAI/litellm/issues/45092), [#&#8203;45567](https://github.com/BerriAI/litellm/issues/45567), [#&#8203;46091](https://github.com/BerriAI/litellm/issues/46091), [#&#8203;46861](https://github.com/BerriAI/litellm/issues/46861), [#&#8203;46945](https://github.com/BerriAI/litellm/issues/46945), [#&#8203;46959](https://github.com/BerriAI/litellm/issues/46959), [#&#8203;47091](https://github.com/BerriAI/litellm/issues/47091), [#&#8203;47423](https://github.com/BerriAI/litellm/issues/47423), [#&#8203;47424](https://github.com/BerriAI/litellm/issues/47424), [#&#8203;47432](https://github.com/BerriAI/litellm/issues/47432), [#&#8203;47495](https://github.com/BerriAI/litellm/issues/47495), [#&#8203;47784](https://github.com/BerriAI/litellm/issues/47784), [#&#8203;47794](https://github.com/BerriAI/litellm/issues/47794), [#&#8203;48121](https://github.com/BerriAI/litellm/issues/48121), [#&#8203;48254](https://github.com/BerriAI/litellm/issues/48254), [#&#8203;48265](https://github.com/BerriAI/litellm/issues/48265), [#&#8203;48268](https://github.com/BerriAI/litellm/issues/48268), [#&#8203;48270](https://github.com/BerriAI/litellm/issues/48270), [#&#8203;48455](https://github.com/BerriAI/litellm/issues/48455), [#&#8203;48522](https://github.com/BerriAI/litellm/issues/48522), [#&#8203;48527](https://github.com/BerriAI/litellm/issues/48527), [#&#8203;48668](https://github.com/BerriAI/litellm/issues/48668), [#&#8203;48684](https://github.com/BerriAI/litellm/issues/48684), [#&#8203;48706](https://github.com/BerriAI/litellm/issues/48706), [#&#8203;48707](https://github.com/BerriAI/litellm/issues/48707), [#&#8203;48778](https://github.com/BerriAI/litellm/issues/48778), [#&#8203;48820](https://github.com/BerriAI/litellm/issues/48820), [#&#8203;48837](https://github.com/BerriAI/litellm/issues/48837), [#&#8203;49068](https://github.com/BerriAI/litellm/issues/49068), [#&#8203;49158](https://github.com/BerriAI/litellm/issues/49158), [#&#8203;49278](https://github.com/BerriAI/litellm/issues/49278), [#&#8203;49344](https://github.com/BerriAI/litellm/issues/49344), [#&#8203;49458](https://github.com/BerriAI/litellm/issues/49458), [#&#8203;49462](https://github.com/BerriAI/litellm/issues/49462), [#&#8203;49498](https://github.com/BerriAI/litellm/issues/49498), [#&#8203;49502](https://github.com/BerriAI/litellm/issues/49502), [#&#8203;49616](https://github.com/BerriAI/litellm/issues/49616))

</details>

<details><summary><b>Chat completions</b> (17)</summary>

- Fixed streams with `logprobs` ending in a 500 error frame before the finish chunk ([#&#8203;33549](https://github.com/BerriAI/litellm/issues/33549))
- Fixed 500 errors when a prompt template omits `initial_prompt_value` or `final_prompt_value` ([#&#8203;39762](https://github.com/BerriAI/litellm/issues/39762))
- Fixed rebuilt streamed text completions returning null `finish_reason` and zero `prompt_tokens` ([#&#8203;44349](https://github.com/BerriAI/litellm/issues/44349))
- Fixed Foundry deployments and Claude fallbacks getting the wrong cache options, which caused 400s ([#&#8203;45295](https://github.com/BerriAI/litellm/issues/45295))
- Fixed non-streaming chat dropping upstream response headers on `bedrock_mantle/` and other OpenAI-like providers ([#&#8203;46928](https://github.com/BerriAI/litellm/issues/46928))
- Fixed chat streams failing with a proxy error when progress chunks have no choice index ([#&#8203;46947](https://github.com/BerriAI/litellm/issues/46947))
- Fixed the overhead header under-reporting on chat requests when guardrails add `litellm_metadata` ([#&#8203;47790](https://github.com/BerriAI/litellm/issues/47790))
- Fixed streamed chunks containing `[DONE]` being read as end of stream and dropped ([#&#8203;47832](https://github.com/BerriAI/litellm/issues/47832))
- Fixed completions streams including `usage` when it was not requested ([#&#8203;48052](https://github.com/BerriAI/litellm/issues/48052))
- Fixed an upstream `abort` on streamed chat completions returning a clean HTTP 200 instead of a server error ([#&#8203;48328](https://github.com/BerriAI/litellm/issues/48328))
- Fixed unbalanced think tags in merged streams and SSE lines splitting on characters other than CR/LF ([#&#8203;48755](https://github.com/BerriAI/litellm/issues/48755))
- Fixed 400 on system-first models like Qwen3.5 when a later `developer` message appears ([#&#8203;48897](https://github.com/BerriAI/litellm/issues/48897))
- Fixed streamed chat completions with `n>1` rebuilding each choice ([#&#8203;49002](https://github.com/BerriAI/litellm/issues/49002))
- Fixed streaming clients missing tool execution when OpenAI-compatible providers end tool calls with `stop` ([#&#8203;49388](https://github.com/BerriAI/litellm/issues/49388))
- Changed the `include_usage` stream chunk to send an empty `choices` array like OpenAI ([#&#8203;47109](https://github.com/BerriAI/litellm/issues/47109))
- Changed stalled stream reads to raise a 408 `litellm.Timeout` on chat, messages and responses ([#&#8203;47198](https://github.com/BerriAI/litellm/issues/47198))
- Changed streams that end without a finish reason to fail as errors instead of reporting a normal completion ([#&#8203;47665](https://github.com/BerriAI/litellm/issues/47665))

</details>

<details><summary><b>Responses API</b> (34)</summary>

- Added `max_agentic_loops` support to raise the streamed MCP auto-execute round cap above 5 ([#&#8203;47688](https://github.com/BerriAI/litellm/issues/47688))
- Added resuming background response streams with `stream` and `starting_after` on retrieve ([#&#8203;48819](https://github.com/BerriAI/litellm/issues/48819))
- Added Codex client `tool_search` support on Anthropic and other bridged providers, cutting input tokens ([#&#8203;48972](https://github.com/BerriAI/litellm/issues/48972))
- Fixed Responses API logging tasks being dropped by garbage collection and cut off at shutdown ([#&#8203;31074](https://github.com/BerriAI/litellm/issues/31074))
- Fixed non-stream MCP auto-execute on `/v1/responses` logging and billing only one of its two model calls ([#&#8203;43667](https://github.com/BerriAI/litellm/issues/43667))
- Fixed 400 from malformed `prompt_cache_breakpoint` on `/v1/responses` with `drop_params: true` ([#&#8203;45330](https://github.com/BerriAI/litellm/issues/45330))
- Fixed later turns on an open Responses WebSocket skipping deployment checks and not counting toward budgets ([#&#8203;45727](https://github.com/BerriAI/litellm/issues/45727))
- Fixed streamed `/v1/responses` events showing the backend deployment name in nested `response.model` ([#&#8203;46662](https://github.com/BerriAI/litellm/issues/46662))
- Fixed `/v1/responses` on Claude dropping returned and replayed `compaction` items ([#&#8203;46754](https://github.com/BerriAI/litellm/issues/46754))
- Fixed Responses WebSocket running `pre_call` guardrails on turn one only and rebilling that cost every turn ([#&#8203;47013](https://github.com/BerriAI/litellm/issues/47013))
- Fixed OpenAI pass-through `GET /responses/{id}` being billed again on every call ([#&#8203;47171](https://github.com/BerriAI/litellm/issues/47171))
- Fixed background spend not counting toward the key's project or per-model budgets ([#&#8203;47504](https://github.com/BerriAI/litellm/issues/47504))
- Fixed the billed cost of background responses not reaching key and team loggers ([#&#8203;47506](https://github.com/BerriAI/litellm/issues/47506))
- Fixed failed Responses streams billing 0 tokens and bridged `/v1/messages` stream failures not being reported ([#&#8203;47537](https://github.com/BerriAI/litellm/issues/47537))
- Fixed `clear_tool_uses_20250919` being silently dropped for `openai/` models on the Responses API ([#&#8203;47861](https://github.com/BerriAI/litellm/issues/47861))
- Fixed per-call `input_cost_per_token` and `output_cost_per_token` being ignored by `responses()` ([#&#8203;48119](https://github.com/BerriAI/litellm/issues/48119))
- Fixed 500 when replaying `web_search_call` input items that have no `action` ([#&#8203;48417](https://github.com/BerriAI/litellm/issues/48417))
- Fixed audio, PDF and image tool results and history media being dropped in Responses and Gemini conversions ([#&#8203;48484](https://github.com/BerriAI/litellm/issues/48484))
- Fixed retries from `previous_response_id` returning 400 on Bedrock after a failed turn ([#&#8203;48647](https://github.com/BerriAI/litellm/issues/48647))
- Fixed Responses params the chat bridge cannot translate causing 400s like `max_tool_calls` on Bedrock Claude ([#&#8203;48655](https://github.com/BerriAI/litellm/issues/48655))
- Fixed typed streaming text access breaking on `/v1/responses` when `logprobs` is omitted ([#&#8203;48686](https://github.com/BerriAI/litellm/issues/48686))
- Fixed `moderation` on `/v1/responses` being dropped before the OpenAI call ([#&#8203;48708](https://github.com/BerriAI/litellm/issues/48708))
- Fixed later citation batches and pending citations being dropped when streaming Responses ([#&#8203;48747](https://github.com/BerriAI/litellm/issues/48747))
- Fixed replayed Responses output items being rejected by OpenAI because of a null `created_by` ([#&#8203;48783](https://github.com/BerriAI/litellm/issues/48783))
- Fixed an empty `function_call_output` reaching models as serialized JSON instead of an empty tool result ([#&#8203;48845](https://github.com/BerriAI/litellm/issues/48845))
- Fixed Responses compaction by dropping params it rejects and sending Azure compaction to the v1 route ([#&#8203;48876](https://github.com/BerriAI/litellm/issues/48876))
- Fixed Responses item order, phase and boundaries not being replayed on the next chat turn ([#&#8203;48912](https://github.com/BerriAI/litellm/issues/48912))
- Fixed bridged Responses requests losing the requested text verbosity when sent to chat completions ([#&#8203;49049](https://github.com/BerriAI/litellm/issues/49049))
- Fixed deployment `itpm` and `otpm` limits not being checked or counted on later Responses WebSocket turns ([#&#8203;49069](https://github.com/BerriAI/litellm/issues/49069))
- Fixed `litellm.responses()` through `litellm_proxy/` leaving `e.body`, `e.code` and `e.type` empty on errors ([#&#8203;49073](https://github.com/BerriAI/litellm/issues/49073))
- Fixed dict `reasoning_effort` losing `mode` and `context` on Azure, ChatGPT, Perplexity, xAI, Fireworks and Copilot ([#&#8203;49082](https://github.com/BerriAI/litellm/issues/49082))
- Fixed repeated Codex tools being merged for all callers, now only merged when `drop_params` is on ([#&#8203;49112](https://github.com/BerriAI/litellm/issues/49112))
- Fixed native `/v1/responses` WebSocket turns not counting toward key and tag `tpm_limit` ([#&#8203;49257](https://github.com/BerriAI/litellm/issues/49257))
- Changed a lone Responses built-in tool on Claude to return 400 before token counting ([#&#8203;48798](https://github.com/BerriAI/litellm/issues/48798))

</details>

<details><summary><b>Messages API</b> (14)</summary>

- Fixed web-search-only requests coming back without native search blocks on streamed replies ([#&#8203;40967](https://github.com/BerriAI/litellm/issues/40967))
- Fixed retried `/v1/messages` attempts mixing up usage and spend logs, and exhausted retries billing only the last ([#&#8203;45194](https://github.com/BerriAI/litellm/issues/45194))
- Fixed `safeguard_results` and `stop_details` missing from streamed `/v1/messages` `message_delta` events ([#&#8203;46096](https://github.com/BerriAI/litellm/issues/46096))
- Fixed the `clear_tool_uses` polyfill ignoring `clear_at_least`, `exclude_tools` and `clear_tool_inputs` ([#&#8203;47123](https://github.com/BerriAI/litellm/issues/47123))
- Fixed `/v1/messages` PDF documents being sent to Azure OpenAI models as images instead of file parts ([#&#8203;47166](https://github.com/BerriAI/litellm/issues/47166))
- Fixed 500 on `/v1/messages` and count_tokens for null or numeric `tool_result` text, now a 400 ([#&#8203;47347](https://github.com/BerriAI/litellm/issues/47347))
- Fixed 400 `Tool reference not found` for tool names over 64 chars when a guardrail rewrites `/v1/messages` ([#&#8203;47434](https://github.com/BerriAI/litellm/issues/47434))
- Fixed canceled `/v1/messages` streams not closing the upstream request ([#&#8203;48220](https://github.com/BerriAI/litellm/issues/48220))
- Fixed `stop_sequences` being ignored for OpenAI models on `/v1/messages` ([#&#8203;48534](https://github.com/BerriAI/litellm/issues/48534))
- Fixed the client's `anthropic-beta` replacing the deployment's on `/v1/messages` ([#&#8203;48594](https://github.com/BerriAI/litellm/issues/48594))
- Fixed `/v1/messages` streams reporting zero `input_tokens` in `message_start` when bridged to Chat Completions ([#&#8203;48618](https://github.com/BerriAI/litellm/issues/48618))
- Fixed Anthropic-format `tool_choice` crashing input token counting and causing false budget refusals ([#&#8203;48624](https://github.com/BerriAI/litellm/issues/48624))
- Fixed 400 on `/v1/messages` caused by a non-spec `custom` object in tool definitions ([#&#8203;48893](https://github.com/BerriAI/litellm/issues/48893))
- Fixed Mistral thinking text being lost on streaming `/v1/messages` ([#&#8203;49059](https://github.com/BerriAI/litellm/issues/49059))

</details>

<details><summary><b>Realtime</b> (4)</summary>

- Added Soniox realtime speech-to-text on `/v1/realtime` with `stt-rt-v5` ([#&#8203;44822](https://github.com/BerriAI/litellm/issues/44822))
- Fixed Gemini Live ignoring `session.update` instructions and tools, and answering text clients with audio ([#&#8203;39864](https://github.com/BerriAI/litellm/issues/39864))
- Fixed `/health` reporting OpenAI realtime deployments with a missing or invalid key as healthy ([#&#8203;41233](https://github.com/BerriAI/litellm/issues/41233))
- Fixed sessions going silent when a transcript guardrail sent `turn_detection` with no `type` to OpenAI ([#&#8203;44939](https://github.com/BerriAI/litellm/issues/44939))

</details>

<details><summary><b>Embeddings, images and audio</b> (8)</summary>

- Added a per-request input batch limit on `/v1/embeddings` to cap how many inputs one call can send ([#&#8203;44574](https://github.com/BerriAI/litellm/issues/44574))
- Fixed video status and content polling failing with per-model keys by keeping `model_id` in video ids ([#&#8203;44614](https://github.com/BerriAI/litellm/issues/44614))
- Fixed `aws_polly/standard`, `long-form` and `generative` being sent with the `neural` engine ([#&#8203;47963](https://github.com/BerriAI/litellm/issues/47963))
- Fixed image generation ignoring `max_retries` and Router retries multiplying upstream attempts ([#&#8203;48705](https://github.com/BerriAI/litellm/issues/48705))
- Fixed async image edits with no image returning HTTP 500 instead of 400 ([#&#8203;48872](https://github.com/BerriAI/litellm/issues/48872))
- Fixed key and team `router_settings` being ignored on `/v1/images/generations` ([#&#8203;49286](https://github.com/BerriAI/litellm/issues/49286))
- Changed unsupported transcription providers to return 400 naming the provider and model instead of 500 ([#&#8203;47971](https://github.com/BerriAI/litellm/issues/47971))
- Removed `dall-e-2` and `dall-e-3` support, and image generation without a model now returns 400 ([#&#8203;48703](https://github.com/BerriAI/litellm/issues/48703))

</details>

<details><summary><b>Batches and files</b> (8)</summary>

- Added routing of `POST /v1/batches` to batch deployments and `supported_endpoints` on `/model_group/info` ([#&#8203;47376](https://github.com/BerriAI/litellm/issues/47376))
- Fixed 400 on `GET /files/{id}/content` with raw `gs://` file ids from the unmanaged Vertex batch flow ([#&#8203;40621](https://github.com/BerriAI/litellm/issues/40621))
- Fixed fine-tuning jobs failing with 400 for files uploaded with `target_model_names` ([#&#8203;46552](https://github.com/BerriAI/litellm/issues/46552))
- Fixed completed batches skipping success callbacks and losing usage under redaction ([#&#8203;47192](https://github.com/BerriAI/litellm/issues/47192))
- Fixed file lists showing every file on the shared key and ignoring `limit` and `after` with `require_managed_files` ([#&#8203;47682](https://github.com/BerriAI/litellm/issues/47682))
- Fixed batch retrieve showing zero prompt and completion tokens ([#&#8203;47740](https://github.com/BerriAI/litellm/issues/47740))
- Fixed unbillable batches blocking file deletes and new-batch polling ([#&#8203;48752](https://github.com/BerriAI/litellm/issues/48752))
- Fixed unmanaged `gs://` Vertex batches being costed through the wrong deployment and reading zero spend ([#&#8203;49301](https://github.com/BerriAI/litellm/issues/49301))

</details>

<details><summary><b>Vector stores</b> (5)</summary>

- Added OpenSearch k-NN search as a vector store provider ([#&#8203;47759](https://github.com/BerriAI/litellm/issues/47759))
- Fixed `/rag/ingest` and `/rag/query` ignoring team provider credentials and denying viewers and team JWTs ([#&#8203;45497](https://github.com/BerriAI/litellm/issues/45497))
- Fixed team key vector store search failing when the team's first model is from a different provider ([#&#8203;46894](https://github.com/BerriAI/litellm/issues/46894))
- Fixed team and key Allowed Vector Stores being ignored on `/v1/responses` `file_search` without a registry ([#&#8203;48915](https://github.com/BerriAI/litellm/issues/48915))
- Improved Vertex AI Search vector store searches by reusing HTTP/2 connections and OAuth tokens ([#&#8203;40631](https://github.com/BerriAI/litellm/issues/40631))

</details>

<details><summary><b>Token counting</b> (10)</summary>

- Added one log line per token count call with its id, model and count ([#&#8203;47657](https://github.com/BerriAI/litellm/issues/47657))
- Fixed `/v1/messages/count_tokens` and `/utils/token_counter` failing on histories with a compaction block ([#&#8203;44784](https://github.com/BerriAI/litellm/issues/44784))
- Fixed DeepSeek V4 token counts missing Azure's billed tokens by using DeepSeek's own tokenizer ([#&#8203;47173](https://github.com/BerriAI/litellm/issues/47173), [#&#8203;47353](https://github.com/BerriAI/litellm/issues/47353))
- Fixed `count_tokens` overcounting PDFs about 12x for OpenAI and Azure models ([#&#8203;47554](https://github.com/BerriAI/litellm/issues/47554))
- Fixed token counts retrying a failed HuggingFace tokenizer download and adding about 23s per request ([#&#8203;47586](https://github.com/BerriAI/litellm/issues/47586))
- Fixed HTTP 500 when counting tokens for Anthropic search results and unsupported blocks ([#&#8203;48699](https://github.com/BerriAI/litellm/issues/48699))
- Fixed token counts for OpenAI models newer than the tiktoken table by using `o200k_base` ([#&#8203;48728](https://github.com/BerriAI/litellm/issues/48728))
- Fixed a loaded Hugging Face tokenizer being hidden when a later download fails ([#&#8203;48916](https://github.com/BerriAI/litellm/issues/48916))
- Changed Responses input token counts to match inference, fixing Claude counts with tools and `text.format` ([#&#8203;47363](https://github.com/BerriAI/litellm/issues/47363))
- Improved `token_counter` for inline `auto` images, including images under 768 pixels, with no HTTP requests ([#&#8203;48526](https://github.com/BerriAI/litellm/issues/48526))

</details>

<details><summary><b>MCP</b> (27)</summary>

- Added upstream status and response body to the log when an MCP health check fails ([#&#8203;44125](https://github.com/BerriAI/litellm/issues/44125))
- Added support for redeeming an ID-JAG as an RFC 7523 `jwt-bearer` grant on the gateway token endpoint ([#&#8203;46748](https://github.com/BerriAI/litellm/issues/46748))
- Added Authorization URL, Token URL and Scopes fields to OAuth Delegate and True Passthrough server forms ([#&#8203;46941](https://github.com/BerriAI/litellm/issues/46941))
- Added tool search and multi-select to the MCP toolset editor in the Admin UI ([#&#8203;48601](https://github.com/BerriAI/litellm/issues/48601))
- Added failure logging for MCP SDK request rejections, shown as `MCP: request_rejected` ([#&#8203;49184](https://github.com/BerriAI/litellm/issues/49184))
- Fixed `LITELLM_MCP_TOOL_LISTING_TIMEOUT` not applying to paginated `tools/list` on `/mcp` ([#&#8203;46513](https://github.com/BerriAI/litellm/issues/46513))
- Fixed `tools/list` returning an empty list when servers answer 429, now retried with an error if all fail ([#&#8203;46649](https://github.com/BerriAI/litellm/issues/46649))
- Fixed 412 on MCP calls with `id_jag_subject_source: refresh_token` after an Okta OIDC login ([#&#8203;46745](https://github.com/BerriAI/litellm/issues/46745), [#&#8203;46747](https://github.com/BerriAI/litellm/issues/46747), [#&#8203;47004](https://github.com/BerriAI/litellm/issues/47004))
- Fixed the caller's LiteLLM key being forwarded to upstream MCP servers when `Authorization` is in `extra_headers` ([#&#8203;46932](https://github.com/BerriAI/litellm/issues/46932))
- Fixed VS Code sign-in to DCR bridge MCP servers when the upstream rejects loopback redirect URIs ([#&#8203;46940](https://github.com/BerriAI/litellm/issues/46940))
- Fixed 403 when `proxy_admin_viewer` stores its own MCP credentials ([#&#8203;46994](https://github.com/BerriAI/litellm/issues/46994))
- Fixed large MCP SSE tool results failing, and invalid size limits breaking MCP discovery and tool calls ([#&#8203;47034](https://github.com/BerriAI/litellm/issues/47034))
- Fixed streamed MCP auto-execute billing only the first of its two model calls ([#&#8203;47422](https://github.com/BerriAI/litellm/issues/47422), [#&#8203;47445](https://github.com/BerriAI/litellm/issues/47445), [#&#8203;48899](https://github.com/BerriAI/litellm/issues/48899))
- Fixed an upstream MCP 429 on session handshake being reported as an internal error ([#&#8203;47569](https://github.com/BerriAI/litellm/issues/47569))
- Fixed MCP OAuth sign-in callback returning 403 behind AWS WAF by sealing the `litellm_cp_return_to` cookie ([#&#8203;47595](https://github.com/BerriAI/litellm/issues/47595))
- Fixed per-user auth MCP servers missing from `/mcp-rest/tools/list` and `/mcp` `tools/list` ([#&#8203;47677](https://github.com/BerriAI/litellm/issues/47677))
- Fixed streaming MCP follow-ups on `/v1/responses` dropping all but the latest tool round ([#&#8203;47698](https://github.com/BerriAI/litellm/issues/47698))
- Fixed slow MCP tool calls delaying response headers until the SSE ping ([#&#8203;47897](https://github.com/BerriAI/litellm/issues/47897))
- Fixed MCP management routes to follow the gateway's existing access rules ([#&#8203;48080](https://github.com/BerriAI/litellm/issues/48080))
- Fixed a readonly MCP toolset URL returning every tool instead of only the toolset's tools ([#&#8203;48095](https://github.com/BerriAI/litellm/issues/48095))
- Fixed oversized SSE tool catalogs returning a generic 500, now 502 with the size limit and pagination advice ([#&#8203;48424](https://github.com/BerriAI/litellm/issues/48424))
- Fixed MCP toolset OAuth login advertising a resource URL that clients reject ([#&#8203;48474](https://github.com/BerriAI/litellm/issues/48474))
- Fixed revoked or expired browser sessions still being accepted during gateway authorization ([#&#8203;48494](https://github.com/BerriAI/litellm/issues/48494))
- Fixed MCP OpenAPI loading to accept valid YAML specs ([#&#8203;48622](https://github.com/BerriAI/litellm/issues/48622))
- Fixed MCP tools in both `allowed_tools` and `disallowed_tools` still being callable ([#&#8203;48625](https://github.com/BerriAI/litellm/issues/48625))
- Fixed MCP tools hidden by discovery guardrails still being callable by name ([#&#8203;48669](https://github.com/BerriAI/litellm/issues/48669))
- Changed admin-owned team keys to reach only their team's MCP servers and toolsets ([#&#8203;49161](https://github.com/BerriAI/litellm/issues/49161))

</details>

<details><summary><b>Agents</b> (10)</summary>

- Added the pi harness to `litellm.agent()` and fixed harness turn `cost` ignoring prompt cache prices ([#&#8203;45467](https://github.com/BerriAI/litellm/issues/45467))
- Added request log entries for rejected A2A calls to forbidden or unknown agents ([#&#8203;49492](https://github.com/BerriAI/litellm/issues/49492))
- Fixed OpenCode via `litellm.agent()` using the script's folder instead of the sandbox, and hanging on resume ([#&#8203;47530](https://github.com/BerriAI/litellm/issues/47530))
- Fixed Gemini Managed Agents create returning 400 for `name` and interactions dropping inline `agent_config` ([#&#8203;48750](https://github.com/BerriAI/litellm/issues/48750))
- Fixed `/a2a` calls to completion-bridge agents logging $0 on send and no spend row on stream ([#&#8203;49150](https://github.com/BerriAI/litellm/issues/49150))
- Fixed 404 on `/a2a/{agent_id}/message/stream` and `/v1/a2a/{agent_id}/message/stream` ([#&#8203;49471](https://github.com/BerriAI/litellm/issues/49471))
- Fixed agent `litellm_params.api_key` not being sent as bearer auth on A2A calls ([#&#8203;49474](https://github.com/BerriAI/litellm/issues/49474))
- Fixed agent list and detail responses showing non-admins the backend URL instead of the proxy URL ([#&#8203;49483](https://github.com/BerriAI/litellm/issues/49483))
- Fixed a blank search embedding model returning 503 instead of the `*_not_configured` 400 on agent and skill search ([#&#8203;49485](https://github.com/BerriAI/litellm/issues/49485))
- Changed proxy refusals on `/a2a` POST routes to return JSON-RPC errors ([#&#8203;49476](https://github.com/BerriAI/litellm/issues/49476))

</details>

<details><summary><b>Guardrails</b> (21)</summary>

- Added opt-in `response_masked_data` on PANW Prisma AIRS `post_call` blocks ([#&#8203;46219](https://github.com/BerriAI/litellm/issues/46219))
- Added `num_retries` to `generic_guardrail_api` for checks lost after connecting ([#&#8203;46965](https://github.com/BerriAI/litellm/issues/46965))
- Added a native Reco guardrail that blocks requests on Reco errors unless `fail_on_error: false` ([#&#8203;48243](https://github.com/BerriAI/litellm/issues/48243))
- Added Ovalix guardrail scanning of files, tool calls and tool results ([#&#8203;49309](https://github.com/BerriAI/litellm/issues/49309))
- Added `litellm.guardrails.apply` SDK helper to invoke configured guardrails and get native findings ([#&#8203;49460](https://github.com/BerriAI/litellm/issues/49460), [#&#8203;49469](https://github.com/BerriAI/litellm/issues/49469), [#&#8203;49470](https://github.com/BerriAI/litellm/issues/49470))
- Fixed guardrail masks on messages and tools not reaching Bedrock Converse requests ([#&#8203;45874](https://github.com/BerriAI/litellm/issues/45874))
- Fixed `generic_guardrail_api` rejecting Gemini native tools that have no `type` key ([#&#8203;46338](https://github.com/BerriAI/litellm/issues/46338))
- Fixed corrupted numbered PII tokens in Presidio when one value matches several entities with `output_parse_pii` ([#&#8203;47024](https://github.com/BerriAI/litellm/issues/47024))
- Fixed `hide-secrets` missing secrets in tool results, tool inputs, `tool_calls` arguments, and system prompts ([#&#8203;47122](https://github.com/BerriAI/litellm/issues/47122))
- Fixed generic guardrails with `mode: pre_mcp_call` being rejected at startup so MCP calls went unchecked ([#&#8203;48060](https://github.com/BerriAI/litellm/issues/48060))
- Fixed pass-through guardrails scanning `litellm_metadata` fields added by LiteLLM, which caused false matches ([#&#8203;48276](https://github.com/BerriAI/litellm/issues/48276))
- Fixed `hide-secrets` ignoring `skip_tool_message_in_guardrail` ([#&#8203;48689](https://github.com/BerriAI/litellm/issues/48689))
- Fixed guardrails chosen in a Responses WebSocket frame not running, and a 500 with other guardrail settings ([#&#8203;48725](https://github.com/BerriAI/litellm/issues/48725))
- Fixed Responses tool results not reaching `texts` guardrails ([#&#8203;48827](https://github.com/BerriAI/litellm/issues/48827))
- Fixed `google_text_moderation` scanning embeddings input ([#&#8203;48934](https://github.com/BerriAI/litellm/issues/48934))
- Fixed guardrail blocks on streamed `/v1/messages` not returning Anthropic events ([#&#8203;49010](https://github.com/BerriAI/litellm/issues/49010))
- Fixed streamed `/v1/completions` skipping `post_call` guardrails for masking and blocking ([#&#8203;49035](https://github.com/BerriAI/litellm/issues/49035))
- Fixed mid-stream upstream errors on `/v1/messages` being turned into a guardrail 400 ([#&#8203;49088](https://github.com/BerriAI/litellm/issues/49088))
- Changed guardrail blocks mid-stream to end chat completions streams with an error event, not a cut connection ([#&#8203;46953](https://github.com/BerriAI/litellm/issues/46953))
- Changed `lakera_v2` `on_flagged: block` to reject PII-only detections and added `on_flagged: mask` ([#&#8203;48944](https://github.com/BerriAI/litellm/issues/48944))
- Improved streaming by running sampled guardrail scans in the background so chunks no longer pause ([#&#8203;48952](https://github.com/BerriAI/litellm/issues/48952))

</details>

<details><summary><b>Caching</b> (4)</summary>

- Fixed streamed cache hits dropping reasoning, citations and audio and reordering tool calls ([#&#8203;32096](https://github.com/BerriAI/litellm/issues/32096))
- Fixed `cache_control` being stripped from caller messages and tools, which broke caching on Claude fallbacks ([#&#8203;35602](https://github.com/BerriAI/litellm/issues/35602))
- Fixed the cache key's model group being read from caller metadata instead of the router's metadata ([#&#8203;48917](https://github.com/BerriAI/litellm/issues/48917))
- Removed the disk cache backend, so `cache_params.type: disk` now stops proxy startup ([#&#8203;48114](https://github.com/BerriAI/litellm/issues/48114))

</details>

<details><summary><b>Routing and fallbacks</b> (44)</summary>

- Added mid-stream fallback continuation so a streaming chat cut off mid-answer continues on the configured fallback ([#&#8203;41127](https://github.com/BerriAI/litellm/issues/41127))
- Added Kubernetes pod discovery to spread load across pods behind a headless service `api_base` ([#&#8203;44342](https://github.com/BerriAI/litellm/issues/44342), [#&#8203;44393](https://github.com/BerriAI/litellm/issues/44393), [#&#8203;44666](https://github.com/BerriAI/litellm/issues/44666))
- Added opt-in filtering that keeps chat requests off deployments flagged as non-chat ([#&#8203;46257](https://github.com/BerriAI/litellm/issues/46257))
- Added the `x-litellm-priority` header to set request priority ([#&#8203;47618](https://github.com/BerriAI/litellm/issues/47618))
- Added opt-in session repinning to the replacement deployment after a successful failover ([#&#8203;48206](https://github.com/BerriAI/litellm/issues/48206))
- Added a `clamp` mode for complexity routing that keeps the caller's smaller output token limit ([#&#8203;48632](https://github.com/BerriAI/litellm/issues/48632))
- Added deployment `rpd` and `tpd` daily limits to `enforce_model_rate_limits` ([#&#8203;48875](https://github.com/BerriAI/litellm/issues/48875), [#&#8203;48957](https://github.com/BerriAI/litellm/issues/48957))
- Added inferring custom classifier tiers from model mappings, and fixed a crash on plan-mode requests ([#&#8203;48987](https://github.com/BerriAI/litellm/issues/48987))
- Fixed weighted failover skipping healthy same-group deployments under affinity ([#&#8203;32309](https://github.com/BerriAI/litellm/issues/32309))
- Fixed `content_policy_fallbacks` not applying after `POST /fallback` or `/config/update` changes ([#&#8203;45428](https://github.com/BerriAI/litellm/issues/45428))
- Fixed an explicit `allowed_fails: 3` not counting failures and fallbacks cooling down healthy deployments ([#&#8203;46183](https://github.com/BerriAI/litellm/issues/46183))
- Fixed a `bedrock_mantle` deployment's `mode` switching sibling deployments between Chat Completions and Responses ([#&#8203;46263](https://github.com/BerriAI/litellm/issues/46263))
- Fixed prompt caching affinity ignoring tools and the `/v1/messages` system prompt when choosing a deployment ([#&#8203;46411](https://github.com/BerriAI/litellm/issues/46411))
- Fixed all-cooled router 429 rows in SpendLogs not recording which deployments were cooling ([#&#8203;47120](https://github.com/BerriAI/litellm/issues/47120))
- Fixed `stream_timeout` cutting off slow answers when Bedrock serves a `stream=True` call without streaming ([#&#8203;47162](https://github.com/BerriAI/litellm/issues/47162))
- Fixed key and team `router_settings` reaching the provider and dropping retries, fallbacks and timeout ([#&#8203;47257](https://github.com/BerriAI/litellm/issues/47257))
- Fixed 500s from `router_settings.default_priority` or an integer `priority`, and now reject a malformed `priority` ([#&#8203;47498](https://github.com/BerriAI/litellm/issues/47498))
- Fixed fallback retries logging a negative completion time and dropping latency-routed groups ([#&#8203;47541](https://github.com/BerriAI/litellm/issues/47541))
- Fixed prompt caching affinity raising on non-dict `tools` entries instead of returning the provider's 400 ([#&#8203;47565](https://github.com/BerriAI/litellm/issues/47565))
- Fixed cut Responses streams returning `server_error` instead of continuing on a fallback without prefill ([#&#8203;47672](https://github.com/BerriAI/litellm/issues/47672))
- Fixed `IndexError` and wrong deployment lookups when deployments are deleted or added concurrently ([#&#8203;47680](https://github.com/BerriAI/litellm/issues/47680))
- Fixed native Responses latency using different units than bridged responses in latency-based routing ([#&#8203;47727](https://github.com/BerriAI/litellm/issues/47727))
- Fixed the router sending image requests to `supports_vision: false` deployments in mixed model groups ([#&#8203;48149](https://github.com/BerriAI/litellm/issues/48149), [#&#8203;48152](https://github.com/BerriAI/litellm/issues/48152), [#&#8203;48241](https://github.com/BerriAI/litellm/issues/48241))
- Fixed Decisions calls routing to deployments whose provider does not support them ([#&#8203;48175](https://github.com/BerriAI/litellm/issues/48175))
- Fixed 500s on every request to a model group after one negative or NaN latency sample under latency routing ([#&#8203;48216](https://github.com/BerriAI/litellm/issues/48216))
- Fixed tag fail-open groups rejecting unmatched tags after affinity or cooldown filtering ([#&#8203;48470](https://github.com/BerriAI/litellm/issues/48470))
- Fixed one caller's exhausted forwarded Claude subscription putting the shared model into cooldown for others ([#&#8203;48485](https://github.com/BerriAI/litellm/issues/48485))
- Fixed proxy-wide wildcard deployments shadowing a team's own wildcard deployment for that team's keys ([#&#8203;48490](https://github.com/BerriAI/litellm/issues/48490))
- Fixed complexity router replacing the held `user_turn` route on Codex compaction requests ([#&#8203;48627](https://github.com/BerriAI/litellm/issues/48627))
- Fixed session tier pins diverging between proxy workers when using Redis ([#&#8203;48645](https://github.com/BerriAI/litellm/issues/48645))
- Fixed nested environment references in router classifier connections being sent literally ([#&#8203;48717](https://github.com/BerriAI/litellm/issues/48717))
- Fixed lifecycle events not passing through on background OpenAI Responses streams that cannot fall back ([#&#8203;48817](https://github.com/BerriAI/litellm/issues/48817))
- Fixed new fallback rules erasing older ones when Redis refuses `DEL` ([#&#8203;48999](https://github.com/BerriAI/litellm/issues/48999))
- Fixed a deployment's own `model_id` being overridden by the request body's ([#&#8203;49045](https://github.com/BerriAI/litellm/issues/49045))
- Fixed 429s on requests without `max_tokens` and token counters not dropping to real usage after calls ([#&#8203;49054](https://github.com/BerriAI/litellm/issues/49054))
- Fixed streamed context window errors skipping fallbacks when they occur before any output ([#&#8203;49293](https://github.com/BerriAI/litellm/issues/49293))
- Fixed large requests silently falling back to heuristic routing when they exceed the classifier's input limit ([#&#8203;49306](https://github.com/BerriAI/litellm/issues/49306))
- Fixed queued requests waiting until a 408 when a dead replica left expired scheduler queue entries ([#&#8203;49387](https://github.com/BerriAI/litellm/issues/49387))
- Changed per-deployment `reasoning_effort_levels` to apply on every provider and route, including `azure_ai` ([#&#8203;46601](https://github.com/BerriAI/litellm/issues/46601))
- Changed tag routing to use only prefixed caller tags once `tag_routing_prefix` is set ([#&#8203;47428](https://github.com/BerriAI/litellm/issues/47428))
- Changed router `allowed_fails` to keep a lone deployment with no fallback in rotation instead of returning 429 ([#&#8203;48644](https://github.com/BerriAI/litellm/issues/48644))
- Changed `user_turn` routing so child agent requests keep their own tier pin ([#&#8203;48701](https://github.com/BerriAI/litellm/issues/48701))
- Changed Router init to reject string fallback targets that never routed ([#&#8203;48943](https://github.com/BerriAI/litellm/issues/48943))
- Removed the deployment `rpm` filter from `enable_pre_call_checks` ([#&#8203;48873](https://github.com/BerriAI/litellm/issues/48873))

</details>

<details><summary><b>Cost tracking and pricing</b> (36)</summary>

- Added `s3://` URI support for `LITELLM_MODEL_COST_MAP_URL` ([#&#8203;46972](https://github.com/BerriAI/litellm/issues/46972))
- Added `model_info.pricing_provider` to price a deployment from another provider's catalog rates instead of $0 ([#&#8203;47620](https://github.com/BerriAI/litellm/issues/47620))
- Added `x-litellm-upstream-model` header so pass-through upstreams can report the model name for spend ([#&#8203;48275](https://github.com/BerriAI/litellm/issues/48275))
- Added a per-guardrail spend breakdown to user, team and organization daily activity ([#&#8203;48702](https://github.com/BerriAI/litellm/issues/48702))
- Fixed …
rogerrum pushed a commit to rogerrum/k8s-gitops that referenced this pull request Nov 22, 2026
….109.1 ) (#3743)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | minor | `v1.106.4` → `v1.109.1` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/3566) for more information.

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.109.1`](https://github.com/BerriAI/litellm/releases/tag/v1.109.1)

[Compare Source](https://github.com/BerriAI/litellm/compare/v1.109.0...v1.109.1)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). This release is signed with the key introduced in [commit `e82a3c6`](https://github.com/BerriAI/litellm/commit/e82a3c646908ba0a6ee0beddc4310d7a6cac4065).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the published signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.1
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.109.1/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.1
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- security(proxy): backport [#&#8203;51254](https://github.com/BerriAI/litellm/issues/51254) to stable/1.109.x by [@&#8203;shrey-berri](https://github.com/shrey-berri) in [#&#8203;51264](https://github.com/BerriAI/litellm/pull/51264)
- chore: bump litellm 1.109.0 -> 1.109.1 by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;51298](https://github.com/BerriAI/litellm/pull/51298)

**Full Changelog**: <https://github.com/BerriAI/litellm/compare/v1.109.0...v1.109.1>

### [`v1.109.0`](https://github.com/BerriAI/litellm/releases/tag/v1.109.0)

[Compare Source](https://github.com/BerriAI/litellm/compare/v1.108.7...v1.109.0)

#### Verify this release

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.109.0
```

Same command for `litellm-database`, `litellm-non_root` and the `docker.io/litellm/*` images

#### What's new in 1.109.0

982 PRs. 144 added, 424 fixed, 60 changed, 17 improved, 9 removed. 5 need action

##### Action required

- **Routing and fallbacks:** Change string fallback targets to lists of model names ([#&#8203;48943](https://github.com/BerriAI/litellm/issues/48943))
- **Caching:** Switch `cache_params.type` from `disk` to `local` or `redis`, since the `disk` cache backend (diskcache) has been removed ([#&#8203;48114](https://github.com/BerriAI/litellm/issues/48114))
- **Routing and fallbacks:** Add `optional_pre_call_checks: ["enforce_model_rate_limits"]` to keep a hard `rpm` cap on deployments ([#&#8203;48873](https://github.com/BerriAI/litellm/issues/48873))
- **Vertex AI and Gemini:** Set `drop_params: true` or stop sending `temperature`, `top_p` and `top_k` to Gemini 3.6 Flash, 3.5 Flash-Lite and newer ([#&#8203;47645](https://github.com/BerriAI/litellm/issues/47645))
- **Deployment:** Deploy Lens from its own chart and set `lens.*` in your values ([#&#8203;49169](https://github.com/BerriAI/litellm/issues/49169))

##### Highlights

- **Admin UI:** Added a Chat UI with a model hub, image generation and usage metrics ([#&#8203;48108](https://github.com/BerriAI/litellm/issues/48108))
- **Routing and fallbacks:** Added mid-stream fallback continuation so a streaming chat cut off mid-answer continues on the configured fallback ([#&#8203;41127](https://github.com/BerriAI/litellm/issues/41127))
- **Deployment:** Added `LITELLM_OFFLINE_MODE` to turn off every fetch LiteLLM makes on its own with one switch ([#&#8203;48096](https://github.com/BerriAI/litellm/issues/48096))
- **Cost tracking and pricing:** Added `model_info.pricing_provider` to price a deployment from another provider's catalog rates instead of $0 ([#&#8203;47620](https://github.com/BerriAI/litellm/issues/47620))
- **Vertex AI and Gemini:** Added Gemini 3.1 Flash TTS support, including multi-speaker voices and `mp3`, `opus`, `alaw` and `mulaw` output ([#&#8203;31915](https://github.com/BerriAI/litellm/issues/31915))
- **SDK:** Fixed tool calls on `completion()` and `responses()` failing with `No module named 'mcp'` on base SDK installs ([#&#8203;45961](https://github.com/BerriAI/litellm/issues/45961)) <sup>Also in [1.108.4](https://github.com/BerriAI/litellm/releases/tag/v1.108.4)</sup>

##### All changes

<details><summary><b>OpenAI</b> (19)</summary>

- Added per-deployment workload identity on non-chat routes, realtime and the moderation guardrail ([#&#8203;39966](https://github.com/BerriAI/litellm/issues/39966))
- Added the 12-hour cache write rate for `gpt-5.6-cyber` ([#&#8203;48246](https://github.com/BerriAI/litellm/issues/48246))
- Added OpenAI `gpt-6.1-terra` with pricing ([#&#8203;48429](https://github.com/BerriAI/litellm/issues/48429))
- Added Batch and Ultrafast 12-hour cache write rates for OpenAI models ([#&#8203;48433](https://github.com/BerriAI/litellm/issues/48433))
- Added `gpt-6-rosalind` to the model cost map with its published prices ([#&#8203;49268](https://github.com/BerriAI/litellm/issues/49268))
- Added `gpt-6-astra-law` with pricing from the OpenAI pricing page ([#&#8203;49444](https://github.com/BerriAI/litellm/issues/49444))
- Fixed 400 errors and $0 spend logs on `gpt-transcribe` calls without `response_format` ([#&#8203;44021](https://github.com/BerriAI/litellm/issues/44021))
- Fixed nonstreaming `aiohttp_openai` responses dropping `service_tier` ([#&#8203;47263](https://github.com/BerriAI/litellm/issues/47263))
- Fixed `prompt_cache_retention` such as `24h` being silently dropped instead of sent upstream ([#&#8203;47480](https://github.com/BerriAI/litellm/issues/47480))
- Fixed `/health` marking OpenAI and Azure audio chat models unhealthy ([#&#8203;47730](https://github.com/BerriAI/litellm/issues/47730))
- Fixed OpenAI `context_length_exceeded` errors raising `BadRequestError` instead of `ContextWindowExceededError` ([#&#8203;47954](https://github.com/BerriAI/litellm/issues/47954))
- Fixed 12-hour prompt cache writes on `openai/gpt-5.6` and newer billing at the 30-minute rate ([#&#8203;48088](https://github.com/BerriAI/litellm/issues/48088))
- Fixed uncatalogued ChatGPT models hitting an unsupported Chat Completions endpoint ([#&#8203;48244](https://github.com/BerriAI/litellm/issues/48244))
- Fixed the whole `reasoning_effort` dict not being sent when chat is bridged to Responses ([#&#8203;48807](https://github.com/BerriAI/litellm/issues/48807))
- Fixed 400 `invalid_beta` on Agents API calls through the OpenAI passthrough ([#&#8203;49009](https://github.com/BerriAI/litellm/issues/49009))
- Fixed empty `e.response.text` on OpenAI and Azure errors so the upstream error body is readable ([#&#8203;49079](https://github.com/BerriAI/litellm/issues/49079))
- Changed OpenAI 401 and 404 `invalid_request_error` to raise matching exceptions, not `BadRequestError` ([#&#8203;32537](https://github.com/BerriAI/litellm/issues/32537))
- Changed the ChatGPT session id to derive from `prompt_cache_key` for stable cache affinity ([#&#8203;42014](https://github.com/BerriAI/litellm/issues/42014))
- Changed `gpt-6-luna` Decisions cache rates to the standard cached and write rates ([#&#8203;48066](https://github.com/BerriAI/litellm/issues/48066))

</details>

<details><summary><b>Azure</b> (18)</summary>

- Added Entra ID auth, including keyless auth, for Azure Decisions on `/v1/decisions` and `/v1/systemone` ([#&#8203;46539](https://github.com/BerriAI/litellm/issues/46539), [#&#8203;48529](https://github.com/BerriAI/litellm/issues/48529))
- Added access to Foundry agents through the project Responses API for `azure_ai/agents/<name>` ([#&#8203;47717](https://github.com/BerriAI/litellm/issues/47717))
- Added `azure_ai/MAI-Code-1.1-Flash` ([#&#8203;47779](https://github.com/BerriAI/litellm/issues/47779))
- Added `max_input_tokens` of 32768 for `azure_ai/Microsoft-Decision-1` ([#&#8203;48434](https://github.com/BerriAI/litellm/issues/48434))
- Added `outputContentFormat=markdown` support on `/ocr` for Azure Document Intelligence ([#&#8203;48926](https://github.com/BerriAI/litellm/issues/48926))
- Fixed Foundry chat requests losing OpenAI prompt cache breakpoints ([#&#8203;45299](https://github.com/BerriAI/litellm/issues/45299))
- Fixed `/v1/responses` 404 on dated `api_version` deployments and `azure_ai` Grok reasoning token billing ([#&#8203;46377](https://github.com/BerriAI/litellm/issues/46377))
- Fixed under-billed Grok reasoning tokens on `azure_ai` when the deployment name lacks "grok" ([#&#8203;46969](https://github.com/BerriAI/litellm/issues/46969))
- Fixed Azure realtime over WebRTC failing with a 404 on `client_secrets` and an invalid token on the SDP exchange ([#&#8203;47316](https://github.com/BerriAI/litellm/issues/47316))
- Fixed 400 from Foundry when tool results contain `tool_reference` parts on chat ([#&#8203;48032](https://github.com/BerriAI/litellm/issues/48032))
- Fixed 400 on `azure_ai/claude-*` when using `thinking.block_binding` ([#&#8203;48033](https://github.com/BerriAI/litellm/issues/48033))
- Fixed Responses API calls that use an explicit v1 Azure base URL ([#&#8203;48118](https://github.com/BerriAI/litellm/issues/48118))
- Fixed 404 on Azure vector store retrieve, update and delete ([#&#8203;48224](https://github.com/BerriAI/litellm/issues/48224))
- Fixed null audio capability metadata on two Azure audio snapshot models ([#&#8203;48475](https://github.com/BerriAI/litellm/issues/48475))
- Fixed Azure `context_length_exceeded` raising `BadRequestError` so `context_window_fallbacks` never ran ([#&#8203;48616](https://github.com/BerriAI/litellm/issues/48616))
- Fixed batch calls on unversioned `azure/` o3, o4-mini, o3-mini, gpt-4o and gpt-4o-mini billing at the standard rate ([#&#8203;49182](https://github.com/BerriAI/litellm/issues/49182))
- Changed `max_input_tokens` to 128000 for `gpt-chat-latest` on Azure ([#&#8203;48252](https://github.com/BerriAI/litellm/issues/48252))
- Improved Entra auth by reusing credentials and tokens across requests and refreshing them off the event loop ([#&#8203;46421](https://github.com/BerriAI/litellm/issues/46421), [#&#8203;47348](https://github.com/BerriAI/litellm/issues/47348), [#&#8203;48769](https://github.com/BerriAI/litellm/issues/48769))

</details>

<details><summary><b>Anthropic</b> (16)</summary>

- Fixed a fake `[System: ...]` message being added to tool-call-only assistant turns sent to Anthropic ([#&#8203;34822](https://github.com/BerriAI/litellm/issues/34822))
- Fixed PDFs sent as chat `image_url` being rejected with 400 by sending them as document blocks ([#&#8203;46984](https://github.com/BerriAI/litellm/issues/46984))
- Fixed Claude `json_schema` answers losing keys listed only in `required` and escaping non-ASCII characters ([#&#8203;47478](https://github.com/BerriAI/litellm/issues/47478))
- Fixed replayed `redacted_thinking` blocks being dropped, and Bedrock Converse 400s when sent twice ([#&#8203;47489](https://github.com/BerriAI/litellm/issues/47489))
- Fixed `clear_tool_uses` `input_tokens` trigger ignoring the system prompt, which delayed clearing ([#&#8203;47857](https://github.com/BerriAI/litellm/issues/47857))
- Fixed native Anthropic responses omitting a null `stop_sequence` ([#&#8203;47987](https://github.com/BerriAI/litellm/issues/47987))
- Fixed streamed responses leaving native web search fees out of the reconstructed usage cost ([#&#8203;48528](https://github.com/BerriAI/litellm/issues/48528))
- Fixed `drop_params` not dropping `speed` on `claude-opus-4-7`, which Anthropic rejects with 400 ([#&#8203;48764](https://github.com/BerriAI/litellm/issues/48764))
- Fixed 400 from beta-gated body fields when `drop_params: true`, including Claude Code and Codex traffic ([#&#8203;48793](https://github.com/BerriAI/litellm/issues/48793))
- Fixed `model_context_window_exceeded` being reported as `stop` instead of `length` ([#&#8203;48874](https://github.com/BerriAI/litellm/issues/48874))
- Fixed 400 on `/v1/messages` with many strict tools under `drop_params` by retrying without `strict` ([#&#8203;49102](https://github.com/BerriAI/litellm/issues/49102))
- Fixed Claude `pause_turn` reported as finished and refusal explanations dropped on chat and Responses ([#&#8203;49192](https://github.com/BerriAI/litellm/issues/49192))
- Fixed 500 on a non-string role or tool call id, now a 400 that names the field ([#&#8203;49237](https://github.com/BerriAI/litellm/issues/49237))
- Fixed `metadata.user_id` being dropped on Anthropic `/v1/messages` pass-through routes ([#&#8203;49333](https://github.com/BerriAI/litellm/issues/49333))
- Changed the default `max_tokens` for unmapped Anthropic models from 4096 to 128000 ([#&#8203;48502](https://github.com/BerriAI/litellm/issues/48502))
- Changed the opening prompt usage estimate in the Chat Completions adapter to be off by default ([#&#8203;48633](https://github.com/BerriAI/litellm/issues/48633))

</details>

<details><summary><b>AWS Bedrock</b> (28)</summary>

- Added context and output token limits for the Nova Sonic models ([#&#8203;48247](https://github.com/BerriAI/litellm/issues/48247))
- Added pricing for native `guardrailConfig` trace usage to spend and `x-litellm-response-cost` ([#&#8203;48278](https://github.com/BerriAI/litellm/issues/48278))
- Added `global.openai.gpt-6.1-terra` and `us.openai.gpt-6.1-terra` Bedrock models with pricing ([#&#8203;48441](https://github.com/BerriAI/litellm/issues/48441))
- Added token counting for three Mantle-native Bedrock Claude models ([#&#8203;48682](https://github.com/BerriAI/litellm/issues/48682))
- Added published Priority, Batch and Flex prices to 46 Bedrock regional rows ([#&#8203;49113](https://github.com/BerriAI/litellm/issues/49113))
- Fixed Bedrock Voxtral transcription returning 400, logging $0 spend and ignoring `language` ([#&#8203;41565](https://github.com/BerriAI/litellm/issues/41565))
- Fixed `Unknown provider=None` 404 for Bedrock models missing from the cost map ([#&#8203;43290](https://github.com/BerriAI/litellm/issues/43290))
- Fixed 400 errors on Bedrock Kimi K3 Converse calls with `max_tokens` below 16 ([#&#8203;43875](https://github.com/BerriAI/litellm/issues/43875))
- Fixed 400 `invalid beta flag` on Claude Code auto mode requests that carry no `safeguards` ([#&#8203;44471](https://github.com/BerriAI/litellm/issues/44471))
- Fixed a malformed Bedrock batch JSONL line failing the upload with a 500 instead of a 400 ([#&#8203;45992](https://github.com/BerriAI/litellm/issues/45992))
- Fixed `post_call` guardrails not scanning Claude output on `invoke-with-response-stream` passthrough ([#&#8203;46524](https://github.com/BerriAI/litellm/issues/46524))
- Fixed Claude `json_schema` streams dropping reasoning and thinking blocks and ending on `tool_calls` with no tool calls ([#&#8203;46863](https://github.com/BerriAI/litellm/issues/46863))
- Fixed JSON schema requests failing on Fable 5 and Sonnet 4.6 and losing adaptive thinking on Haiku 5.5 ([#&#8203;46870](https://github.com/BerriAI/litellm/issues/46870))
- Fixed `bedrock_request_metadata_fields` being ignored on the `/bedrock` pass-through routes ([#&#8203;47040](https://github.com/BerriAI/litellm/issues/47040))
- Fixed Bedrock Opus 4.8 and Sonnet 5 dropping reasoning on `json_schema` requests by trying native output first ([#&#8203;47100](https://github.com/BerriAI/litellm/issues/47100))
- Fixed Bedrock batch jobs ignoring a configured control-plane endpoint ([#&#8203;47260](https://github.com/BerriAI/litellm/issues/47260))
- Fixed AWS region lookups through Vault blocking the event loop and stalling other requests on the worker ([#&#8203;47331](https://github.com/BerriAI/litellm/issues/47331))
- Fixed $0 spend and `ModelNotMappedError` for `bedrock/claude_platform/<id>` calls ([#&#8203;48150](https://github.com/BerriAI/litellm/issues/48150))
- Fixed `max_input_tokens` to 922000 on Bedrock GPT models and added Mantle token counting for `claude-opus-5-5` ([#&#8203;48479](https://github.com/BerriAI/litellm/issues/48479))
- Fixed Bedrock rejecting `strict` tool schemas by retrying without `strict` under `drop_params` ([#&#8203;48733](https://github.com/BerriAI/litellm/issues/48733))
- Fixed 400 on Bedrock when Codex repeats its tool list across turns ([#&#8203;49006](https://github.com/BerriAI/litellm/issues/49006))
- Fixed region-prefixed Bedrock embedding models not routing to their region or billing its price ([#&#8203;49072](https://github.com/BerriAI/litellm/issues/49072))
- Fixed `bedrock_mantle/openai.gpt-5.6-cyber` token limits and endpoints to match its model card ([#&#8203;49350](https://github.com/BerriAI/litellm/issues/49350))
- Fixed `max_output_tokens` for Bedrock GovCloud West Llama 3 models, now 8192 ([#&#8203;49543](https://github.com/BerriAI/litellm/issues/49543))
- Changed `converse-stream` pass-through to stream frames through post_call guardrails instead of buffering the reply ([#&#8203;46307](https://github.com/BerriAI/litellm/issues/46307))
- Changed `/bedrock` pass-through routes to apply a model's `guardrailConfig`, returning 400 if Bedrock cannot use it ([#&#8203;47429](https://github.com/BerriAI/litellm/issues/47429))
- Changed Bedrock pass-through to use request metadata as the session id, fixing 400s with `missing_session_id: reject` ([#&#8203;49193](https://github.com/BerriAI/litellm/issues/49193))
- Changed Bedrock Invoke and Mantle Claude to use the model's own default `max_tokens` ([#&#8203;49724](https://github.com/BerriAI/litellm/issues/49724))

</details>

<details><summary><b>Vertex AI and Gemini</b> (34)</summary>

- Added Gemini 3.1 Flash TTS support, including multi-speaker voices and `mp3`, `opus`, `alaw` and `mulaw` output ([#&#8203;31915](https://github.com/BerriAI/litellm/issues/31915))
- Added a setting to drop chosen `anthropic-beta` values on the Vertex AI pass-through routes ([#&#8203;47185](https://github.com/BerriAI/litellm/issues/47185))
- Added `LITELLM_GEMINI_DEFAULT_MAX_OUTPUT_TOKENS` to set the output limit for requests that set none ([#&#8203;47542](https://github.com/BerriAI/litellm/issues/47542))
- Added `thought_signature_in_tool_call_id` to keep Gemini tool call ids short for clients that cap them ([#&#8203;47692](https://github.com/BerriAI/litellm/issues/47692))
- Added a 2026-06-30 deprecation date to `vertex_ai/veo-2.0-generate-001` ([#&#8203;47847](https://github.com/BerriAI/litellm/issues/47847))
- Added Batch rates for two Llama 4 MaaS models so Vertex batch jobs no longer bill at on-demand rates ([#&#8203;48085](https://github.com/BerriAI/litellm/issues/48085))
- Added Vertex batch prices above 200k tokens and image output prices for Gemini models ([#&#8203;48945](https://github.com/BerriAI/litellm/issues/48945))
- Fixed the Gemini 3 sampling deprecation warning logging on every request, now once per model per worker ([#&#8203;40868](https://github.com/BerriAI/litellm/issues/40868))
- Fixed `vertex_ai/*` keys not listing partner, Veo and embedding models and dropping publisher prefixes ([#&#8203;41959](https://github.com/BerriAI/litellm/issues/41959))
- Fixed Gemini TTS `/v1/audio/speech` calling Google twice and logging 0 tokens in spend ([#&#8203;44551](https://github.com/BerriAI/litellm/issues/44551))
- Fixed 400 from compaction, thinking display and tool change betas on Claude via Vertex AI and Azure AI ([#&#8203;44747](https://github.com/BerriAI/litellm/issues/44747))
- Fixed context caching on Vertex AI failing when a custom `api_base` is set ([#&#8203;44783](https://github.com/BerriAI/litellm/issues/44783))
- Fixed streamed Vertex AI pass-through calls missing the regional 10% uplift and custom deployment prices ([#&#8203;44795](https://github.com/BerriAI/litellm/issues/44795))
- Fixed Gemini not receiving integer enum values in tool parameters ([#&#8203;44908](https://github.com/BerriAI/litellm/issues/44908))
- Fixed Vertex Claude batches returning 404 at create ([#&#8203;45715](https://github.com/BerriAI/litellm/issues/45715))
- Fixed cache-marked requests listing all `cachedContents` on every call and creating duplicate caches ([#&#8203;46857](https://github.com/BerriAI/litellm/issues/46857))
- Fixed Vertex AI rate limit errors returned as 403 when the error text contains 403 ([#&#8203;47134](https://github.com/BerriAI/litellm/issues/47134))
- Fixed Gemini audio input and cached audio billed at the Standard rate on flex, priority and batch tiers ([#&#8203;48086](https://github.com/BerriAI/litellm/issues/48086))
- Fixed `gemini-2.5-flash-native-audio` video input billed at the text rate instead of the audio/video rate ([#&#8203;48248](https://github.com/BerriAI/litellm/issues/48248))
- Fixed Gemini 2.5 rejecting tool results with images and the history replay that follows ([#&#8203;48428](https://github.com/BerriAI/litellm/issues/48428))
- Fixed Vertex AI shared credential cache growing without bound across credential and project pairs ([#&#8203;48442](https://github.com/BerriAI/litellm/issues/48442))
- Fixed Vertex AI image sizes outside the old lookup table silently producing square output ([#&#8203;48463](https://github.com/BerriAI/litellm/issues/48463))
- Fixed slow Google credential requests blocking the proxy worker on Claude `/v1/messages` ([#&#8203;48523](https://github.com/BerriAI/litellm/issues/48523))
- Fixed explicit Gemini and Vertex embedding timeouts silently becoming 300 seconds ([#&#8203;48690](https://github.com/BerriAI/litellm/issues/48690))
- Fixed Gemini grounding keeping only the first web source for a passage ([#&#8203;48745](https://github.com/BerriAI/litellm/issues/48745))
- Fixed `labels` on `vertex_ai/claude-*` returning 400 by sending them as `X-Vertex-AI-Labels` ([#&#8203;48753](https://github.com/BerriAI/litellm/issues/48753))
- Fixed 400 on `countTokens` and `generateContent` when repeated fields are a single object or null ([#&#8203;48771](https://github.com/BerriAI/litellm/issues/48771))
- Fixed Vertex Claude `/v1/messages` returning 400 when the SDK sends `anthropic-version` as a header ([#&#8203;48814](https://github.com/BerriAI/litellm/issues/48814))
- Fixed Claude web search billing per request on Vertex AI deployments priced in `model_info` ([#&#8203;49160](https://github.com/BerriAI/litellm/issues/49160))
- Fixed batch image output billed at the Standard rate on `gemini-nano-banana-2.1` and `gemini-3.1-flash-lite-image` ([#&#8203;49317](https://github.com/BerriAI/litellm/issues/49317), [#&#8203;49358](https://github.com/BerriAI/litellm/issues/49358))
- Changed Gemini 3.6 Flash, 3.5 Flash-Lite and newer to refuse `temperature`, `top_p` and `top_k` without `drop_params` ([#&#8203;47645](https://github.com/BerriAI/litellm/issues/47645))
- Improved rerank latency by reusing cached Google credentials on every request ([#&#8203;48430](https://github.com/BerriAI/litellm/issues/48430))
- Improved failure logs for Gemini and Vertex pass-through calls by adding the URL model and declared provider ([#&#8203;49075](https://github.com/BerriAI/litellm/issues/49075))
- Removed the floor `deprecation_date` from `gemini-3.1-flash-lite-image` ([#&#8203;48587](https://github.com/BerriAI/litellm/issues/48587))

</details>

<details><summary><b>Other providers</b> (3)</summary>

- Added 11 new providers: ai&, BigModel, CLF AI Gateway, Hostinger Router, Kyma API, Nace, OpenCode Go, OpenInfer, Refuseless, StreamLake and ZeroGPU ([#&#8203;38958](https://github.com/BerriAI/litellm/issues/38958), [#&#8203;39324](https://github.com/BerriAI/litellm/issues/39324), [#&#8203;41006](https://github.com/BerriAI/litellm/issues/41006), [#&#8203;41034](https://github.com/BerriAI/litellm/issues/41034), [#&#8203;43874](https://github.com/BerriAI/litellm/issues/43874), [#&#8203;44863](https://github.com/BerriAI/litellm/issues/44863), [#&#8203;46523](https://github.com/BerriAI/litellm/issues/46523), [#&#8203;48140](https://github.com/BerriAI/litellm/issues/48140), [#&#8203;48497](https://github.com/BerriAI/litellm/issues/48497), [#&#8203;48563](https://github.com/BerriAI/litellm/issues/48563), [#&#8203;48756](https://github.com/BerriAI/litellm/issues/48756))
- Added models, endpoints and options for smaller providers (31 PRs) ([#&#8203;41021](https://github.com/BerriAI/litellm/issues/41021), [#&#8203;41522](https://github.com/BerriAI/litellm/issues/41522), [#&#8203;46156](https://github.com/BerriAI/litellm/issues/46156), [#&#8203;46875](https://github.com/BerriAI/litellm/issues/46875), [#&#8203;47401](https://github.com/BerriAI/litellm/issues/47401), [#&#8203;47473](https://github.com/BerriAI/litellm/issues/47473), [#&#8203;47610](https://github.com/BerriAI/litellm/issues/47610), [#&#8203;47690](https://github.com/BerriAI/litellm/issues/47690), [#&#8203;47785](https://github.com/BerriAI/litellm/issues/47785), [#&#8203;47812](https://github.com/BerriAI/litellm/issues/47812), [#&#8203;48158](https://github.com/BerriAI/litellm/issues/48158), [#&#8203;48251](https://github.com/BerriAI/litellm/issues/48251), [#&#8203;48335](https://github.com/BerriAI/litellm/issues/48335), [#&#8203;48448](https://github.com/BerriAI/litellm/issues/48448), [#&#8203;48450](https://github.com/BerriAI/litellm/issues/48450), [#&#8203;48453](https://github.com/BerriAI/litellm/issues/48453), [#&#8203;48498](https://github.com/BerriAI/litellm/issues/48498), [#&#8203;48621](https://github.com/BerriAI/litellm/issues/48621), [#&#8203;48651](https://github.com/BerriAI/litellm/issues/48651), [#&#8203;48676](https://github.com/BerriAI/litellm/issues/48676), [#&#8203;48677](https://github.com/BerriAI/litellm/issues/48677), [#&#8203;48735](https://github.com/BerriAI/litellm/issues/48735), [#&#8203;48871](https://github.com/BerriAI/litellm/issues/48871), [#&#8203;48998](https://github.com/BerriAI/litellm/issues/48998), [#&#8203;49252](https://github.com/BerriAI/litellm/issues/49252), [#&#8203;49280](https://github.com/BerriAI/litellm/issues/49280), [#&#8203;49281](https://github.com/BerriAI/litellm/issues/49281), [#&#8203;49282](https://github.com/BerriAI/litellm/issues/49282), [#&#8203;49287](https://github.com/BerriAI/litellm/issues/49287), [#&#8203;49297](https://github.com/BerriAI/litellm/issues/49297), [#&#8203;49542](https://github.com/BerriAI/litellm/issues/49542))
- Fixed issues and updated behavior on smaller providers (41 PRs) ([#&#8203;38736](https://github.com/BerriAI/litellm/issues/38736), [#&#8203;40152](https://github.com/BerriAI/litellm/issues/40152), [#&#8203;43390](https://github.com/BerriAI/litellm/issues/43390), [#&#8203;44723](https://github.com/BerriAI/litellm/issues/44723), [#&#8203;45092](https://github.com/BerriAI/litellm/issues/45092), [#&#8203;45567](https://github.com/BerriAI/litellm/issues/45567), [#&#8203;46091](https://github.com/BerriAI/litellm/issues/46091), [#&#8203;46861](https://github.com/BerriAI/litellm/issues/46861), [#&#8203;46945](https://github.com/BerriAI/litellm/issues/46945), [#&#8203;46959](https://github.com/BerriAI/litellm/issues/46959), [#&#8203;47091](https://github.com/BerriAI/litellm/issues/47091), [#&#8203;47423](https://github.com/BerriAI/litellm/issues/47423), [#&#8203;47424](https://github.com/BerriAI/litellm/issues/47424), [#&#8203;47432](https://github.com/BerriAI/litellm/issues/47432), [#&#8203;47495](https://github.com/BerriAI/litellm/issues/47495), [#&#8203;47784](https://github.com/BerriAI/litellm/issues/47784), [#&#8203;47794](https://github.com/BerriAI/litellm/issues/47794), [#&#8203;48121](https://github.com/BerriAI/litellm/issues/48121), [#&#8203;48254](https://github.com/BerriAI/litellm/issues/48254), [#&#8203;48265](https://github.com/BerriAI/litellm/issues/48265), [#&#8203;48268](https://github.com/BerriAI/litellm/issues/48268), [#&#8203;48270](https://github.com/BerriAI/litellm/issues/48270), [#&#8203;48455](https://github.com/BerriAI/litellm/issues/48455), [#&#8203;48522](https://github.com/BerriAI/litellm/issues/48522), [#&#8203;48527](https://github.com/BerriAI/litellm/issues/48527), [#&#8203;48668](https://github.com/BerriAI/litellm/issues/48668), [#&#8203;48684](https://github.com/BerriAI/litellm/issues/48684), [#&#8203;48706](https://github.com/BerriAI/litellm/issues/48706), [#&#8203;48707](https://github.com/BerriAI/litellm/issues/48707), [#&#8203;48778](https://github.com/BerriAI/litellm/issues/48778), [#&#8203;48820](https://github.com/BerriAI/litellm/issues/48820), [#&#8203;48837](https://github.com/BerriAI/litellm/issues/48837), [#&#8203;49068](https://github.com/BerriAI/litellm/issues/49068), [#&#8203;49158](https://github.com/BerriAI/litellm/issues/49158), [#&#8203;49278](https://github.com/BerriAI/litellm/issues/49278), [#&#8203;49344](https://github.com/BerriAI/litellm/issues/49344), [#&#8203;49458](https://github.com/BerriAI/litellm/issues/49458), [#&#8203;49462](https://github.com/BerriAI/litellm/issues/49462), [#&#8203;49498](https://github.com/BerriAI/litellm/issues/49498), [#&#8203;49502](https://github.com/BerriAI/litellm/issues/49502), [#&#8203;49616](https://github.com/BerriAI/litellm/issues/49616))

</details>

<details><summary><b>Chat completions</b> (17)</summary>

- Fixed streams with `logprobs` ending in a 500 error frame before the finish chunk ([#&#8203;33549](https://github.com/BerriAI/litellm/issues/33549))
- Fixed 500 errors when a prompt template omits `initial_prompt_value` or `final_prompt_value` ([#&#8203;39762](https://github.com/BerriAI/litellm/issues/39762))
- Fixed rebuilt streamed text completions returning null `finish_reason` and zero `prompt_tokens` ([#&#8203;44349](https://github.com/BerriAI/litellm/issues/44349))
- Fixed Foundry deployments and Claude fallbacks getting the wrong cache options, which caused 400s ([#&#8203;45295](https://github.com/BerriAI/litellm/issues/45295))
- Fixed non-streaming chat dropping upstream response headers on `bedrock_mantle/` and other OpenAI-like providers ([#&#8203;46928](https://github.com/BerriAI/litellm/issues/46928))
- Fixed chat streams failing with a proxy error when progress chunks have no choice index ([#&#8203;46947](https://github.com/BerriAI/litellm/issues/46947))
- Fixed the overhead header under-reporting on chat requests when guardrails add `litellm_metadata` ([#&#8203;47790](https://github.com/BerriAI/litellm/issues/47790))
- Fixed streamed chunks containing `[DONE]` being read as end of stream and dropped ([#&#8203;47832](https://github.com/BerriAI/litellm/issues/47832))
- Fixed completions streams including `usage` when it was not requested ([#&#8203;48052](https://github.com/BerriAI/litellm/issues/48052))
- Fixed an upstream `abort` on streamed chat completions returning a clean HTTP 200 instead of a server error ([#&#8203;48328](https://github.com/BerriAI/litellm/issues/48328))
- Fixed unbalanced think tags in merged streams and SSE lines splitting on characters other than CR/LF ([#&#8203;48755](https://github.com/BerriAI/litellm/issues/48755))
- Fixed 400 on system-first models like Qwen3.5 when a later `developer` message appears ([#&#8203;48897](https://github.com/BerriAI/litellm/issues/48897))
- Fixed streamed chat completions with `n>1` rebuilding each choice ([#&#8203;49002](https://github.com/BerriAI/litellm/issues/49002))
- Fixed streaming clients missing tool execution when OpenAI-compatible providers end tool calls with `stop` ([#&#8203;49388](https://github.com/BerriAI/litellm/issues/49388))
- Changed the `include_usage` stream chunk to send an empty `choices` array like OpenAI ([#&#8203;47109](https://github.com/BerriAI/litellm/issues/47109))
- Changed stalled stream reads to raise a 408 `litellm.Timeout` on chat, messages and responses ([#&#8203;47198](https://github.com/BerriAI/litellm/issues/47198))
- Changed streams that end without a finish reason to fail as errors instead of reporting a normal completion ([#&#8203;47665](https://github.com/BerriAI/litellm/issues/47665))

</details>

<details><summary><b>Responses API</b> (34)</summary>

- Added `max_agentic_loops` support to raise the streamed MCP auto-execute round cap above 5 ([#&#8203;47688](https://github.com/BerriAI/litellm/issues/47688))
- Added resuming background response streams with `stream` and `starting_after` on retrieve ([#&#8203;48819](https://github.com/BerriAI/litellm/issues/48819))
- Added Codex client `tool_search` support on Anthropic and other bridged providers, cutting input tokens ([#&#8203;48972](https://github.com/BerriAI/litellm/issues/48972))
- Fixed Responses API logging tasks being dropped by garbage collection and cut off at shutdown ([#&#8203;31074](https://github.com/BerriAI/litellm/issues/31074))
- Fixed non-stream MCP auto-execute on `/v1/responses` logging and billing only one of its two model calls ([#&#8203;43667](https://github.com/BerriAI/litellm/issues/43667))
- Fixed 400 from malformed `prompt_cache_breakpoint` on `/v1/responses` with `drop_params: true` ([#&#8203;45330](https://github.com/BerriAI/litellm/issues/45330))
- Fixed later turns on an open Responses WebSocket skipping deployment checks and not counting toward budgets ([#&#8203;45727](https://github.com/BerriAI/litellm/issues/45727))
- Fixed streamed `/v1/responses` events showing the backend deployment name in nested `response.model` ([#&#8203;46662](https://github.com/BerriAI/litellm/issues/46662))
- Fixed `/v1/responses` on Claude dropping returned and replayed `compaction` items ([#&#8203;46754](https://github.com/BerriAI/litellm/issues/46754))
- Fixed Responses WebSocket running `pre_call` guardrails on turn one only and rebilling that cost every turn ([#&#8203;47013](https://github.com/BerriAI/litellm/issues/47013))
- Fixed OpenAI pass-through `GET /responses/{id}` being billed again on every call ([#&#8203;47171](https://github.com/BerriAI/litellm/issues/47171))
- Fixed background spend not counting toward the key's project or per-model budgets ([#&#8203;47504](https://github.com/BerriAI/litellm/issues/47504))
- Fixed the billed cost of background responses not reaching key and team loggers ([#&#8203;47506](https://github.com/BerriAI/litellm/issues/47506))
- Fixed failed Responses streams billing 0 tokens and bridged `/v1/messages` stream failures not being reported ([#&#8203;47537](https://github.com/BerriAI/litellm/issues/47537))
- Fixed `clear_tool_uses_20250919` being silently dropped for `openai/` models on the Responses API ([#&#8203;47861](https://github.com/BerriAI/litellm/issues/47861))
- Fixed per-call `input_cost_per_token` and `output_cost_per_token` being ignored by `responses()` ([#&#8203;48119](https://github.com/BerriAI/litellm/issues/48119))
- Fixed 500 when replaying `web_search_call` input items that have no `action` ([#&#8203;48417](https://github.com/BerriAI/litellm/issues/48417))
- Fixed audio, PDF and image tool results and history media being dropped in Responses and Gemini conversions ([#&#8203;48484](https://github.com/BerriAI/litellm/issues/48484))
- Fixed retries from `previous_response_id` returning 400 on Bedrock after a failed turn ([#&#8203;48647](https://github.com/BerriAI/litellm/issues/48647))
- Fixed Responses params the chat bridge cannot translate causing 400s like `max_tool_calls` on Bedrock Claude ([#&#8203;48655](https://github.com/BerriAI/litellm/issues/48655))
- Fixed typed streaming text access breaking on `/v1/responses` when `logprobs` is omitted ([#&#8203;48686](https://github.com/BerriAI/litellm/issues/48686))
- Fixed `moderation` on `/v1/responses` being dropped before the OpenAI call ([#&#8203;48708](https://github.com/BerriAI/litellm/issues/48708))
- Fixed later citation batches and pending citations being dropped when streaming Responses ([#&#8203;48747](https://github.com/BerriAI/litellm/issues/48747))
- Fixed replayed Responses output items being rejected by OpenAI because of a null `created_by` ([#&#8203;48783](https://github.com/BerriAI/litellm/issues/48783))
- Fixed an empty `function_call_output` reaching models as serialized JSON instead of an empty tool result ([#&#8203;48845](https://github.com/BerriAI/litellm/issues/48845))
- Fixed Responses compaction by dropping params it rejects and sending Azure compaction to the v1 route ([#&#8203;48876](https://github.com/BerriAI/litellm/issues/48876))
- Fixed Responses item order, phase and boundaries not being replayed on the next chat turn ([#&#8203;48912](https://github.com/BerriAI/litellm/issues/48912))
- Fixed bridged Responses requests losing the requested text verbosity when sent to chat completions ([#&#8203;49049](https://github.com/BerriAI/litellm/issues/49049))
- Fixed deployment `itpm` and `otpm` limits not being checked or counted on later Responses WebSocket turns ([#&#8203;49069](https://github.com/BerriAI/litellm/issues/49069))
- Fixed `litellm.responses()` through `litellm_proxy/` leaving `e.body`, `e.code` and `e.type` empty on errors ([#&#8203;49073](https://github.com/BerriAI/litellm/issues/49073))
- Fixed dict `reasoning_effort` losing `mode` and `context` on Azure, ChatGPT, Perplexity, xAI, Fireworks and Copilot ([#&#8203;49082](https://github.com/BerriAI/litellm/issues/49082))
- Fixed repeated Codex tools being merged for all callers, now only merged when `drop_params` is on ([#&#8203;49112](https://github.com/BerriAI/litellm/issues/49112))
- Fixed native `/v1/responses` WebSocket turns not counting toward key and tag `tpm_limit` ([#&#8203;49257](https://github.com/BerriAI/litellm/issues/49257))
- Changed a lone Responses built-in tool on Claude to return 400 before token counting ([#&#8203;48798](https://github.com/BerriAI/litellm/issues/48798))

</details>

<details><summary><b>Messages API</b> (14)</summary>

- Fixed web-search-only requests coming back without native search blocks on streamed replies ([#&#8203;40967](https://github.com/BerriAI/litellm/issues/40967))
- Fixed retried `/v1/messages` attempts mixing up usage and spend logs, and exhausted retries billing only the last ([#&#8203;45194](https://github.com/BerriAI/litellm/issues/45194))
- Fixed `safeguard_results` and `stop_details` missing from streamed `/v1/messages` `message_delta` events ([#&#8203;46096](https://github.com/BerriAI/litellm/issues/46096))
- Fixed the `clear_tool_uses` polyfill ignoring `clear_at_least`, `exclude_tools` and `clear_tool_inputs` ([#&#8203;47123](https://github.com/BerriAI/litellm/issues/47123))
- Fixed `/v1/messages` PDF documents being sent to Azure OpenAI models as images instead of file parts ([#&#8203;47166](https://github.com/BerriAI/litellm/issues/47166))
- Fixed 500 on `/v1/messages` and count_tokens for null or numeric `tool_result` text, now a 400 ([#&#8203;47347](https://github.com/BerriAI/litellm/issues/47347))
- Fixed 400 `Tool reference not found` for tool names over 64 chars when a guardrail rewrites `/v1/messages` ([#&#8203;47434](https://github.com/BerriAI/litellm/issues/47434))
- Fixed canceled `/v1/messages` streams not closing the upstream request ([#&#8203;48220](https://github.com/BerriAI/litellm/issues/48220))
- Fixed `stop_sequences` being ignored for OpenAI models on `/v1/messages` ([#&#8203;48534](https://github.com/BerriAI/litellm/issues/48534))
- Fixed the client's `anthropic-beta` replacing the deployment's on `/v1/messages` ([#&#8203;48594](https://github.com/BerriAI/litellm/issues/48594))
- Fixed `/v1/messages` streams reporting zero `input_tokens` in `message_start` when bridged to Chat Completions ([#&#8203;48618](https://github.com/BerriAI/litellm/issues/48618))
- Fixed Anthropic-format `tool_choice` crashing input token counting and causing false budget refusals ([#&#8203;48624](https://github.com/BerriAI/litellm/issues/48624))
- Fixed 400 on `/v1/messages` caused by a non-spec `custom` object in tool definitions ([#&#8203;48893](https://github.com/BerriAI/litellm/issues/48893))
- Fixed Mistral thinking text being lost on streaming `/v1/messages` ([#&#8203;49059](https://github.com/BerriAI/litellm/issues/49059))

</details>

<details><summary><b>Realtime</b> (4)</summary>

- Added Soniox realtime speech-to-text on `/v1/realtime` with `stt-rt-v5` ([#&#8203;44822](https://github.com/BerriAI/litellm/issues/44822))
- Fixed Gemini Live ignoring `session.update` instructions and tools, and answering text clients with audio ([#&#8203;39864](https://github.com/BerriAI/litellm/issues/39864))
- Fixed `/health` reporting OpenAI realtime deployments with a missing or invalid key as healthy ([#&#8203;41233](https://github.com/BerriAI/litellm/issues/41233))
- Fixed sessions going silent when a transcript guardrail sent `turn_detection` with no `type` to OpenAI ([#&#8203;44939](https://github.com/BerriAI/litellm/issues/44939))

</details>

<details><summary><b>Embeddings, images and audio</b> (8)</summary>

- Added a per-request input batch limit on `/v1/embeddings` to cap how many inputs one call can send ([#&#8203;44574](https://github.com/BerriAI/litellm/issues/44574))
- Fixed video status and content polling failing with per-model keys by keeping `model_id` in video ids ([#&#8203;44614](https://github.com/BerriAI/litellm/issues/44614))
- Fixed `aws_polly/standard`, `long-form` and `generative` being sent with the `neural` engine ([#&#8203;47963](https://github.com/BerriAI/litellm/issues/47963))
- Fixed image generation ignoring `max_retries` and Router retries multiplying upstream attempts ([#&#8203;48705](https://github.com/BerriAI/litellm/issues/48705))
- Fixed async image edits with no image returning HTTP 500 instead of 400 ([#&#8203;48872](https://github.com/BerriAI/litellm/issues/48872))
- Fixed key and team `router_settings` being ignored on `/v1/images/generations` ([#&#8203;49286](https://github.com/BerriAI/litellm/issues/49286))
- Changed unsupported transcription providers to return 400 naming the provider and model instead of 500 ([#&#8203;47971](https://github.com/BerriAI/litellm/issues/47971))
- Removed `dall-e-2` and `dall-e-3` support, and image generation without a model now returns 400 ([#&#8203;48703](https://github.com/BerriAI/litellm/issues/48703))

</details>

<details><summary><b>Batches and files</b> (8)</summary>

- Added routing of `POST /v1/batches` to batch deployments and `supported_endpoints` on `/model_group/info` ([#&#8203;47376](https://github.com/BerriAI/litellm/issues/47376))
- Fixed 400 on `GET /files/{id}/content` with raw `gs://` file ids from the unmanaged Vertex batch flow ([#&#8203;40621](https://github.com/BerriAI/litellm/issues/40621))
- Fixed fine-tuning jobs failing with 400 for files uploaded with `target_model_names` ([#&#8203;46552](https://github.com/BerriAI/litellm/issues/46552))
- Fixed completed batches skipping success callbacks and losing usage under redaction ([#&#8203;47192](https://github.com/BerriAI/litellm/issues/47192))
- Fixed file lists showing every file on the shared key and ignoring `limit` and `after` with `require_managed_files` ([#&#8203;47682](https://github.com/BerriAI/litellm/issues/47682))
- Fixed batch retrieve showing zero prompt and completion tokens ([#&#8203;47740](https://github.com/BerriAI/litellm/issues/47740))
- Fixed unbillable batches blocking file deletes and new-batch polling ([#&#8203;48752](https://github.com/BerriAI/litellm/issues/48752))
- Fixed unmanaged `gs://` Vertex batches being costed through the wrong deployment and reading zero spend ([#&#8203;49301](https://github.com/BerriAI/litellm/issues/49301))

</details>

<details><summary><b>Vector stores</b> (5)</summary>

- Added OpenSearch k-NN search as a vector store provider ([#&#8203;47759](https://github.com/BerriAI/litellm/issues/47759))
- Fixed `/rag/ingest` and `/rag/query` ignoring team provider credentials and denying viewers and team JWTs ([#&#8203;45497](https://github.com/BerriAI/litellm/issues/45497))
- Fixed team key vector store search failing when the team's first model is from a different provider ([#&#8203;46894](https://github.com/BerriAI/litellm/issues/46894))
- Fixed team and key Allowed Vector Stores being ignored on `/v1/responses` `file_search` without a registry ([#&#8203;48915](https://github.com/BerriAI/litellm/issues/48915))
- Improved Vertex AI Search vector store searches by reusing HTTP/2 connections and OAuth tokens ([#&#8203;40631](https://github.com/BerriAI/litellm/issues/40631))

</details>

<details><summary><b>Token counting</b> (10)</summary>

- Added one log line per token count call with its id, model and count ([#&#8203;47657](https://github.com/BerriAI/litellm/issues/47657))
- Fixed `/v1/messages/count_tokens` and `/utils/token_counter` failing on histories with a compaction block ([#&#8203;44784](https://github.com/BerriAI/litellm/issues/44784))
- Fixed DeepSeek V4 token counts missing Azure's billed tokens by using DeepSeek's own tokenizer ([#&#8203;47173](https://github.com/BerriAI/litellm/issues/47173), [#&#8203;47353](https://github.com/BerriAI/litellm/issues/47353))
- Fixed `count_tokens` overcounting PDFs about 12x for OpenAI and Azure models ([#&#8203;47554](https://github.com/BerriAI/litellm/issues/47554))
- Fixed token counts retrying a failed HuggingFace tokenizer download and adding about 23s per request ([#&#8203;47586](https://github.com/BerriAI/litellm/issues/47586))
- Fixed HTTP 500 when counting tokens for Anthropic search results and unsupported blocks ([#&#8203;48699](https://github.com/BerriAI/litellm/issues/48699))
- Fixed token counts for OpenAI models newer than the tiktoken table by using `o200k_base` ([#&#8203;48728](https://github.com/BerriAI/litellm/issues/48728))
- Fixed a loaded Hugging Face tokenizer being hidden when a later download fails ([#&#8203;48916](https://github.com/BerriAI/litellm/issues/48916))
- Changed Responses input token counts to match inference, fixing Claude counts with tools and `text.format` ([#&#8203;47363](https://github.com/BerriAI/litellm/issues/47363))
- Improved `token_counter` for inline `auto` images, including images under 768 pixels, with no HTTP requests ([#&#8203;48526](https://github.com/BerriAI/litellm/issues/48526))

</details>

<details><summary><b>MCP</b> (27)</summary>

- Added upstream status and response body to the log when an MCP health check fails ([#&#8203;44125](https://github.com/BerriAI/litellm/issues/44125))
- Added support for redeeming an ID-JAG as an RFC 7523 `jwt-bearer` grant on the gateway token endpoint ([#&#8203;46748](https://github.com/BerriAI/litellm/issues/46748))
- Added Authorization URL, Token URL and Scopes fields to OAuth Delegate and True Passthrough server forms ([#&#8203;46941](https://github.com/BerriAI/litellm/issues/46941))
- Added tool search and multi-select to the MCP toolset editor in the Admin UI ([#&#8203;48601](https://github.com/BerriAI/litellm/issues/48601))
- Added failure logging for MCP SDK request rejections, shown as `MCP: request_rejected` ([#&#8203;49184](https://github.com/BerriAI/litellm/issues/49184))
- Fixed `LITELLM_MCP_TOOL_LISTING_TIMEOUT` not applying to paginated `tools/list` on `/mcp` ([#&#8203;46513](https://github.com/BerriAI/litellm/issues/46513))
- Fixed `tools/list` returning an empty list when servers answer 429, now retried with an error if all fail ([#&#8203;46649](https://github.com/BerriAI/litellm/issues/46649))
- Fixed 412 on MCP calls with `id_jag_subject_source: refresh_token` after an Okta OIDC login ([#&#8203;46745](https://github.com/BerriAI/litellm/issues/46745), [#&#8203;46747](https://github.com/BerriAI/litellm/issues/46747), [#&#8203;47004](https://github.com/BerriAI/litellm/issues/47004))
- Fixed the caller's LiteLLM key being forwarded to upstream MCP servers when `Authorization` is in `extra_headers` ([#&#8203;46932](https://github.com/BerriAI/litellm/issues/46932))
- Fixed VS Code sign-in to DCR bridge MCP servers when the upstream rejects loopback redirect URIs ([#&#8203;46940](https://github.com/BerriAI/litellm/issues/46940))
- Fixed 403 when `proxy_admin_viewer` stores its own MCP credentials ([#&#8203;46994](https://github.com/BerriAI/litellm/issues/46994))
- Fixed large MCP SSE tool results failing, and invalid size limits breaking MCP discovery and tool calls ([#&#8203;47034](https://github.com/BerriAI/litellm/issues/47034))
- Fixed streamed MCP auto-execute billing only the first of its two model calls ([#&#8203;47422](https://github.com/BerriAI/litellm/issues/47422), [#&#8203;47445](https://github.com/BerriAI/litellm/issues/47445), [#&#8203;48899](https://github.com/BerriAI/litellm/issues/48899))
- Fixed an upstream MCP 429 on session handshake being reported as an internal error ([#&#8203;47569](https://github.com/BerriAI/litellm/issues/47569))
- Fixed MCP OAuth sign-in callback returning 403 behind AWS WAF by sealing the `litellm_cp_return_to` cookie ([#&#8203;47595](https://github.com/BerriAI/litellm/issues/47595))
- Fixed per-user auth MCP servers missing from `/mcp-rest/tools/list` and `/mcp` `tools/list` ([#&#8203;47677](https://github.com/BerriAI/litellm/issues/47677))
- Fixed streaming MCP follow-ups on `/v1/responses` dropping all but the latest tool round ([#&#8203;47698](https://github.com/BerriAI/litellm/issues/47698))
- Fixed slow MCP tool calls delaying response headers until the SSE ping ([#&#8203;47897](https://github.com/BerriAI/litellm/issues/47897))
- Fixed MCP management routes to follow the gateway's existing access rules ([#&#8203;48080](https://github.com/BerriAI/litellm/issues/48080))
- Fixed a readonly MCP toolset URL returning every tool instead of only the toolset's tools ([#&#8203;48095](https://github.com/BerriAI/litellm/issues/48095))
- Fixed oversized SSE tool catalogs returning a generic 500, now 502 with the size limit and pagination advice ([#&#8203;48424](https://github.com/BerriAI/litellm/issues/48424))
- Fixed MCP toolset OAuth login advertising a resource URL that clients reject ([#&#8203;48474](https://github.com/BerriAI/litellm/issues/48474))
- Fixed revoked or expired browser sessions still being accepted during gateway authorization ([#&#8203;48494](https://github.com/BerriAI/litellm/issues/48494))
- Fixed MCP OpenAPI loading to accept valid YAML specs ([#&#8203;48622](https://github.com/BerriAI/litellm/issues/48622))
- Fixed MCP tools in both `allowed_tools` and `disallowed_tools` still being callable ([#&#8203;48625](https://github.com/BerriAI/litellm/issues/48625))
- Fixed MCP tools hidden by discovery guardrails still being callable by name ([#&#8203;48669](https://github.com/BerriAI/litellm/issues/48669))
- Changed admin-owned team keys to reach only their team's MCP servers and toolsets ([#&#8203;49161](https://github.com/BerriAI/litellm/issues/49161))

</details>

<details><summary><b>Agents</b> (10)</summary>

- Added the pi harness to `litellm.agent()` and fixed harness turn `cost` ignoring prompt cache prices ([#&#8203;45467](https://github.com/BerriAI/litellm/issues/45467))
- Added request log entries for rejected A2A calls to forbidden or unknown agents ([#&#8203;49492](https://github.com/BerriAI/litellm/issues/49492))
- Fixed OpenCode via `litellm.agent()` using the script's folder instead of the sandbox, and hanging on resume ([#&#8203;47530](https://github.com/BerriAI/litellm/issues/47530))
- Fixed Gemini Managed Agents create returning 400 for `name` and interactions dropping inline `agent_config` ([#&#8203;48750](https://github.com/BerriAI/litellm/issues/48750))
- Fixed `/a2a` calls to completion-bridge agents logging $0 on send and no spend row on stream ([#&#8203;49150](https://github.com/BerriAI/litellm/issues/49150))
- Fixed 404 on `/a2a/{agent_id}/message/stream` and `/v1/a2a/{agent_id}/message/stream` ([#&#8203;49471](https://github.com/BerriAI/litellm/issues/49471))
- Fixed agent `litellm_params.api_key` not being sent as bearer auth on A2A calls ([#&#8203;49474](https://github.com/BerriAI/litellm/issues/49474))
- Fixed agent list and detail responses showing non-admins the backend URL instead of the proxy URL ([#&#8203;49483](https://github.com/BerriAI/litellm/issues/49483))
- Fixed a blank search embedding model returning 503 instead of the `*_not_configured` 400 on agent and skill search ([#&#8203;49485](https://github.com/BerriAI/litellm/issues/49485))
- Changed proxy refusals on `/a2a` POST routes to return JSON-RPC errors ([#&#8203;49476](https://github.com/BerriAI/litellm/issues/49476))

</details>

<details><summary><b>Guardrails</b> (21)</summary>

- Added opt-in `response_masked_data` on PANW Prisma AIRS `post_call` blocks ([#&#8203;46219](https://github.com/BerriAI/litellm/issues/46219))
- Added `num_retries` to `generic_guardrail_api` for checks lost after connecting ([#&#8203;46965](https://github.com/BerriAI/litellm/issues/46965))
- Added a native Reco guardrail that blocks requests on Reco errors unless `fail_on_error: false` ([#&#8203;48243](https://github.com/BerriAI/litellm/issues/48243))
- Added Ovalix guardrail scanning of files, tool calls and tool results ([#&#8203;49309](https://github.com/BerriAI/litellm/issues/49309))
- Added `litellm.guardrails.apply` SDK helper to invoke configured guardrails and get native findings ([#&#8203;49460](https://github.com/BerriAI/litellm/issues/49460), [#&#8203;49469](https://github.com/BerriAI/litellm/issues/49469), [#&#8203;49470](https://github.com/BerriAI/litellm/issues/49470))
- Fixed guardrail masks on messages and tools not reaching Bedrock Converse requests ([#&#8203;45874](https://github.com/BerriAI/litellm/issues/45874))
- Fixed `generic_guardrail_api` rejecting Gemini native tools that have no `type` key ([#&#8203;46338](https://github.com/BerriAI/litellm/issues/46338))
- Fixed corrupted numbered PII tokens in Presidio when one value matches several entities with `output_parse_pii` ([#&#8203;47024](https://github.com/BerriAI/litellm/issues/47024))
- Fixed `hide-secrets` missing secrets in tool results, tool inputs, `tool_calls` arguments, and system prompts ([#&#8203;47122](https://github.com/BerriAI/litellm/issues/47122))
- Fixed generic guardrails with `mode: pre_mcp_call` being rejected at startup so MCP calls went unchecked ([#&#8203;48060](https://github.com/BerriAI/litellm/issues/48060))
- Fixed pass-through guardrails scanning `litellm_metadata` fields added by LiteLLM, which caused false matches ([#&#8203;48276](https://github.com/BerriAI/litellm/issues/48276))
- Fixed `hide-secrets` ignoring `skip_tool_message_in_guardrail` ([#&#8203;48689](https://github.com/BerriAI/litellm/issues/48689))
- Fixed guardrails chosen in a Responses WebSocket frame not running, and a 500 with other guardrail settings ([#&#8203;48725](https://github.com/BerriAI/litellm/issues/48725))
- Fixed Responses tool results not reaching `texts` guardrails ([#&#8203;48827](https://github.com/BerriAI/litellm/issues/48827))
- Fixed `google_text_moderation` scanning embeddings input ([#&#8203;48934](https://github.com/BerriAI/litellm/issues/48934))
- Fixed guardrail blocks on streamed `/v1/messages` not returning Anthropic events ([#&#8203;49010](https://github.com/BerriAI/litellm/issues/49010))
- Fixed streamed `/v1/completions` skipping `post_call` guardrails for masking and blocking ([#&#8203;49035](https://github.com/BerriAI/litellm/issues/49035))
- Fixed mid-stream upstream errors on `/v1/messages` being turned into a guardrail 400 ([#&#8203;49088](https://github.com/BerriAI/litellm/issues/49088))
- Changed guardrail blocks mid-stream to end chat completions streams with an error event, not a cut connection ([#&#8203;46953](https://github.com/BerriAI/litellm/issues/46953))
- Changed `lakera_v2` `on_flagged: block` to reject PII-only detections and added `on_flagged: mask` ([#&#8203;48944](https://github.com/BerriAI/litellm/issues/48944))
- Improved streaming by running sampled guardrail scans in the background so chunks no longer pause ([#&#8203;48952](https://github.com/BerriAI/litellm/issues/48952))

</details>

<details><summary><b>Caching</b> (4)</summary>

- Fixed streamed cache hits dropping reasoning, citations and audio and reordering tool calls ([#&#8203;32096](https://github.com/BerriAI/litellm/issues/32096))
- Fixed `cache_control` being stripped from caller messages and tools, which broke caching on Claude fallbacks ([#&#8203;35602](https://github.com/BerriAI/litellm/issues/35602))
- Fixed the cache key's model group being read from caller metadata instead of the router's metadata ([#&#8203;48917](https://github.com/BerriAI/litellm/issues/48917))
- Removed the disk cache backend, so `cache_params.type: disk` now stops proxy startup ([#&#8203;48114](https://github.com/BerriAI/litellm/issues/48114))

</details>

<details><summary><b>Routing and fallbacks</b> (44)</summary>

- Added mid-stream fallback continuation so a streaming chat cut off mid-answer continues on the configured fallback ([#&#8203;41127](https://github.com/BerriAI/litellm/issues/41127))
- Added Kubernetes pod discovery to spread load across pods behind a headless service `api_base` ([#&#8203;44342](https://github.com/BerriAI/litellm/issues/44342), [#&#8203;44393](https://github.com/BerriAI/litellm/issues/44393), [#&#8203;44666](https://github.com/BerriAI/litellm/issues/44666))
- Added opt-in filtering that keeps chat requests off deployments flagged as non-chat ([#&#8203;46257](https://github.com/BerriAI/litellm/issues/46257))
- Added the `x-litellm-priority` header to set request priority ([#&#8203;47618](https://github.com/BerriAI/litellm/issues/47618))
- Added opt-in session repinning to the replacement deployment after a successful failover ([#&#8203;48206](https://github.com/BerriAI/litellm/issues/48206))
- Added a `clamp` mode for complexity routing that keeps the caller's smaller output token limit ([#&#8203;48632](https://github.com/BerriAI/litellm/issues/48632))
- Added deployment `rpd` and `tpd` daily limits to `enforce_model_rate_limits` ([#&#8203;48875](https://github.com/BerriAI/litellm/issues/48875), [#&#8203;48957](https://github.com/BerriAI/litellm/issues/48957))
- Added inferring custom classifier tiers from model mappings, and fixed a crash on plan-mode requests ([#&#8203;48987](https://github.com/BerriAI/litellm/issues/48987))
- Fixed weighted failover skipping healthy same-group deployments under affinity ([#&#8203;32309](https://github.com/BerriAI/litellm/issues/32309))
- Fixed `content_policy_fallbacks` not applying after `POST /fallback` or `/config/update` changes ([#&#8203;45428](https://github.com/BerriAI/litellm/issues/45428))
- Fixed an explicit `allowed_fails: 3` not counting failures and fallbacks cooling down healthy deployments ([#&#8203;46183](https://github.com/BerriAI/litellm/issues/46183))
- Fixed a `bedrock_mantle` deployment's `mode` switching sibling deployments between Chat Completions and Responses ([#&#8203;46263](https://github.com/BerriAI/litellm/issues/46263))
- Fixed prompt caching affinity ignoring tools and the `/v1/messages` system prompt when choosing a deployment ([#&#8203;46411](https://github.com/BerriAI/litellm/issues/46411))
- Fixed all-cooled router 429 rows in SpendLogs not recording which deployments were cooling ([#&#8203;47120](https://github.com/BerriAI/litellm/issues/47120))
- Fixed `stream_timeout` cutting off slow answers when Bedrock serves a `stream=True` call without streaming ([#&#8203;47162](https://github.com/BerriAI/litellm/issues/47162))
- Fixed key and team `router_settings` reaching the provider and dropping retries, fallbacks and timeout ([#&#8203;47257](https://github.com/BerriAI/litellm/issues/47257))
- Fixed 500s from `router_settings.default_priority` or an integer `priority`, and now reject a malformed `priority` ([#&#8203;47498](https://github.com/BerriAI/litellm/issues/47498))
- Fixed fallback retries logging a negative completion time and dropping latency-routed groups ([#&#8203;47541](https://github.com/BerriAI/litellm/issues/47541))
- Fixed prompt caching affinity raising on non-dict `tools` entries instead of returning the provider's 400 ([#&#8203;47565](https://github.com/BerriAI/litellm/issues/47565))
- Fixed cut Responses streams returning `server_error` instead of continuing on a fallback without prefill ([#&#8203;47672](https://github.com/BerriAI/litellm/issues/47672))
- Fixed `IndexError` and wrong deployment lookups when deployments are deleted or added concurrently ([#&#8203;47680](https://github.com/BerriAI/litellm/issues/47680))
- Fixed native Responses latency using different units than bridged responses in latency-based routing ([#&#8203;47727](https://github.com/BerriAI/litellm/issues/47727))
- Fixed the router sending image requests to `supports_vision: false` deployments in mixed model groups ([#&#8203;48149](https://github.com/BerriAI/litellm/issues/48149), [#&#8203;48152](https://github.com/BerriAI/litellm/issues/48152), [#&#8203;48241](https://github.com/BerriAI/litellm/issues/48241))
- Fixed Decisions calls routing to deployments whose provider does not support them ([#&#8203;48175](https://github.com/BerriAI/litellm/issues/48175))
- Fixed 500s on every request to a model group after one negative or NaN latency sample under latency routing ([#&#8203;48216](https://github.com/BerriAI/litellm/issues/48216))
- Fixed tag fail-open groups rejecting unmatched tags after affinity or cooldown filtering ([#&#8203;48470](https://github.com/BerriAI/litellm/issues/48470))
- Fixed one caller's exhausted forwarded Claude subscription putting the shared model into cooldown for others ([#&#8203;48485](https://github.com/BerriAI/litellm/issues/48485))
- Fixed proxy-wide wildcard deployments shadowing a team's own wildcard deployment for that team's keys ([#&#8203;48490](https://github.com/BerriAI/litellm/issues/48490))
- Fixed complexity router replacing the held `user_turn` route on Codex compaction requests ([#&#8203;48627](https://github.com/BerriAI/litellm/issues/48627))
- Fixed session tier pins diverging between proxy workers when using Redis ([#&#8203;48645](https://github.com/BerriAI/litellm/issues/48645))
- Fixed nested environment references in router classifier connections being sent literally ([#&#8203;48717](https://github.com/BerriAI/litellm/issues/48717))
- Fixed lifecycle events not passing through on background OpenAI Responses streams that cannot fall back ([#&#8203;48817](https://github.com/BerriAI/litellm/issues/48817))
- Fixed new fallback rules erasing older ones when Redis refuses `DEL` ([#&#8203;48999](https://github.com/BerriAI/litellm/issues/48999))
- Fixed a deployment's own `model_id` being overridden by the request body's ([#&#8203;49045](https://github.com/BerriAI/litellm/issues/49045))
- Fixed 429s on requests without `max_tokens` and token counters not dropping to real usage after calls ([#&#8203;49054](https://github.com/BerriAI/litellm/issues/49054))
- Fixed streamed context window errors skipping fallbacks when they occur before any output ([#&#8203;49293](https://github.com/BerriAI/litellm/issues/49293))
- Fixed large requests silently falling back to heuristic routing when they exceed the classifier's input limit ([#&#8203;49306](https://github.com/BerriAI/litellm/issues/49306))
- Fixed queued requests waiting until a 408 when a dead replica left expired scheduler queue entries ([#&#8203;49387](https://github.com/BerriAI/litellm/issues/49387))
- Changed per-deployment `reasoning_effort_levels` to apply on every provider and route, including `azure_ai` ([#&#8203;46601](https://github.com/BerriAI/litellm/issues/46601))
- Changed tag routing to use only prefixed caller tags once `tag_routing_prefix` is set ([#&#8203;47428](https://github.com/BerriAI/litellm/issues/47428))
- Changed router `allowed_fails` to keep a lone deployment with no fallback in rotation instead of returning 429 ([#&#8203;48644](https://github.com/BerriAI/litellm/issues/48644))
- Changed `user_turn` routing so child agent requests keep their own tier pin ([#&#8203;48701](https://github.com/BerriAI/litellm/issues/48701))
- Changed Router init to reject string fallback targets that never routed ([#&#8203;48943](https://github.com/BerriAI/litellm/issues/48943))
- Removed the deployment `rpm` filter from `enable_pre_call_checks` ([#&#8203;48873](https://github.com/BerriAI/litellm/issues/48873))

</details>

<details><summary><b>Cost tracking and pricing</b> (36)</summary>

- Added `s3://` URI support for `LITELLM_MODEL_COST_MAP_URL` ([#&#8203;46972](https://github.com/BerriAI/litellm/issues/46972))
- Added `model_info.pricing_provider` to price a deployment from another provider's catalog rates instead of $0 ([#&#8203;47620](https://github.com/BerriAI/litellm/issues/47620))
- Added `x-litellm-upstream-model` header so pass-through upstreams can report the model name for spend ([#&#8203;48275](https://github.com/BerriAI/litellm/issues/48275))
- Added a per-guardrail spend breakdown to user, team and organization daily activity ([#&#8203;48702](https://github.com/BerriAI/litellm/issues/48702))
- F…

This branch was successfully deployed

No deployments
e2e-changed — 1dda7a9f Deployed Oct 16, 2026 by mateo-berri via oauth #5635
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants