Skip to content

fix(vertex_ai): price streamed pass-through calls with the regional uplift - #44795

Merged
mateo-berri merged 21 commits into
BerriAI:mainfrom
pcbeingused333:fix-vertex-passthrough-stream-regional-cost
Oct 19, 2026
Merged

mateo-berri merged 21 commits into
BerriAI:mainfrom
pcbeingused333:fix-vertex-passthrough-stream-regional-cost

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Streamed Vertex pass-through calls are billed differently from non-streamed ones
  • Regional endpoints miss the 10% uplift, custom-priced deployments get list price
  • /v1beta calls to a Vertex deployment ignore the deployment's location

How it solves it:

  • The handler drops the stream builder's location-blind cost, so the logger prices both modes, cut-off streams too
  • The /v1beta route hands the deployment's vertex_location to the logger
  • Non-streamed /gemini calls are priced by the logger too, so both modes match
  • A body base_model sets the price only for keys allowed client pricing, and a non-string one is ignored
  • /gemini calls price as Gemini whatever host serves them
Scope, and why this approach

This covers Gemini streamGenerateContent and Claude on Vertex streamRawPredict through /vertex_ai, since both go through the same builder, and generateContent / streamGenerateContent through /v1beta/models/<deployment>. Non-streamed /vertex_ai calls keep their price unless the body sets base_model (below). Non-streamed /v1beta calls to a global deployment stop paying the uplift they were wrongly charged before

Two other ways were tried. This PR's first version stamped the location-aware cost on the response, but a stamped cost wins over the deployment's custom price, so non-streamed custom-priced calls dropped to the list price too. Passing the logger into stream_chunk_builder, the issue's first suggestion, makes the builder price the response before the handler has set the model and provider, and it saves that cost, so all four streamed unit cases still fail with it. Dropping the stale cost leaves the logger as the one place that prices both modes

The /v1beta route never told the logger where the deployment runs, so the logger fell back to its default region, us-central1, and charged the uplift to every deployment. The route now passes the deployment's vertex_location (or vertex_ai_location) along, and leaves it unset when the deployment has none, which keeps the old fallback for those

When the upstream fails mid-stream, the partial usage used to be priced with the handler's cost, which knows the location but not the deployment's custom price. It now goes through the logger's cost calculator, the same one a finished stream uses, and keeps the handler's cost only when the logger cannot price the response

SDK calls to agenerate_content_stream on vertex_ai use the same stream iterator, so a streamed us call now logs the uplift like the non-streamed one. SDK calls on global log the same price as before, in both modes (live run below)

The issue also mentions the Gemini and Cohere pass-through handlers calling stream_chunk_builder the same way. /gemini streams run through the changed Vertex handler, so the logger now prices them. Main billed /gemini at list price in both modes, even for a key or team with allow_client_pricing_override whose request names a custom-priced deployment in metadata.model_info. Once the logger prices streams, the non-streamed Gemini handler's own list price would have split the two modes for such a key, so that handler now leaves the price to the logger too. Both modes bill the list price normally, and the named deployment's price only when the key allows it. Pinning streams back to the list price would have brought back the stamp that broke deployment custom prices. Cohere has no regional pricing, so its handler is left alone

Once the logger prices these calls, a top-level base_model in the request body reaches it, since the pass-through route moves litellm params from the body into the logging params. A plain key could then pick a cheaper model's price for /gemini and streamed /vertex_ai calls. The route now keeps a body base_model out of the logging params unless the key or team sets allow_client_pricing_override, the flag that already gates the other client pricing fields, and it still never reaches the upstream. Adding base_model to the shared list of client pricing fields was the other option, but that list is also applied on chat and /v1beta, where base_model also picks the Vertex tuned endpoint, so it could turn working calls into errors. That wider change is left for a separate fix

This also drops a body base_model sent with the master key or through an auth: false route, which priced with it before. The pass-through route already strips the other client pricing fields for those callers the same way, so one rule now covers all of them

A base_model that is not a string, such as 123, a list, or an object, is now ignored for pricing, so the call bills as if it were not set. Before, the stamped costs hid that such a value made the logger's cost lookup fail and bill $0. Rejecting it with a 400 was the other option, but the logger runs after the upstream has answered, and chat completions already reject it before the call

A client metadata.model_info that is not an object, such as "x" or a list, made the logger fail on pass-through routes and write no spend row once the stamped costs were gone. The pass-through route now leaves it out of the logging metadata, so the call bills the list price. Every other route and the SDK still reject it before calling the provider, as on main. Rejecting it on pass-through too was the other option, but those calls answer 200 on main

/gemini streams use the Vertex handler, which picked the provider from the upstream host and treated every host other than generativelanguage.googleapis.com as Vertex. With the stamped cost gone, a /gemini stream through a gateway set in GEMINI_API_BASE was charged the Vertex regional uplift. The handler now takes the provider from the route. A call through /gemini, or to generativelanguage.googleapis.com or a subdomain of it, prices as Gemini, and every other call prices as Vertex. That matches main except for an upstream host that only ends with that name, such as xgenerativelanguage.googleapis.com, which main priced as Gemini and f4deed6 prices as Vertex to close a CodeQL incomplete URL check alert. That change ships on purpose, since only Google serves hosts under googleapis.com and none has that shape. Matching the configured GEMINI_API_BASE host was one option, but it misreads Vertex calls when one gateway serves both. Reading the Vertex resource path segments was another, but it billed configured Vertex gateways with short paths as Gemini and their Claude streams at $0

User Flow

Before: a developer streaming Gemini through the Vertex pass-through on a regional endpoint is billed at the global price

  1. They send POST https://litellm-domain/vertex_ai/v1/projects//locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent, and GET https://litellm-domain/spend/logs?request_id= shows the regional price, 1.1x the global one
  2. They send the same body to ...:streamGenerateContent?alt=sse on locations/us and read the stream to the end
  3. GET https://litellm-domain/spend/logs?request_id= shows the global price, 10% under the non-streamed row, and Claude :streamRawPredict on locations/us-east5 or a custom-priced deployment is off the same way
  4. They send the same body to POST https://litellm-domain/v1beta/models/:generateContent for a deployment set to vertex_location: global, and its row in GET https://litellm-domain/spend/logs is 10% over the global price

After: the streamed call is billed the same as the non-streamed one

  1. They send POST https://litellm-domain/vertex_ai/v1/projects//locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent, and GET https://litellm-domain/spend/logs?request_id= shows the regional price, 1.1x the global one
  2. They send the same body to ...:streamGenerateContent?alt=sse on locations/us and read the stream to the end
  3. GET https://litellm-domain/spend/logs?request_id= shows the same regional price as the non-streamed row, and Claude :streamRawPredict and custom-priced deployments match their non-streamed rows too
  4. They send the same body to POST https://litellm-domain/v1beta/models/:generateContent for a deployment set to vertex_location: global, and its row in GET https://litellm-domain/spend/logs shows the global price, in both modes

Relevant issues

Fixes #44755

@aakashthapa0 also offered to take this in the issue. I already had the fix and tests ready, so I'm opening it, and I'm happy to fold in anything you had planned

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
What the tests cover

The unit tests read the cost the logger records, for streamed and non-streamed calls, through the code each route runs: the pass-through stream handler for /vertex_ai streams and the /v1beta stream iterator for /v1beta streams. They cover Gemini on global and us, Claude on Vertex on global and us-east5, a Gemini and a Claude deployment with their own prices, /v1beta on global and us, and a custom-priced stream that the upstream cuts off mid-way. On main every streamed regional or custom-priced case fails, along with the cut-off stream and the /v1beta cases for global non-streamed and us streamed. On this PR's first version every custom-price case fails, and on its second version the cut-off stream and /v1beta on global still fail

The rate cards need a bare-name entry plus the model in vertex_language_models or anthropic_models, mirroring how the real map stores these models. Without them stream_chunk_builder cannot price the response, stores no cost, and the bug does not reproduce

tests/integration/spend/test_vertex_passthrough_regional_uplift_spend.py drives the four Gemini calls through a real proxy against a scripted Vertex upstream reached over a CONNECT tunnel, and checks the four spend rows by call id. The us rows must be the cost map's multiplier times the global ones in both modes. It fails on main only for the streamed us row (0.00111 where 0.001221 is expected) and passes on this branch. A second test sends a finished call in both modes and a stream the upstream cuts off mid-way through a custom-priced deployment, and expects the deployment's price, 0.0018, on all three rows. On main the finished stream bills 0.00111 and the cut-off one 0.001221

A Gemini handler test sends the same /gemini reply streamed and non-streamed, at list price and with a custom-priced deployment the key is allowed to name, and expects the same cost both ways. On 429e29e the non-streamed custom-price case fails

Two more unit tests cover the base_model and gateway fixes. One sends a body base_model through the pass-through route with a plain key and with a key that allows client pricing, and only the second prices with it. The other prices the same Gemini reply through generativelanguage.googleapis.com and through a gateway host, streamed and non-streamed, and expects the Gemini list price every time. On 833df09 the plain-key case and both gateway cases fail. Two more price a non-string base_model in both modes and expect the list price, and stream Claude through a configured Vertex gateway with a short path and expect the Vertex price. On 9518571 all seven of those cases fail. Two more expect the Vertex regional price on vertex-generativelanguage.googleapis.com and the Gemini price on eu.generativelanguage.googleapis.com, and the first fails on d2e1ae4

tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py drives Claude on Vertex in both modes, /v1beta on a Vertex deployment in both modes, /gemini with a named custom-priced deployment for an allowed key and a plain key, and an OpenAI stream cut off after its usage chunk, through a real proxy against scripted upstreams. It also checks that a body base_model reprices spend only for keys allowed client pricing and never reaches the upstream, that a GEMINI_API_BASE gateway logs and bills as Gemini in both modes, and that a configured pass-through to a non-Google gateway bills as Vertex whatever the path

The cost harness sends /gemini through GEMINI_API_BASE, so its streamed case moved from the Vertex cases to the Gemini cases under the Gemini price

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 at 775a523. QA and /live-pr-risk ran on f4deed6, the last commit with a product diff

Live run against real Vertex AI on a local proxy with curl. Spend per call, from each leg's spend rows

Call Non-streamed before Non-streamed after Streamed before Streamed after
/vertex_ai Gemini global 0.0000046 0.0000046 0.0000046 0.0000046
/vertex_ai Gemini us 0.00000506 0.00000506 0.0000046 0.00000506
/vertex_ai Claude global 0.00004 0.00004 0.00004 0.00004
/vertex_ai Claude us-east5 0.000044 0.000044 0.00004 0.000044
/vertex_ai gemini-custom-priced 0.00009 0.00009 0.0000046 0.00009
/vertex_ai claude-custom-priced 0.00025 0.00025 0.00004 0.00025
/v1beta gemini-global 0.00000506 0.0000046 0.0000046 0.0000046
/v1beta gemini-us 0.00000506 0.00000506 0.0000046 0.00000506
/v1beta gemini-custom-priced 0.00009 0.00009 0.0000046 0.00009
Setup and expected prices

gemini-3.5-flash-lite and claude-haiku-4-5 both carry regional_endpoint_uplift_multiplier: 1.1 in the cost map. The /vertex_ai Gemini and Claude calls send the caller's own Google access token, as in the issue. The custom-priced /vertex_ai calls and every /v1beta call go through a deployment and use the proxy's credentials. Claude Haiku 4.5 is used because Claude Haiku 5.5 returned a quota 429 on us-east5. The proxy runs with LITELLM_LOCAL_MODEL_COST_MAP=True

Every row has 7 prompt and 1 completion token for Gemini, 15 and 5 for Claude

The expected prices are 7 * 3e-07 + 1 * 2.5e-06 = 0.0000046 for Gemini on global, 15 * 1e-06 + 5 * 5e-06 = 0.00004 for Claude on global, 1.1x those on a regional endpoint, and the deployment's own price for the custom-priced ones, 7 * 1e-05 + 1 * 2e-05 = 0.00009 for Gemini and 15 * 1e-05 + 5 * 2e-05 = 0.00025 for Claude

Proxy config and how to read the logs
model_list:
  - model_name: gemini-custom-priced
    litellm_params:
      model: vertex_ai/gemini-3.5-flash-lite
      vertex_project: os.environ/VERTEXAI_PROJECT
      vertex_location: us
      vertex_credentials: os.environ/GOOGLE_APPLICATION_CREDENTIALS
      use_in_pass_through: true
      input_cost_per_token: 0.00001
      output_cost_per_token: 0.00002
  - model_name: claude-custom-priced
    litellm_params:
      model: vertex_ai/claude-haiku-4-5
      vertex_project: os.environ/VERTEXAI_PROJECT
      vertex_location: us-east5
      vertex_credentials: os.environ/GOOGLE_APPLICATION_CREDENTIALS
      use_in_pass_through: true
      input_cost_per_token: 0.00001
      output_cost_per_token: 0.00002
  - model_name: gemini-global
    litellm_params:
      model: vertex_ai/gemini-3.5-flash-lite
      vertex_project: os.environ/VERTEXAI_PROJECT
      vertex_location: global
      vertex_credentials: os.environ/GOOGLE_APPLICATION_CREDENTIALS
  - model_name: gemini-us
    litellm_params:
      model: vertex_ai/gemini-3.5-flash-lite
      vertex_project: os.environ/VERTEXAI_PROJECT
      vertex_location: us
      vertex_credentials: os.environ/GOOGLE_APPLICATION_CREDENTIALS

general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  database_url: os.environ/DATABASE_URL

$PORT is the proxy's port, $PROJECT the Vertex project (shown as <project>), and $GTOKEN a Google access token minted from a service account, standing in for the caller's own token. Both legs run the same commands, and the After leg's full output is in the gist linked under it. JSON response bodies are compacted to one line to fit GitHub's size limit for a PR body, and nothing else is cut. A failure in the middle of a stream cannot be forced on real Vertex, so the cut-off custom-priced stream is covered by test_interrupted_vertex_stream_bills_the_deployment_custom_price and the integration test named in the test notes instead

Before (8b442f0, this branch's base on main)

Commands and raw output
$ GEMINI='{"contents": [{"role": "user", "parts": [{"text": "Reply with the single word: pong"}]}], "generationConfig": {"maxOutputTokens": 16}}'
$ CLAUDE='{"anthropic_version": "vertex-2023-10-16", "max_tokens": 8, "messages": [{"role": "user", "content": "Reply with the single word: pong"}]}'
$ CLAUDE_STREAM='{"anthropic_version": "vertex-2023-10-16", "max_tokens": 8, "stream": true, "messages": [{"role": "user", "content": "Reply with the single word: pong"}]}'

# vertex_ai gemini global generateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/global/publishers/google/models/gemini-3.5-flash-lite:generateContent" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a18dSYbRMaiQlzeRsmdmnq2PFoO8wjRNr8tUXMrszGjMHP8MHMlwj+PIUkqi5M1bmXakEnqfNJj1OYjMAckCrDTpdP4Ym8F4H4Dds7OHloShwmWGM6uAtyM="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:17:59.604974Z","responseId":"p3LUaq72JJ7Tl7oP-9vpAQ"}

HTTP 200 call id 6c2895c5-a0fe-45a4-a4e4-dd56f549b35f

# vertex_ai gemini global streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/global/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:00.401330Z","responseId": "qHLUarK_GM6YotQPkv6J6A0"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a18XIMGw+XNHhseUinPBprqSMDe4zVnF+cQ7OWYkb6gvOZzJNhmrhZjkqBT59/DVs3bZzd3DUj1NmJqiDXiaNUHckdz8lQq+9cx/75D8i1ohiQpPcziqKd0="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:00.401330Z","responseId": "qHLUarK_GM6YotQPkv6J6A0"}


HTTP 200 call id 5c0cd496-e28b-4f8d-947f-2a936aa03482

# vertex_ai gemini us generateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a1/XXIm7WRAswoWg4wDorze4ZA2+OJNrzpTGlCvtPkd9/dp0EumbxxNFXzhs5lNyZzwE9nDcSRAMNNI3U/59bdZKCwAkjkOjVEBuQCd+IX03ZC5Hb3hQ4uQ="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:18:01.066358Z","responseId":"qXLUaraGBNP2xrAP0_qV0Qs"}

HTTP 200 call id 98010cd6-7156-4e01-bd48-435281e5dbcf

# vertex_ai gemini us streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:01.677323Z","responseId": "qXLUasurKaTkotkP6NqomQo"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a19onUfcN8J0ghSycRzauOntqI1FA5HstOabzYOJzxQT/VuKeCxppk3F0lsISzQv16ODKWii7MGh12q/UCJPMoBDOLLvzTf/VHkv8EhXpr/zLbUVeHV85Hc="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:01.677323Z","responseId": "qXLUasurKaTkotkP6NqomQo"}


HTTP 200 call id a66e4e20-2d1b-4157-9a95-206fb2de3529

# vertex_ai claude global rawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/global/publishers/anthropic/models/claude-haiku-4-5:rawPredict" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J36W42xTzFoXPYybek","type":"message","role":"assistant","content":[{"type":"text","text":"pong"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5}}
HTTP 200 call id dc987f65-0f6c-42fb-bbd5-6fe4c4e154b7

# vertex_ai claude global streamRawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/global/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE_STREAM" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
event: message_start
data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J3BGo7WdZRzhacQn79","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1}} }

event: ping
data: {"type": "ping"}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"p"}            }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ong"}         }

event: content_block_stop
data: {"type":"content_block_stop","index":0         }

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5}}

event: message_stop
data: {"type":"message_stop" }


HTTP 200 call id 4067ddb1-18e6-4fe4-9d5f-91634d7e4ff2

# vertex_ai claude us-east5 rawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:rawPredict" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J3EAS4hKABN2FzqqWa","type":"message","role":"assistant","content":[{"type":"text","text":"pong"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5}}
HTTP 200 call id 033d654e-3ddf-467f-8bc4-9fa05ec5a09e

# vertex_ai claude us-east5 streamRawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict" -H "Authorization: Bearer $GTOKEN" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE_STREAM" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
event: message_start
data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J3HGxFLNh5HsLQ74Eh","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1}}      }

event: ping
data: {"type": "ping"}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"p"}         }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ong"}           }

event: content_block_stop
data: {"type":"content_block_stop","index":0          }

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5}  }

event: message_stop
data: {"type":"message_stop"    }


HTTP 200 call id 22635d10-3512-4527-a360-518b33715cd6

# vertex_ai custom-priced us generateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us/publishers/google/models/gemini-custom-priced:generateContent" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a18kM7QlkcVACMicuavQfCtvY6dIAFWYO8n4rvFN7+iJuETCJUuVlCfnSAjNeuIR2K0rs0wZUKuGJs5Qc1RKAif/Ov7AXsIG+WK7c6Cw+B1m01e8PQnDIZ8="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:18:05.577192Z","responseId":"rXLUaqidI4zP_dQP-7T68Ao"}

HTTP 200 call id 80e4b4e4-8a7d-4e30-884d-057b2d2380a1

# vertex_ai custom-priced us streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us/publishers/google/models/gemini-custom-priced:streamGenerateContent?alt=sse" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:06.350867Z","responseId": "rnLUapO1FdP2xrAPltffqQM"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a1/OfRe6Av/wPlzDTwRkobd1v48B54wVVp9vgQjsZaq4jNa58dVOyHbpv3VZZB61UL0TBfJsa9Kum/uiD6mqr9nK1opC0Jij/eBZPL2uUKylbCLbQ2EZ+Us="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:06.350867Z","responseId": "rnLUapO1FdP2xrAPltffqQM"}


HTTP 200 call id f0a5966e-67c4-4bf4-8964-7263b98e737b

# vertex_ai claude-custom-priced us-east5 rawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us-east5/publishers/anthropic/models/claude-custom-priced:rawPredict" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J3RCwswidQzmnbpn3S","type":"message","role":"assistant","content":[{"type":"text","text":"pong"}],"container":null,"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":5}}
HTTP 200 call id 9fdd0809-446b-4949-9732-fb5784a420a3

# vertex_ai claude-custom-priced us-east5 streamRawPredict
$ curl -sN "http://127.0.0.1:$PORT/vertex_ai/v1/projects/$PROJECT/locations/us-east5/publishers/anthropic/models/claude-custom-priced:streamRawPredict" -H "x-litellm-api-key: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$CLAUDE_STREAM" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
event: message_start
data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_vrtx_011Cg9J3ThkkjispQ6dVhtEd","type":"message","role":"assistant","content":[],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1}}    }

event: ping
data: {"type": "ping"}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}            }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"p"}     }

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ong"}              }

event: content_block_stop
data: {"type":"content_block_stop","index":0       }

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"container":null},"usage":{"input_tokens":15,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5} }

event: message_stop
data: {"type":"message_stop"          }


HTTP 200 call id 0db8914f-8775-4448-bfd9-44e98a9bc9b4

# v1beta gemini-global generateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-global:generateContent" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a1+hDAAHjTAnEM6XrqPz1ZSsOk1t17pTCCw5L9G6VFyzWqq9Jiy5x6VbCOJJiR3sP1yATymHwES6Ap4hJN7KyjSn8kYW60Ai2Y5SH0eQmi6lRpWwUApxO7A="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:18:08.193539Z","responseId":"sHLUaoPoC57Tl7oP-9vpAQ"}
HTTP 200 call id 282b1a80-4b54-43c0-87ab-974a5e48fd30

# v1beta gemini-global streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-global:streamGenerateContent?alt=sse" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:08.758287Z","responseId": "sHLUao-kLvPdsbwPuMLgcA"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a19dvyOb5+a9/GXe5xVl3LNOucTXUTpZXtVRo+CZBITpFSYDtSt56EU/j7AQ9QGNEoSWJzUwceauIaIi763CwVejgtSJgRV6xXzGhflnsEKGDVdxfR/gl8g="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:08.758287Z","responseId": "sHLUao-kLvPdsbwPuMLgcA"}


HTTP 200 call id b425b63d-d539-466c-a261-8bd524abeef4

# v1beta gemini-us generateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-us:generateContent" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a19wucrGVSzx7l1YHF+Wm48PmIsO3vUqtfHxGfk7o4bit1ZYfuzJn01RSlHjNSTi0lIrhwyOBanA6vVH337FsNy+VXLIFa2Sa1fn5SN6SxkFXFC3yMhQ2qY="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:18:09.816240Z","responseId":"sXLUavDoMb2Fw-UPnM6lsAM"}
HTTP 200 call id 6e90f658-817f-40f6-946f-dc49f059c1c8

# v1beta gemini-us streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-us:streamGenerateContent?alt=sse" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:10.522882Z","responseId": "snLUaoL1H9P2xrAP0_qV0Qs"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a19PFXvFxHw1OWByNHDzGWyDgTAIurjlTHX04xeksv6XsUXLXLBARmU9FRgQO51IqF9HdnPCYedJz9NWgI/v22H/svVeFJm3p57uOC+wo4GkuNkAdhJfcFU="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:10.522882Z","responseId": "snLUaoL1H9P2xrAP0_qV0Qs"}


HTTP 200 call id 3a3542f1-4d68-4b5a-ba99-62d8b10b8567

# v1beta gemini-custom-priced generateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-custom-priced:generateContent" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
{"candidates":[{"content":{"role":"model","parts":[{"text":"pong","thoughtSignature":"AY89a1+pNn0h0cpc2AsKMC4/57vW4up9kIRTS42jFjONgrWFosxaNQvnXXGHclIdva95m5c5AMMSRZWsXPCtO8GbAbuwWGe7cchZhQLzlfq3pz19/F8s3Pm6m1w="}]},"finishReason":"STOP"}],"usageMetadata":{"promptTokenCount":7,"candidatesTokenCount":1,"totalTokenCount":8,"trafficType":"ON_DEMAND","promptTokensDetails":[{"modality":"TEXT","tokenCount":7}],"candidatesTokensDetails":[{"modality":"TEXT","tokenCount":1}]},"modelVersion":"gemini-3.5-flash-lite","createTime":"2026-10-18T07:18:11.113474Z","responseId":"s3LUasL2BrOEw-UPwqO-8Aw"}
HTTP 200 call id 37e348f3-f608-4720-b4d6-76814b078259

# v1beta gemini-custom-priced streamGenerateContent
$ curl -sN "http://127.0.0.1:$PORT/v1beta/models/gemini-custom-priced:streamGenerateContent?alt=sse" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json" -d "$GEMINI" -w '\nHTTP %{http_code} call id %header{x-litellm-call-id}\n'
data: {"candidates": [{"content": {"role": "model","parts": [{"text": "pong"}]}}],"usageMetadata": {"trafficType": "ON_DEMAND"},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:11.705395Z","responseId": "s3LUavOGK7OEw-UPwqO-8Aw"}

data: {"candidates": [{"content": {"role": "model","parts": [{"text": "","thoughtSignature": "AY89a1+ieA91kK2mCBr5BMnP3/uJnHBkS/6uagE0+tcXp1rQWpayz09qdhQYqF0N4WqHQexIkn5ieEDKwP5AZXSUIfpx7tKHd8UUuCMncu27sq9KxLF/w2/R8Fs="}]},"finishReason": "STOP"}],"usageMetadata": {"promptTokenCount": 7,"candidatesTokenCount": 1,"totalTokenCount": 8,"trafficType": "ON_DEMAND","promptTokensDetails": [{"modality": "TEXT","tokenCount": 7}],"candidatesTokensDetails": [{"modality": "TEXT","tokenCount": 1}]},"modelVersion": "gemini-3.5-flash-lite","createTime": "2026-10-18T07:18:11.705395Z","responseId": "s3LUavOGK7OEw-UPwqO-8Aw"}


HTTP 200 call id 54c6c992-b607-4cc0-a93a-8f2fa8fbdfbb

# spend rows
$ for id in 6c2895c5-a0fe-45a4-a4e4-dd56f549b35f 5c0cd496-e28b-4f8d-947f-2a936aa03482 98010cd6-7156-4e01-bd48-435281e5dbcf a66e4e20-2d1b-4157-9a95-206fb2de3529 dc987f65-0f6c-42fb-bbd5-6fe4c4e154b7 4067ddb1-18e6-4fe4-9d5f-91634d7e4ff2 033d654e-3ddf-467f-8bc4-9fa05ec5a09e 22635d10-3512-4527-a360-518b33715cd6 80e4b4e4-8a7d-4e30-884d-057b2d2380a1 f0a5966e-67c4-4bf4-8964-7263b98e737b 9fdd0809-446b-4949-9732-fb5784a420a3 0db8914f-8775-4448-bfd9-44e98a9bc9b4 282b1a80-4b54-43c0-87ab-974a5e48fd30 b425b63d-d539-466c-a261-8bd524abeef4 6e90f658-817f-40f6-946f-dc49f059c1c8 3a3542f1-4d68-4b5a-ba99-62d8b10b8567 37e348f3-f608-4720-b4d6-76814b078259 54c6c992-b607-4cc0-a93a-8f2fa8fbdfbb; do curl -s "http://127.0.0.1:$PORT/spend/logs?request_id=$id" -H "Authorization: Bearer $LITELLM_MASTER_KEY" | jq -c '.[0] | {request_id, model, spend, prompt_tokens, completion_tokens, api_base}'; done
{"request_id":"6c2895c5-a0fe-45a4-a4e4-dd56f549b35f","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"5c0cd496-e28b-4f8d-947f-2a936aa03482","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"98010cd6-7156-4e01-bd48-435281e5dbcf","model":"gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"a66e4e20-2d1b-4157-9a95-206fb2de3529","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"dc987f65-0f6c-42fb-bbd5-6fe4c4e154b7","model":"claude-haiku-4-5","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"4067ddb1-18e6-4fe4-9d5f-91634d7e4ff2","model":"claude-haiku-4-5-20251001","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"033d654e-3ddf-467f-8bc4-9fa05ec5a09e","model":"claude-haiku-4-5","spend":0.00004400000000000001,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"22635d10-3512-4527-a360-518b33715cd6","model":"claude-haiku-4-5-20251001","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"80e4b4e4-8a7d-4e30-884d-057b2d2380a1","model":"gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"f0a5966e-67c4-4bf4-8964-7263b98e737b","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"9fdd0809-446b-4949-9732-fb5784a420a3","model":"claude-haiku-4-5","spend":0.00025,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"0db8914f-8775-4448-bfd9-44e98a9bc9b4","model":"claude-haiku-4-5-20251001","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"sHLUaoPoC57Tl7oP-9vpAQ","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1beta1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"b425b63d-d539-466c-a261-8bd524abeef4","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1beta1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}
{"request_id":"sXLUavDoMb2Fw-UPnM6lsAM","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"3a3542f1-4d68-4b5a-ba99-62d8b10b8567","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}
{"request_id":"s3LUasL2BrOEw-UPwqO-8Aw","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"54c6c992-b607-4cc0-a93a-8f2fa8fbdfbb","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}

After (c33bc62)

Spend rows

Full output is in this gist file, and the rerun at 955bc8077b billed the same

# spend rows
$ for id in f210746b-ba41-45ea-89e2-7237bf8a6ecf 444b66dc-20f1-43d1-b9d5-eec908f3c4ac 6b06f67d-2cc3-4b95-9e5c-77d6197485d0 dd60bb23-bd83-423c-bb96-e14058b44827 25eec56e-204f-41e6-9de7-deaa051f9abe 8b59859a-b241-4e84-8a01-f7c8586ab0d2 98443c7d-8491-45c7-a3a1-a71243478e94 00f2270f-d432-4396-bd25-ca6e9d93f757 cb7a9ba4-1de4-4850-a71a-5c66831d53fd 0cf4c11f-b405-4b2b-b2df-2635b9e807db 4a3ade5a-786c-41d0-9b6f-724e6d0262c6 5fb3af3e-4061-4425-b120-d6d4ab0c1bc0 bdcb1feb-a981-4cb5-88e2-51798d04baa6 e4a27313-3c59-497c-bb7d-92f4b31adfe7 9bb54a2f-808c-4529-ac65-471c57248e1f 0b40164b-2f61-4e1d-8a68-674f161e515f 719d7c82-117e-449b-abcb-3529c161e74d 8a7c5fdd-d461-4550-8501-ec047ec92d45; do curl -s "http://127.0.0.1:$PORT/spend/logs?request_id=$id" -H "Authorization: Bearer $LITELLM_MASTER_KEY" | jq -c '.[0] | {request_id, model, spend, prompt_tokens, completion_tokens, api_base}'; done
{"request_id":"f210746b-ba41-45ea-89e2-7237bf8a6ecf","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"444b66dc-20f1-43d1-b9d5-eec908f3c4ac","model":"gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"6b06f67d-2cc3-4b95-9e5c-77d6197485d0","model":"gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"dd60bb23-bd83-423c-bb96-e14058b44827","model":"gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"25eec56e-204f-41e6-9de7-deaa051f9abe","model":"claude-haiku-4-5","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"8b59859a-b241-4e84-8a01-f7c8586ab0d2","model":"claude-haiku-4-5-20251001","spend":0.00004,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://aiplatform.googleapis.com/v1/projects/<project>/locations/global/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"98443c7d-8491-45c7-a3a1-a71243478e94","model":"claude-haiku-4-5","spend":0.00004400000000000001,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"00f2270f-d432-4396-bd25-ca6e9d93f757","model":"claude-haiku-4-5-20251001","spend":0.00004400000000000001,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"cb7a9ba4-1de4-4850-a71a-5c66831d53fd","model":"gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"0cf4c11f-b405-4b2b-b2df-2635b9e807db","model":"gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse&alt=sse"}
{"request_id":"4a3ade5a-786c-41d0-9b6f-724e6d0262c6","model":"claude-haiku-4-5","spend":0.00025,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:rawPredict"}
{"request_id":"5fb3af3e-4061-4425-b120-d6d4ab0c1bc0","model":"claude-haiku-4-5-20251001","spend":0.00025,"prompt_tokens":15,"completion_tokens":5,"api_base":"https://us-east5-aiplatform.googleapis.com/v1/projects/<project>/locations/us-east5/publishers/anthropic/models/claude-haiku-4-5:streamRawPredict?alt=sse"}
{"request_id":"n7bUasf0LoqaotQPoOyM8QY","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1beta1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"e4a27313-3c59-497c-bb7d-92f4b31adfe7","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.0000046,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.googleapis.com/v1beta1/projects/<project>/locations/global/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}
{"request_id":"obbUavGBGMbO_dQPz_TR0AE","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"0b40164b-2f61-4e1d-8a68-674f161e515f","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.000005060000000000001,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}
{"request_id":"orbUarjzLbPIw-UPluLTuAc","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:generateContent"}
{"request_id":"8a7c5fdd-d461-4550-8501-ec047ec92d45","model":"vertex_ai/gemini-3.5-flash-lite","spend":0.00009,"prompt_tokens":7,"completion_tokens":1,"api_base":"https://aiplatform.us.rep.googleapis.com/v1beta1/projects/<project>/locations/us/publishers/google/models/gemini-3.5-flash-lite:streamGenerateContent?alt=sse"}

/gemini and SDK calls

An override key's /gemini call bills the custom price in both modes, and SDK us streams carry the uplift

Spend table and how these ran
Call Non-streamed before Non-streamed after Streamed before Streamed after
/gemini override key 0.0000049 0.0001 0.0000049 0.0001
/gemini plain key 0.0000049 0.0000049 0.0000049 0.0000049
SDK global 0.0000046 0.0000046 0.0000046 0.0000046
SDK us 0.00000506 0.00000506 0.0000046 0.00000506

Same proxy plus a model_info id on gemini-custom-priced. Each /gemini call sends the body's metadata.model_info with that id and price, once with a key whose metadata sets allow_client_pricing_override and once with a plain key. The SDK calls run litellm.agenerate_content and agenerate_content_stream on vertex_ai/gemini-3.5-flash-lite and read response_cost from a callback. Every /gemini row has 8 prompt and 1 completion token, every SDK row 7 and 1. The list price for /gemini is 8 * 3e-07 + 1 * 2.5e-06 = 0.0000049, and the named deployment's price is 8 * 1e-05 + 1 * 2e-05 = 0.0001. The /gemini and SDK rows ran again at 955bc80 (gemini log, SDK log) with the same prices. Commands, raw output, and the SDK script are in this gist

Body base_model, model_info, gateways, and route provider

Only keys allowed client pricing can reprice with base_model or model_info, a malformed one bills the list price, and each gateway bills its provider's prices

Body base_model and GEMINI_API_BASE spend rows

The calls send "base_model": "gemini/gemini-3.5-flash-lite" (or vertex_ai/... on /vertex_ai) against gemini-3.5-flash, once with a plain key and once with a key that allows client pricing, plus a control without base_model. Google served /gemini calls as gemini-3.6-flash. The gateway calls go through a second proxy started with GEMINI_API_BASE set to a forwarding recorder in front of generativelanguage.googleapis.com, which logged both requests

Call Key base_model Tokens Spend
/gemini plain yes 8 / 12 0.000051
/gemini stream plain yes 8 / 13 0.00005475
/gemini plain no 8 / 13 0.00005475
/gemini stream plain no 8 / 13 0.00005475
/gemini allowed yes 8 / 13 0.0000349
/gemini stream allowed yes 8 / 12 0.0000324
/vertex_ai stream plain yes 7 / 12 0.0001185
/vertex_ai stream plain no 7 / 13 0.0001275
/vertex_ai stream allowed yes 7 / 13 0.0000346
gateway plain no 8 / 1 0.0000049
gateway stream plain no 8 / 1 0.0000049

Plain-key rows bill the served model's list price per token, 8 * 7.5e-07 + 13 * 3.75e-06 for the first row, the same rate as the controls. Allowed-key rows bill flash-lite, 8 * 3e-07 + 13 * 2.5e-06 = 0.0000349 for 13 completion tokens. Both gateway rows bill 8 * 3e-07 + 1 * 2.5e-06 with no uplift. On 833df09 the plain-key /gemini row billed flash-lite and the gateway stream billed 1.1 times that. Full commands and output are in this gist file

Route provider and non-string base_model spend rows

/cfg-vx and /cfg-vxc are configured pass-through routes to a local gateway that forwards /vx/models/<model> to Vertex on us and /vxc/models/<model> to Claude on us-east5, called with a key whose allowed_passthrough_routes lists them. Those paths carry no location, so their rows take the default region's uplift, as on main. Claude Haiku 5.5 answered a quota 429 there, so Claude Haiku 4.5 is used, and that 429 is reported here instead of retried

  pass_through_endpoints:
    - path: /cfg-vx
      target: http://127.0.0.1:<gateway>/vx/models
      auth: true
      include_subpath: true
      merge_query_params: true
    - path: /cfg-vxc
      target: http://127.0.0.1:<gateway>/vxc/models
      auth: true
      include_subpath: true
      merge_query_params: true
Call Key Provider Tokens Spend
/cfg-vxc Claude stream config vertex_ai 15 / 5 0.000044
/cfg-vx Gemini config vertex_ai 7 / 1 0.00000506
/cfg-vx Gemini stream config vertex_ai 7 / 1 0.00000506
/v1beta gemini-us stream, base_model: 123 plain vertex_ai 7 / 1 0.00000506
/v1beta gemini-us stream plain vertex_ai 7 / 1 0.00000506
/gemini, base_model: 123 allowed gemini 8 / 1 0.0000049
/gemini allowed gemini 8 / 1 0.0000049
/vertex_ai global stream, base_model: 123 allowed vertex_ai 7 / 1 0.0000046
gateway /gemini plain gemini 8 / 1 0.0000049
gateway /gemini stream plain gemini 8 / 1 0.0000049

On 9518571 /live-pr-risk saw the /cfg-vxc Claude stream and the base_model: 123 streams bill $0. Full commands and output are in this gist file

Malformed client model_info spend rows (955bc80)

Every call uses a key whose metadata sets allow_client_pricing_override and puts the field in the body's metadata, or litellm_metadata where named. The /gemini list price is 8 * 3e-07 + 1 * 2.5e-06 = 0.0000049, and the string base_model row bills gemini-3.5-flash

Call Body field c33bc62 955bc80
/gemini none 0.0000049 0.0000049
/gemini model_info.base_model: 123 0 0.0000049
/gemini stream model_info.base_model: 123 0 0.0000049
/gemini stream litellm_metadata base_model: 123 0 0.0000049
/gemini model_info: "x" no row 0.0000049
/gemini string base_model 0.000021 0.000021
/vertex_ai global stream model_info.base_model: 123 0 0.0000046
/v1beta gemini-us stream model_info.base_model: 123 0 0.00000506

Main billed the 123 calls at the list price only because the stamped costs this PR removes hid the failed lookup, and it wrote no row for model_info: "x" either. Full commands and output are in the before and after gist files, and every earlier leg ran again at 955bc80 with the same per-token prices (Vertex, /gemini, body base_model and gateway, route provider, SDK)

Malformed client model_info on router routes (d2e1ae4)

Same allowed key against gemini-us, with "metadata": {"model_info": "x"} in the body. Main rejects these with a 400 before calling Vertex. On 955bc80 /v1/responses still answered 400 but called Vertex first and wrote a charged spend row, and /chat/completions answered 200. d2e1ae4 rejects them before the provider call again, as main does, while /gemini keeps billing the list price

Call Body field 955bc80 d2e1ae4
/v1/responses model_info: "x" 400, row 0.00000506 400, no row
/chat/completions model_info: "x" 200, row 0.00000506 400, no row
/v1beta gemini-us model_info: "x" 400, no row 400, no row
/v1/responses model_info.base_model: 123 200, 0.00000506 200, 0.00000506
/gemini model_info: "x" 200, 0.0000049 200, 0.0000049

Full commands and output are in the before and after gist files, and every earlier leg ran again at d2e1ae4 with the same per-token prices (malformed model_info, Vertex, /gemini, body base_model and gateway, route provider, SDK)

Every leg again at f4deed6

f4deed6 only narrows which upstream hosts count as Gemini, after a CodeQL alert. Every QA leg above ran again on it with the same status codes and the same per-token prices as on d2e1ae4. Only completion token counts moved between runs. The logs are router model_info, malformed model_info, Vertex, Gemini, base_model and gateway, route provider, SDK

Audit round 3 of 3

The audit drove every pricing contract this PR changes through a real proxy, red on base and green twice on head

Audit matrix

955bc80, d2e1ae4 and f4deed6 came after the third round, fixing /live-pr-risk findings and a CodeQL alert, so no fourth audit round ran. Its nine accounting cells (R1 to R5, N1, N2, N3' and N4) and the two cost controls (C3, C4') passed again at all three commits on a head-only rig, 9 of 9 and 2 of 2 each time

Base is the merge base 8b442f00fc and head is c33bc6250b. Each leg ran its own two-worker proxy, Postgres database, Redis and scripted upstream, with nothing mocked inside the proxy. The selected cells ran in group accounting with seed 4106601 and order seed 7, once on base and twice on head, and the controls ran once on head. The /gemini cost-harness pair ran in group cost with 8 workers, once on base and twice on head. Each spend row is matched by the sha256 of a per-call virtual key in LiteLLM_SpendLogs, and every expected price comes from the cost map, never a literal

Row Contract Lane Base Head Status
R1 Gemini stream keeps us uplift selected red green x2 VERIFIED
R2 Custom price on finished and cut-off stream selected red green x2 VERIFIED
R3 Claude stream keeps us-east5 uplift selected red green x2 VERIFIED
R4 /v1beta bills the deployment location selected red green x2 VERIFIED
R5 /gemini named deployment price, allowed keys only selected red green x2 VERIFIED
N1 Body base_model reprices for allowed keys only selected red green x2 VERIFIED
N2 /gemini via GEMINI_API_BASE bills as Gemini selected red green x2 VERIFIED
N3' Configured non-Google gateway is Vertex on every path selected red green x2 VERIFIED
N4 Non-string body base_model bills list price selected red green x2 VERIFIED
C1 OpenAI stream cut after usage control not run green VERIFIED
C2 /v1beta gemini/ custom price control not run green VERIFIED
C3 /gemini non-streamed list price control green green x2 VERIFIED
C4' /gemini gateway stream case, Gemini price selected red green x2 VERIFIED
B1 /v1beta global non-streamed drops uplift behavior change uplift list price FAIL, closed by 0018cbe
B2 /gemini allowed key bills named deployment behavior change list price deployment price FAIL, closed by 8a0696f, 833df09
B3 /gemini gateway stream provider and price behavior change vertex_ai gemini FAIL, closed by 9518571, c33bc62
B4 Configured gateway path provider no change vertex_ai vertex_ai Withdrawn by c33bc62
B5 Plain key base_model, /vertex_ai non-streamed behavior change repriced list price FAIL, closed by 9518571
B6 Allowed key base_model, three more modes behavior change list price repriced FAIL, closed by 8a0696f, 833df09
B7 Non-string base_model, non-streamed calls behavior change $0 list price FAIL, closed by c33bc62
U1 Pricing rules per mode, location, host, grant, base_model type unit evidence 20 red 1364 green VERIFIED

What the base reds billed, for 1200 prompt and 300 completion tokens

Row Cell Base billed Expected
R1 us streamed 0.00111 0.001221
R2 finished stream 0.00111 0.0018
R2 cut-off stream 0.001221 0.0018
R3 us-east5 streamRawPredict 0.0027 0.00297
R4 global generateContent 0.001221 0.00111
R4 us streamed 0.00111 0.001221
R5 allowed key, both modes 0.00111 0.018
N1 plain key, /vertex_ai generateContent 0.00024 0.00111
N1 allowed key, three modes 0.00111 0.00024
N2 streamed provider vertex_ai gemini
N3' Vertex resource path, streamed 0.00111 0.001221
N4 allowed key, /vertex_ai generateContent 0 0.00111
N4 plain key, /v1beta generateContent 0 0.00111
C4' /gemini streamed, cost group 0.0090552 0.008624

A separate lane ran the tip's tests against the previous commit 9518571f50's two changed product files. N3' went red there because short gateway paths were labeled gemini, and N4 went red because all six of its calls billed 0. So both cells catch the regressions this commit fixes

B3 is a /gemini stream through a GEMINI_API_BASE gateway, which now logs gemini and bills the Gemini row. The label comes from the /gemini route, not the URL path. B4 is withdrawn, since a configured pass-through to a non-Google host is vertex_ai on every path again, as on main, and N3' asserts that in both modes. B5 closes a hole on main, where a plain key that sent base_model in a non-streamed /vertex_ai body was billed at that model's price. B6 is a key or team with allow_client_pricing_override whose body base_model now reprices streamed /vertex_ai and both /gemini modes, where main billed list price. B7 closes another hole on main. A body base_model that is not a string billed 0 on non-streamed /v1beta for any key and on non-streamed /vertex_ai for an allowed key, and the head bills the list price on every route and mode

Node ids

  • R1 tests/integration/spend/test_vertex_passthrough_regional_uplift_spend.py::test_vertex_passthrough_spend_carries_the_regional_uplift_whether_or_not_the_call_streams
  • R2 tests/integration/spend/test_vertex_passthrough_regional_uplift_spend.py::test_custom_priced_vertex_passthrough_bills_the_deployment_price_even_when_the_stream_is_cut_off
  • R3 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_claude_on_vertex_passthrough_spend_carries_the_regional_uplift_whether_or_not_the_call_streams
  • R4 and B1 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_v1beta_generate_content_on_a_vertex_deployment_bills_the_deployment_location_in_both_modes
  • R5 and B2 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_gemini_passthrough_bills_a_named_custom_priced_deployment_only_for_keys_that_allow_it_in_both_modes
  • N1, B5 and B6 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_a_body_base_model_reprices_passthrough_spend_only_for_keys_that_allow_client_pricing
  • N2 and B3 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_gemini_passthrough_through_a_gemini_api_base_gateway_logs_and_bills_as_gemini_in_both_modes
  • N3' and B4 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_a_configured_passthrough_to_a_non_google_gateway_bills_as_vertex_whatever_the_path
  • N4 and B7 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_a_non_string_body_base_model_bills_the_list_price_instead_of_nothing
  • C1 tests/integration/spend/test_passthrough_stream_pricing_paths_spend.py::test_openai_passthrough_stream_cut_off_after_its_usage_bills_what_the_finished_stream_bills
  • C2 tests/integration/spend/test_google_genai_native_spend.py::test_generate_content_bills_from_usage_metadata[False] and [True]
  • C3 tests/integration/cost_calculation/test_cost_tracking.py::test_case_bills_expected_cost[gemini-3.1-pro-passthrough-generate_content_priced_via_gemini_key]
  • C4' tests/integration/cost_calculation/test_cost_tracking.py::test_case_bills_expected_cost[gemini-3.1-pro-passthrough-stream_generate_content_priced_via_gemini_key]
  • U1 the five unit files under tests/unit/google_genai/ and tests/unit/proxy/pass_through_endpoints/ that this PR changes, plus tests/unit/test_utils.py

No chaos, wall-time or live cell was needed, since the diff changes no queue, lock, retry, per-worker state or pattern with input-dependent cost, and every contract is the proxy's own pricing and logging of a scripted response. A Claude stream through a configured gateway's short path takes the same provider rule as N3' and the same stream parser as R3, and a unit case covers that combination. The classifier's no-host branch and a /vertex_ai call to a non-Google host cannot be reached

Type

🐛 Bug Fix

Caveats (if any)

Low

  • Non-streamed /v1beta calls to a global Vertex deployment now bill 10% less
    • Main charged them the regional uplift by mistake
  • /gemini calls from a key with allow_client_pricing_override that name a custom-priced deployment now bill its price
    • Main ignored that price in both modes. Keys without the flag still bill the list price
  • Streamed /v1beta calls now price with a body base_model, like non-streamed /v1beta and chat calls on main
    • The shared client pricing strip decides that on every route
  • A body base_model now counts only for keys or teams with allow_client_pricing_override
    • Master-key and auth: false callers that send one now bill the list price, like the other client pricing fields
  • The Cohere pass-through handler was not tested with custom pricing
  • The cut-off stream is proven against a scripted upstream, not real Vertex
    • The integration test runs the real proxy and fails on main
Already on main, left for separate fixes
  • Streamed /v1beta calls to a custom-priced gemini/ deployment still bill the list price, outside the Vertex path this PR changes
  • Cut-off pass-through streams sometimes write a failure row with no model or provider
  • Streamed spend rows repeat alt=sse in api_base, which is cosmetic
  • Claude streamed rows name the dated model and non-streamed rows the alias, and both price the same
  • Non-streamed /v1beta rows store Vertex's responseId as request_id, not the x-litellm-call-id the caller got
  • A configured pass-through route to a Gemini API gateway logs vertex_ai and pays the Vertex uplift
  • Non-streamed Claude through a configured gateway with a short path bills $0

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
Bugbot summary

[!NOTE]
Medium Risk
Changes billing and spend logging across Vertex/Gemini pass-through, streaming, and client pricing overrides; incorrect logic would mischarge customers but is heavily test-covered.

Overview
Aligns pass-through and Google GenAI spend logging so streamed and non-streamed calls bill the same way, including Vertex regional uplift, deployment custom prices, and correct Gemini vs Vertex provider selection.

Streaming Vertex/Gemini pass-through no longer keeps a location-blind response_cost from stream_chunk_builder; the central logger reprices using vertex_location, deployment metadata, and provider. /v1beta generate-content setup now forwards explicit vertex_location into logging params. Gemini pass-through stops stamping response_cost on the logging object so stream and non-stream paths match; interrupted streams use the logger’s cost calculator with handler cost as fallback.

Pass-through body parsing gates base_model behind allow_client_pricing_override, never forwards it upstream, and ignores non-string base_model / malformed model_info for pricing. Provider detection for logging treats /gemini and generativelanguage.googleapis.com (and subdomains) as Gemini; other hosts stay Vertex.

Adds broad unit and integration spend tests for regional uplift, custom deployments, gateways, and cut-off streams.

Reviewed by Cursor Bugbot for commit 775a523. Bugbot is set up for automated code reviews on this repo. Configure here.

  • d2e1ae4 passes /audit (cap: round 3 cells passed again)
  • d2e1ae4 passes /live-pr-risk
  • f4deed6 passes /audit (cap: round 3 cells passed again)
  • f4deed6 passes /live-pr-risk

…plift

The streamed Vertex pass-through handler builds the response with
stream_chunk_builder, which stamps a cost into _hidden_params without the
vertex_location. The handler then prices the response again with the
location from the URL, but only into kwargs, and the logger prefers the
stamped cost. Streamed calls on a regional endpoint were billed at the
global rate.

Stamp the location-aware cost on the response in the shared
generateContent payload builder so the logger records it.

Fixes BerriAI#44755
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Critical impact] The PR appears safe to merge, with no new actionable issues found

Summary

The PR lets the logger price streamed Vertex calls using the endpoint’s region and deployment prices. It also passes the deployment’s location into native Google calls and prices interrupted streams through the logger

Since the previous review, non-streamed Gemini calls also leave pricing to the logger. New tests compare streamed and non-streamed Gemini prices, and the earlier test-style finding is fixed

  • Vertex streams use the logger’s regional and deployment prices.
  • Interrupted Vertex streams use logger pricing for partial usage.
  • Google GenAI logging uses the deployment’s Vertex location.
  • Gemini pass-through calls leave their final price to the logger.

Reviews (3) · Last reviewed commit: "fix(proxy): let the logger price non-str..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 6, 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 pcbeingused333:fix-vertex-passthrough-stream-regional-cost (775a523) with main (581b7d1)

Open in CodSpeed

@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

pcbeingused333 and others added 5 commits October 6, 2026 14:35
…ugh-stream-regional-cost

# Conflicts:
#	tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_vertex_passthrough_logging_handler.py
…n_param

Writing _hidden_params directly mutated a parameter and needed a pyright ignore, which the type discipline gate counts as LIT004 and LIT011. set_hidden_param is the shared helper for this.
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@litereview

litereview Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

⚠️ code-review

Review incomplete

Scope: full · Full PR review.

Review incomplete.

The review could not complete.

Couldn’t complete

  • The model request failed (HTTP 400).
  • Review harness exit code: 1.
  • Real testing evidence: The reviewer did not provide evidence for this saved rule.
  • Compatibility requirements: The reviewer did not provide evidence for this saved rule.
  • Changed behavior and result consistency: The reviewer did not provide evidence for this saved rule.
Checks and execution details
  • Not run · Real testing evidence (required): The reviewer did not provide evidence for this saved rule.
  • Not run · Compatibility requirements (required): The reviewer did not provide evidence for this saved rule.
  • Not run · Changed behavior and result consistency (required): The reviewer did not provide evidence for this saved rule.

View review · Reviewed 775a52354ff1


kwargs["response_cost"] = response_cost
kwargs["model"] = model
set_hidden_param(litellm_model_response, "response_cost", response_cost)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

High · Custom-priced Vertex pass-through deployments are billed at the list price

  1. An operator configures a router deployment for a Vertex Gemini model with custom input_cost_per_token/output_cost_per_token. The router copies those rates into the deployment's model_info.
  2. A caller sends a non-streamed :generateContent request to /vertex_ai/.../models/&lt;that model>. vertex_proxy_route resolves the deployment, and _init_kwargs_for_pass_through_endpoint puts its model_info into metadata. At that point use_custom_pricing_for_model returns True.
  3. _create_vertex_response_logging_payload_for_generate_content prices the response with litellm.completion_cost(model=..., vertex_location=...). That call does not receive custom pricing or the deployment id. This PR now stamps the result into _hidden_params["response_cost"].
  4. Logging._process_hidden_params_and_response_cost and response_cost_calculator return any stamped response_cost before they consider custom_pricing. The spend row therefore records the cost-map price instead of the deployment's custom rate. Before this PR, the non-streamed path fell through to the calculator and used the custom rate.

The same helper serves the interactions and rawPredict handlers, so those paths change the same way. I confirmed the before/after values by calling the handler directly with a local reproducer. I did not run a full proxy.

Smallest fix: skip the stamp when use_custom_pricing_for_model(logging_obj.litellm_params) is true. Alternatively, pass custom_pricing and router_model_id into the helper's completion_cost call so the stamped value already honours the deployment rate.

Evidence

Local reproducer /tmp/repro.py: a Logging object with litellm_params={"metadata": {"model_info": {"id": "dep-1", "input_cost_per_token": 1e-9, "output_cost_per_token": 1e-9}}}, litellm.model_cost["dep-1"] registered the way the router does it, gemini-2.5-flash, 1000 prompt and 1000 completion tokens, locations/global.

Head 8278397: non-stream -> 0.0028, model_call_details response_cost: 0.0028 (list price).

Same script with the added set_hidden_param line removed (base behaviour): non-stream -> 2.0000000000000003e-06, model_call_details response_cost: 2.0000000000000003e-06 (custom price).

litellm_logging.py response_cost_calculator: if not ignore_stamped_cost and "response_cost" in hidden_params and hidden_params["response_cost"] is not None: ... return hidden_params["response_cost"] runs before custom_pricing = self._custom_pricing_for(...).

litellm_logging.py _process_hidden_params_and_response_cost: elif "response_cost" in hidden_params: self.model_call_details["response_cost"] = hidden_params["response_cost"].

llm_passthrough_endpoints.py _resolve_vertex_model_from_router returns deployment_model_info, which vertex_proxy_route stores on request.state. pass_through_endpoints.py then copies it to _metadata["model_info"].

router.py around line 9920 copies CustomPricingLiteLLMParams fields into _model_info and calls _register_deployment_in_model_cost(model_id=deployment.model_info.id, ...).

The streamed path already showed the list price at base (0.0028) for this setup, so the regression is specific to non-streamed calls.

Latest summary by code-review · View this review · Reviewed 827839794ff4

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 46f5573: the stamp now uses deployment custom pricing via completion_cost, with a test covering streamed and non-streamed spend

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.

Superseded by 429e29e, which drops the builder's location-blind cost instead of stamping one, so the logger applies the deployment's custom price in both modes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Finding withdrawn

The reply is correct. At head 429e29e1, _create_vertex_response_logging_payload_for_generate_content only writes the location-aware cost into kwargs["response_cost"]. It no longer stamps _hidden_params. The streamed path also calls _drop_location_blind_stream_builder_cost, which pops the builder's cost. Because no response_cost reaches the hidden params, Logging.response_cost_calculator skips its stamped-cost early return. It then reaches _custom_pricing_for and prices with the deployment's model_info rates. This now holds for both streamed and non-streamed calls. The unit tests check the custom price at the logger for both modes, and they fail when the old stamp is put back.

Evidence

vertex_passthrough_logging_handler.py:790-798 (head): the cost goes only into kwargs["response_cost"]. There is no set_hidden_param or _hidden_params write.

vertex_passthrough_logging_handler.py:672-681: _drop_location_blind_stream_builder_cost pops response_cost from the hidden params of the stream_chunk_builder result.

litellm_logging.py:1945-1956: the stamped-cost return only fires when hidden_params["response_cost"] is present and not None, which no longer happens on these paths.

tests/unit/.../test_vertex_passthrough_logging_handler.py:221-235 and 305-324: the custom-price tests pass model_info={"id": deployment, input/output rates} and assert that the logger records 7*input + 1*output at the custom rates, for streamed and non-streamed calls.

Run on head: 22 passed. With the stamp temporarily put back after line 797, all 6 custom_price cases failed (comparison failed). I restored the file afterwards.

tests/integration/spend/test_vertex_passthrough_regional_uplift_spend.py also asserts the custom price at the proxy level for finished and cut-off streams. I did not run this proxy test.

GitHub does not allow this App to resolve this thread. A repository maintainer must do it manually.

Reviewed 429e29e10f71 · View follow-up

mateo-berri and others added 2 commits October 17, 2026 17:52
…eamed call

Drop the location-blind cost stream_chunk_builder stores instead of stamping a cost, so the logger prices streamed generateContent and rawPredict calls with the URL's location and the deployment's custom pricing, the same way it prices non-streamed calls
…eir own rates

The stamped response_cost from the generateContent logging helper is returned before the
logger checks custom pricing, so a deployment with custom input/output rates was billed at
the cost-map price. The helper now passes custom_pricing and the deployment id into
completion_cost, so the stamp holds the deployment rate for streamed and non-streamed calls,
and deployments without custom pricing keep the regional uplift.
@veria-ai

veria-ai Bot commented Oct 18, 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: 1 · PR risk: 0/10

mateo-berri and others added 4 commits October 17, 2026 23:27
…tex-passthrough-stream-regional-cost

# Conflicts:
#	tests/unit/proxy/pass_through_endpoints/llm_provider_handlers/test_vertex_passthrough_logging_handler.py
… the deployment price, cut-off streams included
@mateo-berri

Copy link
Copy Markdown
Contributor

@pcbeingused333 thanks for 46f5573. I merged it but kept the version that drops the builder's stale cost, so the logger applies custom pricing everywhere

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

…price gateway Gemini streams as Gemini

A top-level base_model in a pass-through body now reaches the logging
params only for a key or team with allow_client_pricing_override, so a
plain key cannot pick a cheaper model's price once the logger prices
these calls. The test that pinned every litellm-owned body name into the
logging params now leaves base_model to its own key-gated test.

The Vertex handler now classifies a non-Google upstream host as Vertex
only for Vertex resource paths, so a /gemini stream through a
GEMINI_API_BASE gateway is priced as Gemini without the regional uplift.

Adds the audit's integration spend test for Claude on Vertex, /v1beta,
the named custom-priced /gemini deployment, and a cut OpenAI stream.
…d cover client base_model and gateway host pricing

The cost harness sends /gemini through GEMINI_API_BASE, which the pass-through now logs and bills as gemini, so the streamed case moves from the Vertex cases to the Gemini cases under the Gemini price. New spend tests cover a body base_model repricing only for keys allowed client pricing, a GEMINI_API_BASE gateway billing as Gemini in both modes, and a configured non-Google gateway picking the provider from the path.
…tring base_model

The Vertex pass-through handler picked Gemini pricing from the URL path,
so a configured pass-through to a Vertex gateway with a short path (no
/projects/ segment) was billed as Gemini, and its Claude streams at $0.
The provider now comes from the route: a call through /gemini or to
generativelanguage.googleapis.com prices as Gemini, and everything else
as Vertex, the same rule main used. Matching the GEMINI_API_BASE host
was rejected because one gateway can serve both APIs, and the path rule
was rejected because short gateway paths look like Gemini paths.

A non-string base_model (a number, list or object) made the cost
calculation fail and bill $0 once the stamped stream costs were gone.
get_base_model_from_metadata now ignores it and falls back to the
deployment's base_model, so the call bills the list price. A 400 was the
other option, but the logger runs after the upstream answered.
… and drop a non-object client model_info

A key allowed client pricing can send metadata.model_info in a pass-through
body. A non-string model_info.base_model made the cost lookup fail, and
once the stamped stream and Gemini costs were gone those calls billed $0
on /gemini and on streamed /vertex_ai and /v1beta. The lookup now ignores
a base_model that is not a string, the same rule the root base_model got,
so the call bills the list price.

A model_info that is not an object (a string or a list) broke several
logging steps that read it as a mapping, so a non-streamed /gemini call
fired no success callback and no pass-through call wrote a spend row. The
pass-through route now leaves a non-object model_info out of the logging
metadata, so the call bills the list price. A 400 was the other option,
but it would turn calls that answer 200 today into errors, and guarding
every reader of model_info would spread the same check over many files.
The previous commit made the base_model lookup return None for a
model_info that is not an object. That lookup also runs during call
setup on every router route and SDK entrypoint, where such a value used
to fail before any provider request. With the early return the call went
upstream, the provider billed it, and the request then failed in a later
reader that still expects an object. On /v1/messages and /v1/responses
the key was also charged for a response the client never got.

The lookup again reads base_model from any truthy model_info, so a
non-object value fails during setup the way it did before this PR. A
non-string base_model inside an object still bills the list price, and
the pass-through route still drops a non-object client model_info at
intake, so pass-through calls keep billing the list price.
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

…cost provider

The provider check accepted any host ending in
generativelanguage.googleapis.com, so a Vertex host such as
vertex-generativelanguage.googleapis.com was priced as Gemini and lost
the regional uplift. It now accepts that host or a subdomain of it.
@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@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 775a523. Configure here.

@mateo-berri

Copy link
Copy Markdown
Contributor

@litereview code-review

@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. Thanks for the contribution!

@mateo-berri
mateo-berri merged commit 6762d65 into BerriAI:main Oct 19, 2026
96 checks passed
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…
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.

[Bug]: streamed Vertex AI pass-through spend ignores the regional endpoint uplift

3 participants