Release date 2026/09/15
Feature
Added
cache_read_costandcache_write_costtomodel.optionsso cached and cache-write prompt tokens can be priced per 1M tokens, alongsideinput_cost/output_cost.Added filtering for empty Anthropic thinking blocks in request history.
Added support for reporting prompt cache token metrics when using native (non-OpenAI) request/response formats.
Added support for reporting prompt cache token metrics in OpenAI-compatible format.
Added support for per-cache-TTL cache-write pricing, context-window pricing factors, and service-tier pricing factors via
model.options(cache_write_cost_list,context_window_factor,service_tier_factor). Anthropic (cache TTL + service tier), OpenAI, and Gemini service tiers are collected from upstream responses.
Bugfix
Fixed a bug where a response from Anthropic could fail to decode when the client’s request advertised Brotli support, since Anthropic’s edge may then return a Brotli-encoded body that Kong’s response decompression – which only understands gzip – can’t inflate. Kong now normalizes the outgoing
Accept-Encodingrequest header before proxying to any LLM provider:gzip, identitywhen the client accepts gzip, andidentityotherwise, so a client that cannot inflate gzip is never handed a compressed body on the paths that pass the upstream response through untouched.Fixed an issue where Gemini and Anthropic token usage metadata was lost in streaming responses.
Fixed an issue where modern OpenAI output token limits were discarded or overridden during request normalization.
Fixed an issue where some Claude Code MCP tools did not correctly handle empty ‘requires’ array.
Fixed an issue where
cache_creation_input_tokensandcache_read_input_tokenswere excluded from prompt token counts, causing undercounting when Anthropic prompt caching was active.Fixed an issue where
stream_optionswas forwarded to Databricks upstreams, causing a 400 error since Databricks does not support this field.Fixed an issue where native Anthropic streaming counted provisional
message_startoutput tokens and summed cumulativemessage_deltausage.Fixed an issue where cache_control in Bedrock Anthropic format requests using ARN model IDs was lost.
Fixed an issue where Bedrock native ConverseStream requests using ARN model IDs could fail while handling streamed responses.
Fixed an issue where the
context-management-2025-06-27Anthropic beta flag was dropped when routing to a Bedrock target, causing Bedrock to reject requests carryingcontext_managementwith a400error on failover from an Anthropic target.Fixed an issue where output token usage was reported as zero for Bedrock native format request to AWS models like Nova.
Fixed an issue where signed Anthropic thinking blocks with omitted text were removed from request history.
Fixed an issue where Anthropic-format requests could report zero usage when it targets Bedrock’s own model via conversion.
Fixed an issue where full-sync reconfigure reset balancer state even when plugin configs were unchanged.
Fixed an issue where OpenAI, Azure, and Gemini realtime upstream URLs using
wsswere downgraded tows.Fixed an issue where a credential header could appear unredacted in access logs when using AWS temporary credentials with Bedrock.
Fixed an issue where Ollama rejected OpenAI message content arrays.
Fixed an issue where OpenAI content array was sent as bedrock/gemini system message which only support string.
Fixed an issue where the configured auth header (e.g.
api-key,x-api-key) leaked the provider credential into access logs instead of being redacted.Fixed an issue where token usage for Anthropic requests using the compaction beta was undercounted. Kong now sums
usage.iterationswhen present instead of relying solely on the top-levelinput_tokens/output_tokens, which only reflect non-compaction iterations.Fixed an issue where a malformed RSA private key in a Gemini provider’s
service_account_jsoncaused crash with SIGSEGVFixed an issue where adapted Anthropic responses omitted cache and reasoning usage details.
Fixed an issue where Claude Sonnet 5 and Opus 5 rejected OpenAI-format reasoning requests on Bedrock due to an unsupported thinking.type value.
Fixed an issue where repeated cumulative usage in streaming responses inflated token counts.
Fixed an issue where Gemini non-streaming responses that reached
max_tokensreported astopfinish reason instead oflength.Fixed an issue where a Gemini response with JSON
nulltoken counts inusageMetadatacaused an HTTP 500 on non-streaming chat requests and an empty HTTP 200 response on streaming chat requests.Fixed an issue where provider-reported reasoning-token details were not correctly reported.
Fixed an issue where xAI reasoning tokens were not folded into completion_tokens, breaking the OpenAI usage identity.
Fixed an issue where Gemini’s tool-use token usage (billed when server-side tools such as grounding, code execution, or URL context are used) was not counted in the reported token usage or cost.
Fixed Azure OpenAI responses support in deployment style.
Fixed Gemini image generation token accounting to include reasoning tokens (
thoughtsTokenCount) inoutput_tokensand report them asoutput_tokens_details.reasoning_tokens. Previously the reasoning tokens were dropped, which under-reported output tokens, analytics, and calculated cost for thinking-enabled image models.Fixed Gemini realtime (Live API) token accounting to include reasoning tokens (
thoughtsTokenCount) in the reported output tokens, and to report them asoutput_tokens_reasoning_tokens_count. Previously the reasoning tokens were dropped, which under-reported the output and total token counts of thinking-enabled realtime sessions.Fixed multipart video generation requests to OpenAI-compatible providers leaking internal multipart metadata into JSON upstream bodies, which caused the requests to fail.
Fixed token usage statistics being silently dropped for
audio/v1/audio/transcriptionsrequests. Token-billed OpenAI/Azure transcription models (e.g.gpt-4o-transcribe) now reportinput_tokens/output_tokens/total_tokensand thetext_tokens/audio_tokensbreakdown in the analytics log whenlogging.log_statisticsis enabled.Fixed an issue where Gemini streaming analytics could over-report token usage. Gemini repeats its usage metadata on every stream chunk as a running request-level total, but the counts were summed across chunks instead of replaced, multiplying the reported usage by the number of chunks. Reasoning tokens were affected the most, because Gemini reports them in full on the first chunk and does not change them afterwards. A chunk that carried no usage metadata also reset the recorded output token count to zero.
Fixed a 500 crash on Bedrock Converse requests when a
cachePointcontent block immediately followed atoolResultblock in the same message.Fixed vector database indexes and cached embedding records being left behind when a plugin instance was deleted.