From fb74bc902f21486b7ac3d1ed122da8fc6500649d Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:10:09 -0800 Subject: [PATCH 01/37] chore(cost-map): rolling registry audit, add gpt-6-cyber, Kimi K3.1 Pro rows, Jina rerankers and capability flags (#50245) * chore(cost-map): rolling registry audit, add gpt-6-cyber, Kimi K3.1 Pro rows, Jina rerankers and capability flags Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(cost-map): declare gpt-6-cyber PDF input support Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- ...odel_prices_and_context_window_backup.json | 87 ++++++++++++++++++- model_prices_and_context_window.json | 87 ++++++++++++++++++- 2 files changed, 172 insertions(+), 2 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index a5b9a5cb457..708af70985d 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -40893,6 +40893,22 @@ "output_cost_per_token": 4e-07, "supports_tool_choice": true }, + "jina-reranker-v3.5": { + "input_cost_per_token": 5e-08, + "litellm_provider": "jina_ai", + "max_input_tokens": 131072, + "mode": "rerank", + "output_cost_per_token": 0.0, + "source": "https://api.jina.ai/v1/models" + }, + "jina-reranker-m0": { + "input_cost_per_token": 5e-08, + "litellm_provider": "jina_ai", + "max_input_tokens": 10240, + "mode": "rerank", + "output_cost_per_token": 0.0, + "source": "https://api.jina.ai/v1/models" + }, "jina-reranker-v2-base-multilingual": { "input_cost_per_token": 5e-08, "litellm_provider": "jina_ai", @@ -43771,7 +43787,8 @@ "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": true, - "supports_tool_choice": true + "supports_tool_choice": true, + "supports_vision": true }, "mistral/zai-glm-5-3": { "cache_read_input_token_cost": 1.4e-07, @@ -45270,6 +45287,18 @@ "source": "https://tokenfactory.nebius.com/api/public/models_info", "cache_read_input_token_cost": 1.5e-07 }, + "nebius/moonshotai/Kimi-K3.1-Pro": { + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1e-05, + "cache_read_input_token_cost": 2e-07, + "litellm_provider": "nebius", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_vision": true, + "supports_prompt_caching": true, + "source": "https://tokenfactory.nebius.com/api/public/models_info" + }, "nebius/moonshotai/Kimi-K3": { "max_input_tokens": 1048576, "max_output_tokens": 1024000, @@ -72148,6 +72177,7 @@ "output_cost_per_token": 4.5e-06, "source": "https://ai.google.dev/gemini-api/docs/pricing", "supports_audio_input": true, + "supports_audio_output": true, "tpm": 250000, "rpm": 10, "search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014}, @@ -72170,6 +72200,7 @@ "output_cost_per_token": 4.5e-06, "source": "https://ai.google.dev/gemini-api/docs/pricing", "supports_audio_input": true, + "supports_audio_output": true, "tpm": 250000, "rpm": 10, "search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014}, @@ -82782,6 +82813,38 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true }, + "gpt-6-cyber": { + "cache_creation_input_token_cost": 2.5e-05, + "cache_creation_input_token_cost_above_12hr": 5e-05, + "cache_read_input_token_cost": 2e-06, + "input_cost_per_token": 2e-05, + "litellm_provider": "openai", + "max_output_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 0.0001, + "source": "https://developers.openai.com/api/docs/models/gpt-6-cyber", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_search": true, + "supports_vision": true, + "supports_web_search": true + }, "gpt-6-astra-law": { "cache_read_input_token_cost": 1e-06, "input_cost_per_token": 1e-05, @@ -83380,6 +83443,28 @@ "supports_response_schema": true, "source": "https://empiriolabs.ai/models/kimi-k3" }, + "empiriolabs/kimi-k3-1-pro": { + "litellm_provider": "empiriolabs", + "mode": "chat", + "max_input_tokens": 1048576, + "max_output_tokens": 131072, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1e-05, + "cache_read_input_token_cost": 1.8e-06, + "supports_system_messages": true, + "supports_vision": true, + "supports_reasoning": true, + "supports_web_search": true, + "search_context_cost_per_query": { + "search_context_size_low": 0.015, + "search_context_size_medium": 0.015, + "search_context_size_high": 0.015 + }, + "supports_prompt_caching": true, + "supports_response_schema": true, + "supports_function_calling": true, + "source": "https://empiriolabs.ai/models/kimi-k3-1-pro" + }, "empiriolabs/mimo-v2-6-flash": { "litellm_provider": "empiriolabs", "mode": "chat", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index a5b9a5cb457..708af70985d 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -40893,6 +40893,22 @@ "output_cost_per_token": 4e-07, "supports_tool_choice": true }, + "jina-reranker-v3.5": { + "input_cost_per_token": 5e-08, + "litellm_provider": "jina_ai", + "max_input_tokens": 131072, + "mode": "rerank", + "output_cost_per_token": 0.0, + "source": "https://api.jina.ai/v1/models" + }, + "jina-reranker-m0": { + "input_cost_per_token": 5e-08, + "litellm_provider": "jina_ai", + "max_input_tokens": 10240, + "mode": "rerank", + "output_cost_per_token": 0.0, + "source": "https://api.jina.ai/v1/models" + }, "jina-reranker-v2-base-multilingual": { "input_cost_per_token": 5e-08, "litellm_provider": "jina_ai", @@ -43771,7 +43787,8 @@ "supports_prompt_caching": true, "supports_reasoning": true, "supports_response_schema": true, - "supports_tool_choice": true + "supports_tool_choice": true, + "supports_vision": true }, "mistral/zai-glm-5-3": { "cache_read_input_token_cost": 1.4e-07, @@ -45270,6 +45287,18 @@ "source": "https://tokenfactory.nebius.com/api/public/models_info", "cache_read_input_token_cost": 1.5e-07 }, + "nebius/moonshotai/Kimi-K3.1-Pro": { + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1e-05, + "cache_read_input_token_cost": 2e-07, + "litellm_provider": "nebius", + "mode": "chat", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_vision": true, + "supports_prompt_caching": true, + "source": "https://tokenfactory.nebius.com/api/public/models_info" + }, "nebius/moonshotai/Kimi-K3": { "max_input_tokens": 1048576, "max_output_tokens": 1024000, @@ -72148,6 +72177,7 @@ "output_cost_per_token": 4.5e-06, "source": "https://ai.google.dev/gemini-api/docs/pricing", "supports_audio_input": true, + "supports_audio_output": true, "tpm": 250000, "rpm": 10, "search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014}, @@ -72170,6 +72200,7 @@ "output_cost_per_token": 4.5e-06, "source": "https://ai.google.dev/gemini-api/docs/pricing", "supports_audio_input": true, + "supports_audio_output": true, "tpm": 250000, "rpm": 10, "search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014}, @@ -82782,6 +82813,38 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true }, + "gpt-6-cyber": { + "cache_creation_input_token_cost": 2.5e-05, + "cache_creation_input_token_cost_above_12hr": 5e-05, + "cache_read_input_token_cost": 2e-06, + "input_cost_per_token": 2e-05, + "litellm_provider": "openai", + "max_output_tokens": 128000, + "mode": "chat", + "output_cost_per_token": 0.0001, + "source": "https://developers.openai.com/api/docs/models/gpt-6-cyber", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_computer_use": true, + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_tool_search": true, + "supports_vision": true, + "supports_web_search": true + }, "gpt-6-astra-law": { "cache_read_input_token_cost": 1e-06, "input_cost_per_token": 1e-05, @@ -83380,6 +83443,28 @@ "supports_response_schema": true, "source": "https://empiriolabs.ai/models/kimi-k3" }, + "empiriolabs/kimi-k3-1-pro": { + "litellm_provider": "empiriolabs", + "mode": "chat", + "max_input_tokens": 1048576, + "max_output_tokens": 131072, + "input_cost_per_token": 2e-06, + "output_cost_per_token": 1e-05, + "cache_read_input_token_cost": 1.8e-06, + "supports_system_messages": true, + "supports_vision": true, + "supports_reasoning": true, + "supports_web_search": true, + "search_context_cost_per_query": { + "search_context_size_low": 0.015, + "search_context_size_medium": 0.015, + "search_context_size_high": 0.015 + }, + "supports_prompt_caching": true, + "supports_response_schema": true, + "supports_function_calling": true, + "source": "https://empiriolabs.ai/models/kimi-k3-1-pro" + }, "empiriolabs/mimo-v2-6-flash": { "litellm_provider": "empiriolabs", "mode": "chat", From 6f9c602650d23bdcc781ceae5f627a0dce830fc7 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:16:15 +0000 Subject: [PATCH 02/37] test(skills): assert patch publication and serialize preference writes (#50252) Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- ..._claude_code_plugin_installation_preference.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/integration/management/test_claude_code_plugin_installation_preference.py b/tests/integration/management/test_claude_code_plugin_installation_preference.py index aaf6f02ff4e..6d41c690709 100644 --- a/tests/integration/management/test_claude_code_plugin_installation_preference.py +++ b/tests/integration/management/test_claude_code_plugin_installation_preference.py @@ -4,6 +4,7 @@ from collections.abc import Mapping from concurrent.futures import ThreadPoolExecutor from functools import partial from pathlib import Path +from threading import Lock from typing import Final import httpx @@ -248,7 +249,7 @@ def test_duplicate_json_key_keeps_the_last_value(gateway: Gateway) -> None: assert stored_manifest(name)["installation_preference"] == "available" -def test_repeated_identical_update_is_idempotent(gateway: Gateway) -> None: +def test_repeated_identical_updates_publish_patch_versions_without_changing_preference(gateway: Gateway) -> None: name: Final = plugin_name() with gateway.scenario() as scenario: registered(scenario, name, installation_preference="required") @@ -257,7 +258,9 @@ def test_repeated_identical_update_is_idempotent(gateway: Gateway) -> None: replaced(gateway, name, installation_preference="required") second: Final = stored_rows(name) assert len(first) == 1, first - assert second == first + first_manifest: Final = JSON_OBJECT.validate_json(string_value(first[0]["manifest_json"])) + assert first_manifest["version"] == "1.0.1", first + assert second == [{**first[0], "manifest_json": json.dumps({**first_manifest, "version": "1.0.2"})}] assert_preference_served(gateway, name, "required") @@ -442,14 +445,16 @@ def test_burst_reads_across_processes_while_the_preference_flips(gateway: Gatewa name: Final = plugin_name() targets: Final = (gateway, peer) flips: Final = tuple(PREFERENCES[(index + 1) % len(PREFERENCES)] for index in range(13)) + writer: Final = Lock() with gateway.scenario() as scenario: registered(scenario, name, installation_preference="available") def job(index: int) -> tuple[str, JsonValue]: if index % 4 == 3: - return "flip", replace( - gateway, name, replacement(name, installation_preference=flips[index // 4]) - ).status_code + with writer: + return "flip", replace( + gateway, name, replacement(name, installation_preference=flips[index // 4]) + ).status_code return "read", marketplace_entry(targets[index % 2], name).get("installationPreference") with ThreadPoolExecutor(max_workers=8) as pool: From 4cdfaaa334f800b0ce9c9fdb742589a512c0a987 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:16:40 +0000 Subject: [PATCH 03/37] test(usage): assert per-user entity spend and metadata (#50251) Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/integration/_support/daily_activity.py | 18 +++++++++++++++++- .../spend/fixtures/daily_activity_user.json | 2 +- .../spend/test_daily_activity_key_owner.py | 2 ++ .../test_daily_activity_key_owner_faults.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/tests/integration/_support/daily_activity.py b/tests/integration/_support/daily_activity.py index 346fc156ea9..cedcb80843a 100644 --- a/tests/integration/_support/daily_activity.py +++ b/tests/integration/_support/daily_activity.py @@ -272,16 +272,32 @@ def assert_key_reported( date: str, metadata: Mapping[str, JsonValue], metrics: Mapping[str, float], + *, + entity_rows: Mapping[str, int] | None = None, ) -> None: assert response.status_code == 200, response.text body: Final = object_value(response.json()) records: Final = tuple(object_value(record) for record in records_of_key(body, api_key)) assert records, response.text assert all(record["metadata"] == metadata for record in records), response.text - assert all(counted(record["metrics"]) == pytest.approx(metrics) for record in records), response.text days: Final = body["results"] assert isinstance(days, list) and len(days) == 1, response.text day: Final = object_value(days[0]) + breakdown: Final = object_value(day["breakdown"]) + if entity_rows is None: + assert all(counted(record["metrics"]) == pytest.approx(metrics) for record in records), response.text + else: + totals: Final = records_of_key({name: value for name, value in breakdown.items() if name != "entities"}, api_key) + assert totals, response.text + assert all(counted(object_value(record)["metrics"]) == pytest.approx(metrics) for record in totals), response.text + entities: Final = object_value(breakdown["entities"]) + assert set(entities) == set(entity_rows), response.text + for entity, rows in entity_rows.items(): + bucket: Final = object_value(entities[entity]) + assert counted(bucket["metrics"]) == pytest.approx(seeded_metrics(rows)), response.text + keys: Final = object_value(bucket["api_key_breakdown"]) + assert set(keys) == {api_key}, response.text + assert counted(object_value(keys[api_key])["metrics"]) == pytest.approx(seeded_metrics(rows)), response.text assert day["date"] == date, response.text assert counted(day["metrics"]) == pytest.approx(metrics), response.text assert object_value(body["metadata"])["total_spend"] == pytest.approx(metrics["spend"]), response.text diff --git a/tests/integration/spend/fixtures/daily_activity_user.json b/tests/integration/spend/fixtures/daily_activity_user.json index ae05e661071..058e12a5044 100644 --- a/tests/integration/spend/fixtures/daily_activity_user.json +++ b/tests/integration/spend/fixtures/daily_activity_user.json @@ -1 +1 @@ -{"results":[{"date":"2026-06-01","metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"breakdown":{"mcp_servers":{},"models":{"model-ptu":{"metrics":{"spend":1000.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_read_input_tokens":0,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":0,"successful_requests":0,"failed_requests":0,"api_requests":0,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{}},"model-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}},"model-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}},"model-popular":{"metrics":{"spend":270.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":9,"completion_tokens":6,"cache_read_input_tokens":3,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":15,"successful_requests":3,"failed_requests":0,"api_requests":3,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"model_groups":{"model-ptu":{"metrics":{"spend":1000.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_read_input_tokens":0,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":0,"successful_requests":0,"failed_requests":0,"api_requests":0,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{}},"model-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}},"model-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}},"model-popular":{"metrics":{"spend":270.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":9,"completion_tokens":6,"cache_read_input_tokens":3,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":15,"successful_requests":3,"failed_requests":0,"api_requests":3,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"providers":{"provider-a":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"endpoints":{"/v1/chat/completions":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"api_keys":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}},"entities":{"user-1":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}}},"guardrails":{}}}],"metadata":{"total_spend":1273.0,"total_flat_cost":0.0,"total_ptu_hours":0.0,"total_prompt_tokens":1014,"total_completion_tokens":10,"total_tokens":1024,"total_api_requests":5,"total_successful_requests":5,"total_failed_requests":0,"total_cache_read_input_tokens":6,"total_cache_creation_input_tokens":0,"total_compression_saved_tokens":0,"total_compression_savings_spend":0.0,"total_prompt_caching_savings_spend":0.0,"total_gateway_injected_caching_savings_spend":0.0,"total_autorouter_savings_spend":0.0,"total_response_time_ms":0,"total_timed_requests":0,"page":1,"total_pages":1,"has_more":false,"api_key_limit":100,"total_api_keys":5,"entity_total_api_keys":{"user-1":5}}} +{"results":[{"date":"2026-06-01","metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"breakdown":{"mcp_servers":{},"models":{"model-ptu":{"metrics":{"spend":1000.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_read_input_tokens":0,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":0,"successful_requests":0,"failed_requests":0,"api_requests":0,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{}},"model-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}},"model-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}},"model-popular":{"metrics":{"spend":270.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":9,"completion_tokens":6,"cache_read_input_tokens":3,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":15,"successful_requests":3,"failed_requests":0,"api_requests":3,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"model_groups":{"model-ptu":{"metrics":{"spend":1000.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":0,"completion_tokens":0,"cache_read_input_tokens":0,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":0,"successful_requests":0,"failed_requests":0,"api_requests":0,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{}},"model-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}},"model-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}},"model-popular":{"metrics":{"spend":270.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":9,"completion_tokens":6,"cache_read_input_tokens":3,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":15,"successful_requests":3,"failed_requests":0,"api_requests":3,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"providers":{"provider-a":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"endpoints":{"/v1/chat/completions":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{},"api_key_breakdown":{"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}}}}},"api_keys":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}},"entities":{"user-1":{"metrics":{"spend":1273.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1014,"completion_tokens":10,"cache_read_input_tokens":6,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1024,"successful_requests":5,"failed_requests":0,"api_requests":5,"total_response_time_ms":0,"timed_requests":0},"metadata":{"user_email":"user@example.com","user_alias":null},"api_key_breakdown":{"key-a":{"metrics":{"spend":100.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":2,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":4,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-a","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-b":{"metrics":{"spend":90.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":3,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":5,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-b","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-c":{"metrics":{"spend":80.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":4,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":6,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-c","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-cache":{"metrics":{"spend":2.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":1000,"completion_tokens":2,"cache_read_input_tokens":1,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":1002,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"alias-cache","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":true}},"key-target":{"metrics":{"spend":1.0,"flat_cost":0.0,"ptu_hours":0.0,"prompt_tokens":5,"completion_tokens":2,"cache_read_input_tokens":2,"cache_creation_input_tokens":0,"compression_saved_tokens":0,"compression_savings_spend":0.0,"prompt_caching_savings_spend":0.0,"gateway_injected_caching_savings_spend":0.0,"autorouter_savings_spend":0.0,"total_tokens":7,"successful_requests":1,"failed_requests":0,"api_requests":1,"total_response_time_ms":0,"timed_requests":0},"metadata":{"key_alias":"deleted-target","team_id":"team-1","user_id":"user-1","user_email":"user@example.com","key_exists":false}}}}},"guardrails":{}}}],"metadata":{"total_spend":1273.0,"total_flat_cost":0.0,"total_ptu_hours":0.0,"total_prompt_tokens":1014,"total_completion_tokens":10,"total_tokens":1024,"total_api_requests":5,"total_successful_requests":5,"total_failed_requests":0,"total_cache_read_input_tokens":6,"total_cache_creation_input_tokens":0,"total_compression_saved_tokens":0,"total_compression_savings_spend":0.0,"total_prompt_caching_savings_spend":0.0,"total_gateway_injected_caching_savings_spend":0.0,"total_autorouter_savings_spend":0.0,"total_response_time_ms":0,"total_timed_requests":0,"page":1,"total_pages":1,"has_more":false,"api_key_limit":100,"total_api_keys":5,"entity_total_api_keys":{"user-1":5}}} diff --git a/tests/integration/spend/test_daily_activity_key_owner.py b/tests/integration/spend/test_daily_activity_key_owner.py index cec19ce5ea0..5a9d8c7467c 100644 --- a/tests/integration/spend/test_daily_activity_key_owner.py +++ b/tests/integration/spend/test_daily_activity_key_owner.py @@ -57,6 +57,7 @@ def test_key_whose_daily_spend_names_two_users_is_reported_with_no_owner(gateway DAY, key_metadata(), seeded_metrics(2), + entity_rows={first: 1, second: 1}, ) @@ -74,6 +75,7 @@ def test_daily_spend_rows_naming_no_user_do_not_hide_the_one_user_the_others_nam DAY, key_metadata(user=owner, email=email), seeded_metrics(2), + entity_rows={owner: 1, "Unassigned": 1}, ) diff --git a/tests/integration/spend/test_daily_activity_key_owner_faults.py b/tests/integration/spend/test_daily_activity_key_owner_faults.py index 1dba97d6ae1..2eeca3c1588 100644 --- a/tests/integration/spend/test_daily_activity_key_owner_faults.py +++ b/tests/integration/spend/test_daily_activity_key_owner_faults.py @@ -199,7 +199,7 @@ def test_key_stops_being_reported_with_an_owner_once_a_second_user_spends_with_i with daily_rows((user_row(second, api_key, DAY),)): shared: Final = activity_of_key(gateway, AGGREGATED_USER_ACTIVITY, api_key) assert_key_reported(alone, api_key, DAY, key_metadata(user=first, email=email), seeded_metrics(1)) - assert_key_reported(shared, api_key, DAY, key_metadata(), seeded_metrics(2)) + assert_key_reported(shared, api_key, DAY, key_metadata(), seeded_metrics(2), entity_rows={first: 1, second: 1}) @pytest.mark.timeout(300) From 26ba02d3ce8a82d5260854c2e4fc32a13c70c3c2 Mon Sep 17 00:00:00 2001 From: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:20:06 -0800 Subject: [PATCH 04/37] perf(bedrock): avoid copying already isolated schema definitions (#50240) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/prompt_templates/factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.py index 4c3907dc52f..eda98ae2c67 100644 --- a/litellm/litellm_core_utils/prompt_templates/factory.py +++ b/litellm/litellm_core_utils/prompt_templates/factory.py @@ -5879,7 +5879,7 @@ def _bedrock_tools_pt( description = name defs = parameters.pop("$defs", {}) - defs_copy = copy.deepcopy(defs) if isinstance(defs, dict) else {} + defs_copy = defs if isinstance(defs, dict) else {} # Expand $ref references in parameters using the definitions # Note: We don't pre-flatten defs as that causes exponential memory growth # with circular references (see issue #19098). unpack_defs handles nested From 308fe0792080ee2a87329759d77dafd05e3b74b1 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 20:28:55 +0000 Subject: [PATCH 05/37] fix(openai): add gpt-6-cyber max input tokens and the gpt-5.5-cyber-preview shutdown date (#50254) Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/model_prices_and_context_window_backup.json | 3 +++ model_prices_and_context_window.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 708af70985d..1bda9d24c8e 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -71218,6 +71218,8 @@ }, "gpt-5.5-cyber-preview": { "cache_read_input_token_cost": 1.25e-06, + "deprecation_date": "2027-02-01", + "deprecation_source": "https://developers.openai.com/api/docs/deprecations", "input_cost_per_token": 1.25e-05, "litellm_provider": "openai", "mode": "chat", @@ -82819,6 +82821,7 @@ "cache_read_input_token_cost": 2e-06, "input_cost_per_token": 2e-05, "litellm_provider": "openai", + "max_input_tokens": 922000, "max_output_tokens": 128000, "mode": "chat", "output_cost_per_token": 0.0001, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 708af70985d..1bda9d24c8e 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -71218,6 +71218,8 @@ }, "gpt-5.5-cyber-preview": { "cache_read_input_token_cost": 1.25e-06, + "deprecation_date": "2027-02-01", + "deprecation_source": "https://developers.openai.com/api/docs/deprecations", "input_cost_per_token": 1.25e-05, "litellm_provider": "openai", "mode": "chat", @@ -82819,6 +82821,7 @@ "cache_read_input_token_cost": 2e-06, "input_cost_per_token": 2e-05, "litellm_provider": "openai", + "max_input_tokens": 922000, "max_output_tokens": 128000, "mode": "chat", "output_cost_per_token": 0.0001, From f069da8e0ead97381775a6dce8af3675f43fbe13 Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Thu, 5 Nov 2026 12:38:58 -0800 Subject: [PATCH 06/37] fix(anthropic): report temperature/top_p as supported only when the model keeps them (#50144) * fix(anthropic): report temperature/top_p as supported only when the model keeps them Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(vertex_ai): accept the generic unsupported-param message for Claude batch rows Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/llms/anthropic/chat/transformation.py | 4 ++-- .../test_anthropic_chat_transformation.py | 21 +++++++++++++++++++ .../test_vertex_ai_files_transformation.py | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py index 4f890ed922f..ac4addb0847 100644 --- a/litellm/llms/anthropic/chat/transformation.py +++ b/litellm/llms/anthropic/chat/transformation.py @@ -827,11 +827,11 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig): return cls._raise_invalid_reasoning_effort(model, value, llm_provider) def get_supported_openai_params(self, model: str): + sampling_params: Final = ("temperature", "top_p") if self._supports_sampling_params(model) else () params: Final = [ "stream", "stop", - "temperature", - "top_p", + *sampling_params, "max_tokens", "max_completion_tokens", "tools", diff --git a/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py b/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py index 80845b1f12d..3a4231443dd 100644 --- a/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py +++ b/tests/unit/llms/anthropic/chat/test_anthropic_chat_transformation.py @@ -11047,3 +11047,24 @@ def test_claude_cache_control_cap_does_not_count_a_message_level_hint_that_list_ assert sorted(_cached_texts(body)) == ["system prompt", "turn 1", "turn 2", "turn 3"] assert json.dumps(body).count('"cache_control"') == 4 + + +@pytest.mark.parametrize("model", ["claude-opus-4-7", "claude-haiku-4-5-20251001"]) +def test_get_supported_params_reports_sampling_params_only_when_the_request_keeps_them( + local_model_cost_map, model: str +): + """What get_supported_openai_params says about temperature/top_p must match what + map_openai_params does with them under drop_params, so a caller that pre-flights + from the list is never told a param is fine that the request path then drops.""" + config = AnthropicConfig() + + supported = config.get_supported_openai_params(model=model) + sent = config.map_openai_params( + non_default_params={"temperature": 0.1, "top_p": 0.5}, + optional_params={}, + model=model, + drop_params=True, + ) + + assert ("temperature" in supported) == ("temperature" in sent), (model, supported, sent) + assert ("top_p" in supported) == ("top_p" in sent), (model, supported, sent) diff --git a/tests/unit/llms/vertex_ai/files/test_vertex_ai_files_transformation.py b/tests/unit/llms/vertex_ai/files/test_vertex_ai_files_transformation.py index 98e204dd44e..842500a7b27 100644 --- a/tests/unit/llms/vertex_ai/files/test_vertex_ai_files_transformation.py +++ b/tests/unit/llms/vertex_ai/files/test_vertex_ai_files_transformation.py @@ -2161,7 +2161,7 @@ class TestVertexClaudeBatch: monkeypatch.setattr(litellm, "drop_params", False) entry: Final = _claude_chat_entry("r1", "hi", max_tokens=10, top_p=0.5) - with pytest.raises(VertexAIError, match=r"line 1 .*top_p=0.5.*drop_params") as exc_info: + with pytest.raises(VertexAIError, match=r"line 1 .*top_p.*drop_params") as exc_info: _uploaded_rows(config, {**CLAUDE_DEPLOYMENT, "model": "vertex_ai/claude-zeta-9"}, [entry]) assert exc_info.value.status_code == 400 From 41d45079c7b0b71caac21566f7948c7ad269e339 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 5 Nov 2026 12:42:14 -0800 Subject: [PATCH 07/37] refactor(ui): move remaining logs and usage text onto i18n (#50146) Logs and usage option lists, filter chip labels and label maps now hold message keys that their readers translate at render time. Tile titles, the "Claude (unspecified)" agent label and the endpoint chart categories stay English ids and get display maps keyed by them. Lookups keyed by URL or server values check Object.hasOwn first. --- .../components/EndpointUsageBarChart.tsx | 7 +- .../components/EntityUsage/EntityUsage.tsx | 19 +-- .../components/EntityUsage/TopModelView.tsx | 9 +- .../EntityUsage/entityUsageSummary.ts | 12 ++ .../components/errors/ErrorsTab.tsx | 12 +- .../components/errors/errorsData.ts | 16 +-- .../components/overview/BreakdownChart.tsx | 21 +-- .../components/overview/TopAgents.tsx | 30 ++-- .../overview/UsageBreakdownChart.tsx | 16 +-- .../components/overview/agentCatalog.ts | 9 +- .../_components/hooks/clientUsageData.test.ts | 3 +- .../_components/hooks/clientUsageData.ts | 6 +- .../components/EntityUsage/TopKeyView.tsx | 8 +- .../components/chat_ui/ResponseMetrics.tsx | 6 +- .../components/logs/audit/AuditLogsTable.tsx | 83 ++++++----- .../src/components/logs/constants.ts | 56 ++++---- .../logs/detail/LogDetailContent.tsx | 6 +- .../detail/sections/ToolsSection/utils.ts | 3 +- .../logs/request/LogsTableToolbar.tsx | 6 +- .../logs/request/RequestLogsFilters.tsx | 84 ++++++----- .../logs/request/RequestLogsTable.tsx | 16 ++- .../logs/request/useLogFilterLogic.ts | 33 ++--- .../src/components/user_agent_activity.tsx | 9 +- ui/litellm-dashboard/src/i18n/locales/en.json | 134 ++++++++++++++++++ .../src/utils/promptCacheUsage.ts | 8 +- 25 files changed, 411 insertions(+), 201 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EndpointUsage/components/EndpointUsageBarChart.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EndpointUsage/components/EndpointUsageBarChart.tsx index 687571e70be..198d501ba41 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EndpointUsage/components/EndpointUsageBarChart.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EndpointUsage/components/EndpointUsageBarChart.tsx @@ -1,4 +1,5 @@ import React from "react"; +import type { ParseKeys } from "i18next"; import { useTranslation } from "react-i18next"; import { ChartColumnStacked } from "lucide-react"; import { BarChart, CustomTooltip } from "@/components/shared/charts"; @@ -12,6 +13,10 @@ interface EndpointUsageBarChartProps { const SUCCESS_COLOR = "#2b3fd6"; const FAILED_COLOR = "#ef4444"; const CATEGORIES = ["Successful", "Failed"] as const; +const CATEGORY_LABELS: Record<(typeof CATEGORIES)[number], ParseKeys> = { + Successful: "usage.endpointUsage.barChart.successful", + Failed: "usage.endpointUsage.barChart.failed", +}; const COLORS = [SUCCESS_COLOR, FAILED_COLOR] as const; const valueFormatter = (value: number) => value.toLocaleString(); @@ -45,7 +50,7 @@ const EndpointUsageBarChart: React.FC = ({ endpointD {CATEGORIES.map((category, i) => ( ))} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/EntityUsage.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/EntityUsage.tsx index 96656225b30..f12f59f9c28 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/EntityUsage.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/EntityUsage.tsx @@ -7,6 +7,7 @@ import { buildSummaryTiles, hasFlatCost, hasPtuHours, + SUMMARY_TILE_LABELS, type SummaryTile, } from "./entityUsageSummary"; import { MoneyCell } from "@/components/shared/table_cells"; @@ -74,13 +75,13 @@ const TILE_TRENDS: Readonly> = { "Total Tokens": "tokens", }; const GRANULARITY_OPTIONS = [ - { value: "day", label: "Daily" }, - { value: "week", label: "Weekly" }, -] as const satisfies readonly { value: Granularity; label: string }[]; + { value: "day", labelKey: "usage.entityUsage.chart.granularityOptions.day" }, + { value: "week", labelKey: "usage.entityUsage.chart.granularityOptions.week" }, +] as const satisfies readonly { value: Granularity; labelKey: ParseKeys }[]; const SCALE_OPTIONS = [ - { value: "linear", label: "Linear" }, - { value: "log", label: "Log" }, -] as const satisfies readonly { value: StackedUsageScale; label: string }[]; + { value: "linear", labelKey: "usage.entityUsage.chart.scaleOptions.linear" }, + { value: "log", labelKey: "usage.entityUsage.chart.scaleOptions.log" }, +] as const satisfies readonly { value: StackedUsageScale; labelKey: ParseKeys }[]; const QUIET_HEADER = { headerClassName: "font-normal" }; const FLAT_COST_KEY = "flat_cost"; @@ -433,7 +434,7 @@ const EntityUsage: React.FC = ({ const tileLabel = ({ title, tooltip, expandable }: SummaryTile) => ( <> - {title} + {Object.hasOwn(SUMMARY_TILE_LABELS, title) ? t(SUMMARY_TILE_LABELS[title]) : title} {tooltip ? ( } /> @@ -540,13 +541,13 @@ const EntityUsage: React.FC = ({ ({ value, label: t(labelKey) }))} onChange={setGranularity} /> ({ value, label: t(labelKey) }))} onChange={setScale} /> diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/TopModelView.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/TopModelView.tsx index ae98dd835b5..c8e42c9a6aa 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/TopModelView.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/TopModelView.tsx @@ -2,6 +2,7 @@ import { BarChart } from "@/components/shared/charts"; import { DataTable } from "@/components/shared/DataTable"; import { MoneyCell } from "@/components/shared/table_cells"; import { ProviderLogo } from "@/components/molecules/models/ProviderLogo"; +import type { ParseKeys } from "i18next"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { formatNumberWithCommas } from "@/utils/dataUtils"; @@ -28,9 +29,9 @@ type ViewMode = "chart" | "table"; const LIMIT_OPTIONS = TOP_MODEL_LIMITS.map((limit) => ({ value: String(limit), label: String(limit) })); const VIEW_OPTIONS = [ - { value: "table", label: "Table View" }, - { value: "chart", label: "Chart View" }, -] as const satisfies readonly { value: ViewMode; label: string }[]; + { value: "table", labelKey: "usage.topModelView.viewOptions.table" }, + { value: "chart", labelKey: "usage.topModelView.viewOptions.chart" }, +] as const satisfies readonly { value: ViewMode; labelKey: ParseKeys }[]; const BAR_COLOR = "#2b3fd6"; const QUIET_HEADER = { headerClassName: "font-normal" }; @@ -100,7 +101,7 @@ export default function TopModelView({ topModels, topModelsLimit, setTopModelsLi ({ value, label: t(labelKey) }))} onChange={setModelViewMode} /> diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/entityUsageSummary.ts b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/entityUsageSummary.ts index 60084f7ef66..bf7c272347e 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/entityUsageSummary.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/EntityUsage/entityUsageSummary.ts @@ -20,6 +20,18 @@ interface SpendSummaryMetadata { total_tokens: number; } +export const SUMMARY_TILE_LABELS: Readonly> = { + "PTU Hours": "usage.entitySummary.titles.ptuHours", + "Total Cost": "usage.entitySummary.titles.totalCost", + "Total Spend": "usage.entitySummary.titles.totalSpend", + "Total Requests": "usage.entitySummary.titles.totalRequests", + "Successful Requests": "usage.entitySummary.titles.successfulRequests", + "Failed Requests": "usage.entitySummary.titles.failedRequests", + "Total Tokens": "usage.entitySummary.titles.totalTokens", + "Request Cost": "usage.entitySummary.titles.requestCost", + "Flat Cost": "usage.entitySummary.titles.flatCost", +}; + export const TOTAL_COST_TOOLTIP: ParseKeys = "usage.entitySummary.tooltips.totalCost"; export const REQUEST_COST_TOOLTIP: ParseKeys = "usage.entitySummary.tooltips.requestCost"; diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/ErrorsTab.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/ErrorsTab.tsx index 8f1cc80a81d..8f62e941a73 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/ErrorsTab.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/ErrorsTab.tsx @@ -35,7 +35,7 @@ interface ErrorsTabProps { userScoped?: boolean; } -const ENTITY_OPTIONS = ERROR_ENTITY_KINDS.map((kind) => ({ value: kind, label: ERROR_ENTITY_LABEL[kind].plural })); +const ENTITY_OPTIONS = ERROR_ENTITY_KINDS.map((kind) => ({ value: kind, labelKey: ERROR_ENTITY_LABEL[kind].plural })); const shortDate = (iso: string): string => new Date(`${iso}T00:00:00`).toLocaleDateString(undefined, { month: "short", day: "numeric" }); @@ -187,7 +187,7 @@ export default function ErrorsTab({ activity, loading, failed, userScoped = fals ({ value, label: t(labelKey) }))} onChange={setRateView} /> } @@ -280,7 +280,7 @@ export default function ErrorsTab({ activity, loading, failed, userScoped = fals ({ value, label: t(labelKey) }))} onChange={setKind} /> } @@ -290,14 +290,14 @@ export default function ErrorsTab({ activity, loading, failed, userScoped = fals height="h-48" empty={ rows.length === 0 - ? t("usage.errors.entities.empty", { entities: ERROR_ENTITY_LABEL[kind].plural.toLowerCase() }) + ? t("usage.errors.entities.empty", { entities: t(ERROR_ENTITY_LABEL[kind].plural).toLowerCase() }) : null } > - +
- {ERROR_ENTITY_LABEL[kind].singular} + {t(ERROR_ENTITY_LABEL[kind].singular)} {t("usage.errors.entities.columns.requests")} {t("usage.errors.entities.columns.failed")} {t("usage.errors.entities.columns.errorRate")} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/errorsData.ts b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/errorsData.ts index c45524b2add..66b69eacaff 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/errorsData.ts +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/errors/errorsData.ts @@ -33,11 +33,11 @@ export interface RequestErrorActivity { export const ERROR_ENTITY_KINDS = ["key", "team", "user", "model"] as const; export type ErrorEntityKind = (typeof ERROR_ENTITY_KINDS)[number]; -export const ERROR_ENTITY_LABEL: Record = { - key: { singular: "Virtual key", plural: "Virtual keys" }, - team: { singular: "Team", plural: "Teams" }, - user: { singular: "User", plural: "Users" }, - model: { singular: "Model", plural: "Models" }, +export const ERROR_ENTITY_LABEL: Record = { + key: { singular: "usage.errors.entityLabels.key.singular", plural: "usage.errors.entityLabels.key.plural" }, + team: { singular: "usage.errors.entityLabels.team.singular", plural: "usage.errors.entityLabels.team.plural" }, + user: { singular: "usage.errors.entityLabels.user.singular", plural: "usage.errors.entityLabels.user.plural" }, + model: { singular: "usage.errors.entityLabels.model.singular", plural: "usage.errors.entityLabels.model.plural" }, }; const STATUS_LABELS: Record = { @@ -153,9 +153,9 @@ export const errorSeries = (activity: RequestErrorActivity): ErrorSeries => { export type ErrorRateView = "total" | "status"; -export const ERROR_RATE_VIEW_OPTIONS: readonly { value: ErrorRateView; label: string }[] = [ - { value: "total", label: "Total" }, - { value: "status", label: "By status code" }, +export const ERROR_RATE_VIEW_OPTIONS: readonly { value: ErrorRateView; labelKey: ParseKeys }[] = [ + { value: "total", labelKey: "usage.errors.rateViews.total" }, + { value: "status", labelKey: "usage.errors.rateViews.status" }, ]; export const rateByStatusRows = (series: ErrorSeries): ErrorSeriesRow[] => diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/BreakdownChart.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/BreakdownChart.tsx index f0a346dc8da..79c64e6079b 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/BreakdownChart.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/BreakdownChart.tsx @@ -1,6 +1,7 @@ "use client"; import React, { useMemo } from "react"; +import type { ParseKeys } from "i18next"; import { useTranslation } from "react-i18next"; import { ArrowDownRight, ArrowUpRight } from "lucide-react"; import { ProviderLogo } from "@/components/molecules/models/ProviderLogo"; @@ -22,16 +23,16 @@ import { Segmented } from "./Primitives"; import { providerForModel } from "./modelProvider"; const METRIC_OPTIONS = [ - { value: "spend", label: "Spend" }, - { value: "tokens", label: "Tokens" }, - { value: "requests", label: "Requests" }, -] as const satisfies readonly { value: UsageMetric; label: string }[]; + { value: "spend", labelKey: "usage.breakdown.metricOptions.spend" }, + { value: "tokens", labelKey: "usage.breakdown.metricOptions.tokens" }, + { value: "requests", labelKey: "usage.breakdown.metricOptions.requests" }, +] as const satisfies readonly { value: UsageMetric; labelKey: ParseKeys }[]; const DIMENSION_OPTIONS = [ - { value: "model_groups", label: "Model" }, - { value: "models", label: "Deployment" }, - { value: "providers", label: "Provider" }, -] as const satisfies readonly { value: BreakdownDimension; label: string }[]; + { value: "model_groups", labelKey: "usage.breakdown.dimensionOptions.modelGroups" }, + { value: "models", labelKey: "usage.breakdown.dimensionOptions.models" }, + { value: "providers", labelKey: "usage.breakdown.dimensionOptions.providers" }, +] as const satisfies readonly { value: BreakdownDimension; labelKey: ParseKeys }[]; export interface BreakdownState { metric: UsageMetric; @@ -67,14 +68,14 @@ export function BreakdownControls({ ({ value, label: t(labelKey) }))} onChange={(metric) => onChange({ ...state, metric })} /> {showDimension && ( ({ value, label: t(labelKey) }))} onChange={(dimension) => onChange({ ...state, dimension })} /> )} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/TopAgents.tsx b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/TopAgents.tsx index 68ed202a8dc..d5d69216523 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/TopAgents.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/usage/_components/components/overview/TopAgents.tsx @@ -2,6 +2,7 @@ import { useTerminology } from "@/contexts/TerminologyContext"; import React, { useMemo, useState } from "react"; +import type { ParseKeys } from "i18next"; import { useTranslation } from "react-i18next"; import { ArrowRight, Bot, Monitor, Terminal } from "lucide-react"; import { StackedUsageChart } from "@/components/shared/charts"; @@ -18,17 +19,17 @@ import { type UsageMetric, } from "./overviewData"; import { ChartSkeleton, Panel, PANEL_INSET_X, Segmented } from "./Primitives"; -import { agentDailyData, topAgents, type AgentRow, type TagSummaryRow } from "./agentCatalog"; +import { agentDailyData, agentDisplayLabel, topAgents, type AgentRow, type TagSummaryRow } from "./agentCatalog"; const ROWS = 10; const CHART_SERIES = 6; /** Below this share of tokens carrying a User-Agent, say so rather than imply the list is the whole picture. */ const COVERAGE_NOTE_BELOW = 0.5; const METRICS = [ - { value: "tokens", label: "Tokens" }, - { value: "spend", label: "Spend" }, - { value: "requests", label: "Requests" }, -] as const satisfies readonly { value: UsageMetric; label: string }[]; + { value: "tokens", labelKey: "usage.topAgents.metricOptions.tokens" }, + { value: "spend", labelKey: "usage.topAgents.metricOptions.spend" }, + { value: "requests", labelKey: "usage.topAgents.metricOptions.requests" }, +] as const satisfies readonly { value: UsageMetric; labelKey: ParseKeys }[]; /** Brand-tinted monograms for runtimes that have no logo file, so a top spender never shows a blank tile. */ const MONOGRAMS: Readonly> = { @@ -42,7 +43,9 @@ const CLIENT_SURFACES: Readonly>> = { }; function AgentGlyph({ agent }: { agent: Pick }) { - if (agent.logo) return ; + const { t } = useTranslation(); + const label = agentDisplayLabel(agent.label, t); + if (agent.logo) return ; const monogram = MONOGRAMS[agent.id]; if (monogram) { return ( @@ -56,7 +59,7 @@ function AgentGlyph({ agent }: { agent: Pick ); } - return {agent.label.charAt(0)}; + return {label.charAt(0)}; } export function AgentMark({ agent }: { agent: Pick }) { @@ -103,7 +106,7 @@ function AgentItem({ )} - {agent.label} + {agentDisplayLabel(agent.label, t)} {openRow ? ( {t("usage.topAgents.viewActivity")} @@ -130,7 +133,7 @@ function AgentItem({ {openRow ? ( ))}
diff --git a/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx index f444d21d6e8..26f84386c0c 100644 --- a/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsFilters.tsx @@ -1,5 +1,6 @@ "use client"; +import type { ParseKeys } from "i18next"; import { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -27,30 +28,35 @@ import { LOG_FILTER_IDS, type LogsWindow } from "./useLogFilterLogic"; const ALL_VALUE = "all"; -const STATUS_FILTER_ITEMS = [ - { value: ALL_VALUE, label: "All Statuses" }, - { value: "success", label: "Success" }, - { value: "failure", label: "Failure" }, -] as const; +interface FilterItem { + value: string; + labelKey: ParseKeys; +} -const CACHE_FILTER_ITEMS = [ - { value: ALL_VALUE, label: "All Requests" }, - { value: "hit", label: "Cache Hit" }, - { value: "miss", label: "Cache Miss" }, -] as const; +const STATUS_FILTER_ITEMS: readonly FilterItem[] = [ + { value: ALL_VALUE, labelKey: "logs.request.filters.allStatuses" }, + { value: "success", labelKey: "logs.request.filters.statusOptions.success" }, + { value: "failure", labelKey: "logs.request.filters.statusOptions.failure" }, +]; -const CREDENTIAL_FILTER_ITEMS = [ - { value: ALL_VALUE, label: "All Credentials" }, - ...Object.entries(CREDENTIAL_LABELS).map(([value, label]) => ({ value, label })), -] as const; +const CACHE_FILTER_ITEMS: readonly FilterItem[] = [ + { value: ALL_VALUE, labelKey: "logs.request.filters.allRequests" }, + { value: "hit", labelKey: "logs.request.filters.cacheOptions.hit" }, + { value: "miss", labelKey: "logs.request.filters.cacheOptions.miss" }, +]; -const SPAN_TYPE_FILTER_ITEMS = [ - { value: ALL_VALUE, label: "All Types" }, - { value: "llm", label: "LLM" }, - { value: "agent", label: "Agent" }, - { value: "mcp", label: "MCP" }, - { value: "batch", label: "Batch" }, -] as const; +const CREDENTIAL_FILTER_ITEMS: readonly FilterItem[] = [ + { value: ALL_VALUE, labelKey: "logs.request.filters.allCredentials" }, + ...Object.entries(CREDENTIAL_LABELS).map(([value, labelKey]) => ({ value, labelKey })), +]; + +const SPAN_TYPE_FILTER_ITEMS: readonly FilterItem[] = [ + { value: ALL_VALUE, labelKey: "logs.request.filters.allTypes" }, + { value: "llm", labelKey: "logs.common.spanTypes.llm" }, + { value: "agent", labelKey: "logs.common.spanTypes.agent" }, + { value: "mcp", labelKey: "logs.common.spanTypes.mcp" }, + { value: "batch", labelKey: "logs.common.spanTypes.batch" }, +]; const PAGE_SIZE = 50; const SEARCH_INPUT_REASONS: ReadonlySet = new Set(["input-change", "input-clear", "clear-press"]); @@ -278,21 +284,26 @@ function ErrorCodeFilterField({ value, onChange }: { value: string; onChange: (v const { t } = useTranslation(); const [query, setQuery] = useState(""); + const errorCodeOptions = useMemo( + () => ERROR_CODE_OPTIONS.map(({ labelKey, value: code }) => ({ label: t(labelKey), value: code })), + [t], + ); + const options = useMemo(() => { const trimmed = query.trim(); const lowered = trimmed.toLowerCase(); - const matches = ERROR_CODE_OPTIONS.filter((option) => option.label.toLowerCase().includes(lowered)); - const isKnownCode = ERROR_CODE_OPTIONS.some( + const matches = errorCodeOptions.filter((option) => option.label.toLowerCase().includes(lowered)); + const isKnownCode = errorCodeOptions.some( (option) => option.value === trimmed || option.label.toLowerCase() === lowered, ); if (trimmed === "" || isKnownCode) return matches; return [...matches, { label: t("logs.request.filters.customErrorCode", { code: trimmed }), value: trimmed }]; - }, [query, t]); + }, [query, t, errorCodeOptions]); const selected = useMemo(() => { if (value === "") return null; - return ERROR_CODE_OPTIONS.find((option) => option.value === value) ?? { label: value, value }; - }, [value]); + return errorCodeOptions.find((option) => option.value === value) ?? { label: value, value }; + }, [value, errorCodeOptions]); const items = useMemo(() => { if (selected === null) return options; @@ -346,6 +357,11 @@ export function RequestLogsFilters({ get, set, teams, logsWindow }: RequestLogsF const { t } = useTranslation(); const valueOf = (id: string): string => asString(get(id)); const setter = (id: string) => (next: string | undefined) => set(id, next); + const withLabel = ({ value, labelKey }: FilterItem) => ({ value, label: t(labelKey) }); + const spanTypeItems = SPAN_TYPE_FILTER_ITEMS.map(withLabel); + const statusItems = STATUS_FILTER_ITEMS.map(withLabel); + const cacheItems = CACHE_FILTER_ITEMS.map(withLabel); + const credentialItems = CREDENTIAL_FILTER_ITEMS.map(withLabel); return ( <> @@ -357,7 +373,7 @@ export function RequestLogsFilters({ get, set, teams, logsWindow }: RequestLogsF set(LOG_FILTER_IDS.STATUS, next === null || next === ALL_VALUE ? undefined : next)} > @@ -386,7 +402,7 @@ export function RequestLogsFilters({ get, set, teams, logsWindow }: RequestLogsF - {STATUS_FILTER_ITEMS.map((item) => ( + {statusItems.map((item) => ( {item.label} @@ -397,7 +413,7 @@ export function RequestLogsFilters({ get, set, teams, logsWindow }: RequestLogsF set(LOG_FILTER_IDS.CREDENTIAL, next === null || next === ALL_VALUE ? undefined : next) @@ -428,7 +444,7 @@ export function RequestLogsFilters({ get, set, teams, logsWindow }: RequestLogsF - {CREDENTIAL_FILTER_ITEMS.map((item) => ( + {credentialItems.map((item) => ( {item.label} diff --git a/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx index 31b494448c2..01314fe3221 100644 --- a/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx +++ b/ui/litellm-dashboard/src/components/logs/request/RequestLogsTable.tsx @@ -1,6 +1,7 @@ "use client"; import type { ColumnFiltersState, OnChangeFn, PaginationState, SortingState } from "@tanstack/react-table"; +import type { TFunction } from "i18next"; import { ScrollText } from "lucide-react"; import { useMemo, useState, type ReactNode } from "react"; import { useTranslation } from "react-i18next"; @@ -39,12 +40,12 @@ interface RequestLogsTableProps { toolbarChildren?: ReactNode; } -const formatFilterValue = (columnId: string, value: unknown): string => { +const formatFilterValue = (columnId: string, value: unknown, t: TFunction): string => { if (columnId === LOG_FILTER_IDS.SPAN_TYPE) { - return SPAN_TYPE_LABELS[String(value)] ?? String(value); + return Object.hasOwn(SPAN_TYPE_LABELS, String(value)) ? t(SPAN_TYPE_LABELS[String(value)]) : String(value); } if (columnId === LOG_FILTER_IDS.CREDENTIAL) { - return CREDENTIAL_LABELS[String(value)] ?? String(value); + return Object.hasOwn(CREDENTIAL_LABELS, String(value)) ? t(CREDENTIAL_LABELS[String(value)]) : String(value); } return Array.isArray(value) ? value.join(", ") : String(value); }; @@ -100,6 +101,11 @@ export function RequestLogsTable({ return getRequestLogsTableColumns({ onKeyHashClick, onSessionClick, resolveUserEmail }, t); }, [onKeyHashClick, onSessionClick, emailByUserId, t]); + const filterLabels = useMemo( + () => Object.fromEntries(Object.entries(LOG_FILTER_LABELS).map(([id, labelKey]) => [id, t(labelKey)])), + [t], + ); + const isFiltered = columnFilters.length > 0 || searchValue !== ""; return ( @@ -136,8 +142,8 @@ export function RequestLogsTable({ onRefresh={onRefresh} isRefreshing={isRefreshing} onOpenFilters={() => setFiltersOpen(true)} - filterLabels={LOG_FILTER_LABELS} - formatFilterValue={formatFilterValue} + filterLabels={filterLabels} + formatFilterValue={(columnId, value) => formatFilterValue(columnId, value, t)} showViewOptions={false} > {toolbarChildren} diff --git a/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts index 17d7eb4b860..f50780539ac 100644 --- a/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts +++ b/ui/litellm-dashboard/src/components/logs/request/useLogFilterLogic.ts @@ -1,4 +1,5 @@ import moment from "moment"; +import type { ParseKeys } from "i18next"; import { keepPreviousData, useQuery, type UseQueryOptions } from "@tanstack/react-query"; import type { ColumnFiltersState, PaginationState, SortingState } from "@tanstack/react-table"; import { uiSpendLogsCall } from "../../networking"; @@ -38,22 +39,22 @@ export const LOG_FILTER_IDS = { SEARCH: "search", } as const; -export const LOG_FILTER_LABELS: Record = { - [LOG_FILTER_IDS.TEAM_ID]: "Team ID", - [LOG_FILTER_IDS.SPAN_TYPE]: "Span Type", - [LOG_FILTER_IDS.STATUS]: "Status", - [LOG_FILTER_IDS.CACHE_STATUS]: "Cache", - [LOG_FILTER_IDS.CREDENTIAL]: "Credential", - [LOG_FILTER_IDS.KEY_ALIAS]: "Key Alias", - [LOG_FILTER_IDS.USER_ID]: "User ID", - [LOG_FILTER_IDS.END_USER]: "End User", - [LOG_FILTER_IDS.ERROR_CODE]: "Error Code", - [LOG_FILTER_IDS.ERROR_MESSAGE]: "Error Message", - [LOG_FILTER_IDS.KEY_HASH]: "Key Hash", - [LOG_FILTER_IDS.SESSION_ID]: "Session ID", - [LOG_FILTER_IDS.MODEL_ID]: "Model", - [LOG_FILTER_IDS.PUBLIC_MODEL_OR_SEARCH_TOOL]: "Public model / search tool", - [LOG_FILTER_IDS.SEARCH]: "Search", +export const LOG_FILTER_LABELS: Record = { + [LOG_FILTER_IDS.TEAM_ID]: "logs.request.filters.teamId", + [LOG_FILTER_IDS.SPAN_TYPE]: "logs.request.filters.spanType", + [LOG_FILTER_IDS.STATUS]: "logs.request.filters.status", + [LOG_FILTER_IDS.CACHE_STATUS]: "logs.request.filters.cache", + [LOG_FILTER_IDS.CREDENTIAL]: "logs.request.filters.credential", + [LOG_FILTER_IDS.KEY_ALIAS]: "logs.request.filters.keyAlias", + [LOG_FILTER_IDS.USER_ID]: "logs.request.filters.userId", + [LOG_FILTER_IDS.END_USER]: "logs.request.filters.endUser", + [LOG_FILTER_IDS.ERROR_CODE]: "logs.request.filters.errorCode", + [LOG_FILTER_IDS.ERROR_MESSAGE]: "logs.request.filters.errorMessage", + [LOG_FILTER_IDS.KEY_HASH]: "logs.request.filters.keyHash", + [LOG_FILTER_IDS.SESSION_ID]: "logs.request.filters.sessionId", + [LOG_FILTER_IDS.MODEL_ID]: "logs.request.filters.model", + [LOG_FILTER_IDS.PUBLIC_MODEL_OR_SEARCH_TOOL]: "logs.request.filters.publicModelOrSearchTool", + [LOG_FILTER_IDS.SEARCH]: "logs.request.filters.search", }; export interface LogsWindow { diff --git a/ui/litellm-dashboard/src/components/user_agent_activity.tsx b/ui/litellm-dashboard/src/components/user_agent_activity.tsx index 27e9f7373dc..6904d6b323d 100644 --- a/ui/litellm-dashboard/src/components/user_agent_activity.tsx +++ b/ui/litellm-dashboard/src/components/user_agent_activity.tsx @@ -1,3 +1,4 @@ +import type { ParseKeys } from "i18next"; import React, { useState, useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Bot, Users } from "lucide-react"; @@ -25,9 +26,9 @@ type ActivityView = "active-users" | "per-user"; type ActivePeriod = "dau" | "wau" | "mau"; const VIEW_OPTIONS = [ - { value: "active-users", label: "Active users" }, - { value: "per-user", label: "Per user" }, -] as const satisfies readonly { value: ActivityView; label: string }[]; + { value: "active-users", labelKey: "usage.userAgentActivity.viewOptions.activeUsers" }, + { value: "per-user", labelKey: "usage.userAgentActivity.viewOptions.perUser" }, +] as const satisfies readonly { value: ActivityView; labelKey: ParseKeys }[]; const PERIOD_OPTIONS = [ { value: "dau", label: "DAU" }, @@ -576,7 +577,7 @@ const UserAgentActivity: React.FC = ({ ({ value, label: t(labelKey) }))} onChange={setActivityView} /> diff --git a/ui/litellm-dashboard/src/i18n/locales/en.json b/ui/litellm-dashboard/src/i18n/locales/en.json index f9a7882b2de..2f61c51d819 100644 --- a/ui/litellm-dashboard/src/i18n/locales/en.json +++ b/ui/litellm-dashboard/src/i18n/locales/en.json @@ -12972,6 +12972,37 @@ }, "logs": { "common": { + "errorCodes": { + "badRequest": "400 - Bad Request", + "invalidAuthentication": "401 - Invalid Authentication", + "permissionDenied": "403 - Permission Denied", + "notFound": "404 - Not Found", + "requestTimeout": "408 - Request Timeout", + "unprocessableEntity": "422 - Unprocessable Entity", + "rateLimited": "429 - Rate Limited", + "internalServerError": "500 - Internal Server Error", + "badGateway": "502 - Bad Gateway", + "serviceUnavailable": "503 - Service Unavailable", + "overloaded": "529 - Overloaded" + }, + "spanTypes": { + "llm": "LLM", + "agent": "Agent", + "mcp": "MCP", + "batch": "Batch" + }, + "credentials": { + "clientOauthToken": "Client OAuth token", + "configuredKey": "Configured key" + }, + "quickSelect": { + "lastMinute": "Last Minute", + "last15Minutes": "Last 15 Minutes", + "lastHour": "Last Hour", + "last4Hours": "Last 4 Hours", + "last24Hours": "Last 24 Hours", + "last7Days": "Last 7 Days" + }, "podRouting": { "roundRobin": "Round robin", "sessionAffinity": "Session affinity", @@ -13377,6 +13408,7 @@ "note": "Note: This will only affect new requests after the configuration change." }, "tools": { + "fallbackName": "Tool {{index}}", "title": "Tools", "summary": "{{provided}} provided, {{called}} called", "called": "called", @@ -13509,6 +13541,15 @@ "filtersDescription": "Narrow down request logs" }, "filters": { + "search": "Search", + "statusOptions": { + "success": "Success", + "failure": "Failure" + }, + "cacheOptions": { + "hit": "Cache Hit", + "miss": "Cache Miss" + }, "teamId": "Team ID", "teamPlaceholder": "Search or select a team", "noTeams": "No teams found", @@ -13589,6 +13630,13 @@ } }, "audit": { + "actionOptions": { + "created": "Created", + "updated": "Updated", + "deleted": "Deleted", + "rotated": "Rotated", + "killSwitchFired": "Kill switch fired" + }, "panel": { "enterpriseTitle": "✨ Enterprise Feature.", "enterpriseDescription": "This is a LiteLLM Enterprise feature, and requires a valid key to use.", @@ -13973,6 +14021,14 @@ "weekOf": "Wk of {{date}}" }, "breakdownChart": { + "granularityOptions": { + "day": "Daily", + "week": "Weekly" + }, + "scaleOptions": { + "linear": "Linear", + "log": "Log" + }, "metricNoun": { "spend": "spend", "tokens": "tokens", @@ -13990,12 +14046,27 @@ "loadingTopModels": "Loading top models" }, "breakdown": { + "metricOptions": { + "spend": "Spend", + "tokens": "Tokens", + "requests": "Requests" + }, + "dimensionOptions": { + "modelGroups": "Model", + "models": "Deployment", + "providers": "Provider" + }, "metricLabel": "Metric", "groupByLabel": "Group by", "empty": "No usage in this range", "byProvider": "by {{provider}}" }, "topAgents": { + "metricOptions": { + "tokens": "Tokens", + "spend": "Spend", + "requests": "Requests" + }, "viewActivity": "View activity", "tokens": "{{tokens}} tokens", "viewAgentUsage": "View {{agent}} usage", @@ -14006,6 +14077,9 @@ "metricLabel": "Agent metric" }, "agentCatalog": { + "labels": { + "claudeUnspecified": "Claude (unspecified)" + }, "descriptions": { "claudeDesktop": "Anthropic's desktop assistant", "claudeCode": "Anthropic's coding agent", @@ -14033,6 +14107,28 @@ } }, "errors": { + "entityLabels": { + "key": { + "singular": "Virtual key", + "plural": "Virtual keys" + }, + "team": { + "singular": "Team", + "plural": "Teams" + }, + "user": { + "singular": "User", + "plural": "Users" + }, + "model": { + "singular": "Model", + "plural": "Models" + } + }, + "rateViews": { + "total": "Total", + "status": "By status code" + }, "entities": { "title": "Failures by identity", "subtitle": "Keys, teams, users and models ranked by failed requests", @@ -14165,6 +14261,17 @@ } }, "entitySummary": { + "titles": { + "ptuHours": "PTU Hours", + "totalCost": "Total Cost", + "totalSpend": "Total Spend", + "totalRequests": "Total Requests", + "successfulRequests": "Successful Requests", + "failedRequests": "Failed Requests", + "totalTokens": "Total Tokens", + "requestCost": "Request Cost", + "flatCost": "Flat Cost" + }, "tooltips": { "totalCost": "Request cost plus flat cost for reserved capacity. Select this tile to see the breakdown.", "requestCost": "Usage-based cost of the requests this entity sent during the selected period, priced per token.", @@ -14174,6 +14281,14 @@ }, "entityUsage": { "chart": { + "granularityOptions": { + "day": "Daily", + "week": "Weekly" + }, + "scaleOptions": { + "linear": "Linear", + "log": "Log" + }, "flatCostSeries": "Flat cost", "metricTitle": { "spend": "Spend", @@ -14259,6 +14374,10 @@ "noUser": "(no user)" }, "topModelView": { + "viewOptions": { + "table": "Table View", + "chart": "Chart View" + }, "columns": { "model": "Model", "spendUsd": "Spend (USD)", @@ -14286,6 +14405,8 @@ "noData": "No endpoint usage data" }, "barChart": { + "successful": "Successful", + "failed": "Failed", "title": "Success vs Failed Requests by Endpoint" }, "lineChart": { @@ -14296,6 +14417,7 @@ "unknownModel": "Unknown model", "unknownProvider": "Unknown provider", "errors": { + "narrowRange": "Narrow the date range to fewer than 1,000 requests to see complete client usage", "selectUserOrTeam": "Select a user or team to view client usage", "incompleteData": "The proxy returned incomplete client usage data", "outsideUser": "The proxy returned usage outside the selected user", @@ -14361,6 +14483,10 @@ "loadMoreFailed": "Could not load more keys." }, "topKeys": { + "viewOptions": { + "table": "Table View", + "chart": "Chart View" + }, "keyNotInDatabase": "This key is no longer in the database (deleted, or a CLI/SSO session key), so its details can't be opened", "columns": { "keyId": "Key ID", @@ -14554,6 +14680,10 @@ } }, "userAgentActivity": { + "viewOptions": { + "activeUsers": "Active users", + "perUser": "Per user" + }, "noActiveUsers": "No active users in this period", "weekLabel": "Week {{number}}", "monthLabel": "Month {{number}}", @@ -14695,6 +14825,10 @@ } } }, + "promptCacheUsage": { + "readTooltip": "Input tokens read from the LLM provider's prompt cache (e.g. Anthropic / OpenAI), billed at a discounted rate. Reported by the provider.", + "creationTooltip": "Input tokens written to the LLM provider's prompt cache for reuse by later requests." + }, "organizations": { "view": { "loading": "Loading...", diff --git a/ui/litellm-dashboard/src/utils/promptCacheUsage.ts b/ui/litellm-dashboard/src/utils/promptCacheUsage.ts index f7c25d43e5f..9209e60485c 100644 --- a/ui/litellm-dashboard/src/utils/promptCacheUsage.ts +++ b/ui/litellm-dashboard/src/utils/promptCacheUsage.ts @@ -1,7 +1,7 @@ -export const PROMPT_CACHE_READ_TOOLTIP = - "Input tokens read from the LLM provider's prompt cache (e.g. Anthropic / OpenAI), billed at a discounted rate. Reported by the provider."; -export const PROMPT_CACHE_CREATION_TOOLTIP = - "Input tokens written to the LLM provider's prompt cache for reuse by later requests."; +import type { ParseKeys } from "i18next"; + +export const PROMPT_CACHE_READ_TOOLTIP: ParseKeys = "promptCacheUsage.readTooltip"; +export const PROMPT_CACHE_CREATION_TOOLTIP: ParseKeys = "promptCacheUsage.creationTooltip"; interface CachedTokenDetails { cached_tokens?: number | null; From 625353fabe24a7c3bafc76bd7f7258309118e6f4 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Thu, 5 Nov 2026 12:42:26 -0800 Subject: [PATCH 08/37] refactor(ui): move remaining models text onto i18n (#50147) * refactor(ui): move remaining models text onto i18n Moves the leftover English on the models pages, mostly labels and hints held in constants, onto react-i18next. Constants now hold message keys and the code that renders them translates. Where a string is both a value and a label (tier names, health check sentinels), the English value stays for comparisons, sorting and payloads, and a separate label key drives display. Lookups keyed by server values check Object.hasOwn first. * refactor(ui): translate the tier name in display name inputs --- .../_components/TierTurnsChart.tsx | 13 +- .../components/AllModelsTable.tsx | 12 +- .../components/AutoRouters/autoRouterRows.ts | 30 +-- .../src/components/ModelInfoEditForm.tsx | 4 +- .../src/components/add_model/AddModelForm.tsx | 4 +- .../add_model/AutoRouterSimpleSetup.tsx | 2 +- .../add_model/ClassificationMethodConfig.tsx | 12 +- .../add_model/ComplexityRouterConfig.tsx | 74 +++--- .../add_model/CompressionControls.tsx | 5 +- .../add_model/CustomDimensionRows.tsx | 8 +- .../add_model/HeuristicScoringConfig.test.tsx | 3 +- .../add_model/OpeningPromptEditor.tsx | 10 +- .../components/add_model/TierRestrictions.tsx | 3 +- .../components/add_model/add_model_modes.tsx | 34 +-- .../add_model/advanced_settings.tsx | 10 +- .../src/components/add_model/auto_setup.ts | 8 +- .../add_model/cache_control_settings.tsx | 25 +- .../add_model/heuristic_scoring_knobs.ts | 20 +- .../add_model/provider_auth_types.ts | 24 +- .../add_model/provider_specific_fields.tsx | 6 +- .../src/components/add_model/tier_rows.ts | 24 +- .../components/model_add/CredentialModal.tsx | 11 +- .../components/model_add/FederationFields.tsx | 2 +- .../model_add/anthropic_federation.ts | 95 ++++---- .../components/model_add/federation_field.ts | 6 +- .../components/model_add/openai_federation.ts | 15 +- .../HealthChecksTableColumns.tsx | 15 +- ui/litellm-dashboard/src/i18n/locales/en.json | 217 ++++++++++++++++++ 28 files changed, 471 insertions(+), 221 deletions(-) diff --git a/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.tsx b/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.tsx index 87d689e3162..c1a89f4cdad 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/cost-optimization/_components/TierTurnsChart.tsx @@ -1,5 +1,6 @@ "use client"; +import type { TFunction } from "i18next"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -7,11 +8,12 @@ import type { AutoRouterDeployment } from "@/app/(dashboard)/hooks/models/useMod import { hydrateTierLabels } from "@/components/add_model/build_complexity_router_config"; import { TIER_KEYS, - effectiveTierLabel, + effectiveTierDisplayLabel, type ComplexityTierLabels, type ComplexityTiers, } from "@/components/add_model/ComplexityRouterConfig"; import { normalizeTierModels } from "@/components/add_model/complexity_router_tiers"; +import i18n from "@/i18n/i18n"; import { chartColorValue, DEFAULT_COLOR_CYCLE, DonutChart } from "@/components/shared/charts"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; @@ -35,8 +37,11 @@ const asRecord = (value: unknown): Record => { const isComplexityTier = (tier: string): tier is keyof ComplexityTiers => (TIER_KEYS as readonly string[]).includes(tier); -export const tierDisplayLabel = (tier: string, tierLabels: ComplexityTierLabels | undefined): string => - isComplexityTier(tier) ? effectiveTierLabel(tier, tierLabels) : tier; +export const tierDisplayLabel = ( + tier: string, + tierLabels: ComplexityTierLabels | undefined, + t: TFunction = i18n.t.bind(i18n), +): string => (isComplexityTier(tier) ? effectiveTierDisplayLabel(tier, tierLabels, t) : tier); const CONFIG_KEY_BY_ROUTER_TYPE: Record> = { complexity: "complexity_router_config", @@ -93,7 +98,7 @@ const TierTurnsChart: React.FC = ({ view, autoRouters }) => const tierLabels = tierLabelsFor(group.router_name, group.router_type, autoRouters); const total = entries.reduce((sum, [, turns]) => sum + turns, 0); const slices = entries.map(([tier, turns]) => ({ - tier: tierDisplayLabel(tier, tierLabels), + tier: tierDisplayLabel(tier, tierLabels, t), turns, models: tierModelsFor(tier, group.router_name, group.router_type, autoRouters), })); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx index 3687ef963c0..df433afd2b9 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx @@ -38,10 +38,10 @@ export const WILDCARD_MODEL_GROUP_VALUE = "wildcard"; const MODEL_TABLE_BODY_HEIGHT = 600; const ALL_PROXY_MODELS_LABEL: ParseKeys = "modelsAndEndpoints.allModelsTable.allProxyModels"; -const FILTER_LABELS: Record = { - [MODEL_NAME_COLUMN_ID]: "Public Model Name", - [ACCESS_GROUPS_COLUMN_ID]: "Model Access Group", - [ROUTING_STATUS_FILTER_ID]: "Status", +const FILTER_LABELS: Record = { + [MODEL_NAME_COLUMN_ID]: "modelsAndEndpoints.allModelsTable.filterLabels.publicModelName", + [ACCESS_GROUPS_COLUMN_ID]: "modelsAndEndpoints.allModelsTable.filterLabels.modelAccessGroup", + [ROUTING_STATUS_FILTER_ID]: "modelsAndEndpoints.allModelsTable.filterLabels.status", }; const ROUTING_STATUS_FILTER_VALUES = { @@ -241,7 +241,9 @@ export function AllModelsTable({ onOpenFilters={() => setFiltersOpen(true)} onRefresh={onRefresh} isRefreshing={isRefreshing} - filterLabels={FILTER_LABELS} + filterLabels={Object.fromEntries( + Object.entries(FILTER_LABELS).map(([columnId, labelKey]) => [columnId, t(labelKey)]), + )} formatFilterValue={formatFilterValue} > ({ value: mode.value, label: t(mode.labelKey) }))} value={(control.value as string | undefined) ?? null} onValueChange={(value: string | null) => { control.onChange(value); @@ -326,7 +326,7 @@ const AddModelForm: React.FC = ({ {TEST_MODES.map((mode) => ( - {mode.label} + {t(mode.labelKey)} ))} diff --git a/ui/litellm-dashboard/src/components/add_model/AutoRouterSimpleSetup.tsx b/ui/litellm-dashboard/src/components/add_model/AutoRouterSimpleSetup.tsx index 04ee03f7572..092bf41c444 100644 --- a/ui/litellm-dashboard/src/components/add_model/AutoRouterSimpleSetup.tsx +++ b/ui/litellm-dashboard/src/components/add_model/AutoRouterSimpleSetup.tsx @@ -83,7 +83,7 @@ export default function AutoRouterSimpleSetup({ aria-pressed={goal === key} onClick={() => onGoalChange(key as RouterGoal)} > - {label} + {t(label)} ))}
diff --git a/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx b/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx index ea70d499099..6f514785bb9 100644 --- a/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx +++ b/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx @@ -42,7 +42,7 @@ import { DEFAULT_CLASSIFIER_TIMEOUT_MS, DEFAULT_CLASSIFICATION_RUBRIC, ClassificationRubric, - effectiveTierLabel, + effectiveTierDisplayLabel, heuristicScoringRole, heuristicTuningType, usesHeuristicV2, @@ -119,25 +119,25 @@ const HowClassificationWorks: React.FC<{ value: ComplexityRouterConfigValue }> = {scorerRuns && ranges && (
  • - {effectiveTierLabel("SIMPLE", value.tier_labels)}:{" "} + {effectiveTierDisplayLabel("SIMPLE", value.tier_labels, t)}:{" "} {t("addModel.classificationMethodConfig.howItWorks.scoreBelow", { max: ranges.simpleMedium })}
  • - {effectiveTierLabel("MEDIUM", value.tier_labels)}:{" "} + {effectiveTierDisplayLabel("MEDIUM", value.tier_labels, t)}:{" "} {t("addModel.classificationMethodConfig.howItWorks.scoreBetween", { min: ranges.simpleMedium, max: ranges.mediumComplex, })}
  • - {effectiveTierLabel("COMPLEX", value.tier_labels)}:{" "} + {effectiveTierDisplayLabel("COMPLEX", value.tier_labels, t)}:{" "} {t("addModel.classificationMethodConfig.howItWorks.scoreBetween", { min: ranges.mediumComplex, max: ranges.complexReasoning, })}
  • - {effectiveTierLabel("REASONING", value.tier_labels)}:{" "} + {effectiveTierDisplayLabel("REASONING", value.tier_labels, t)}:{" "} {t("addModel.classificationMethodConfig.howItWorks.scoreAbove", { min: ranges.complexReasoning, floor: ranges.reasoningOverrideFloor, @@ -506,7 +506,7 @@ const ClassificationMethodConfig: React.FC = ({ {HEURISTIC_FIRST_MAX_TIER_KEYS.map((tier) => ( - {effectiveTierLabel(tier, value.tier_labels)} + {effectiveTierDisplayLabel(tier, value.tier_labels, t)} ))} diff --git a/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.tsx b/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.tsx index e757813783d..e99a8c6e949 100644 --- a/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.tsx +++ b/ui/litellm-dashboard/src/components/add_model/ComplexityRouterConfig.tsx @@ -104,36 +104,27 @@ export const DEFAULT_CLASSIFICATION_RUBRIC: ClassificationRubric = "legacy"; */ export const NEW_CLASSIFIER_CLASSIFICATION_RUBRIC: ClassificationRubric = "agentic"; -export const CLASSIFICATION_RUBRIC_DESCRIPTIONS: Record = - { - legacy: { - label: "Legacy (uncalibrated)", - description: - "The rubric as it shipped before calibration examples, with no worked examples at all. Routers created " + - "before this setting existed use it, so their tier decisions and spend are unchanged. It over-routes " + - "ordinary engineering to the most expensive tier.", - }, - agentic: { - label: "Agentic", - description: - "Anchors routine installs, builds, multi-file edits, and standard debugging at " + - "Medium, so ordinary engineering does not route to your most expensive tier. Suits agent, terminal, and " + - "coding-assistant traffic, and mixed traffic.", - }, - chat: { - label: "Chat", - description: - "Drops the engineering examples, for a router serving only conversational traffic that never sees those " + - "requests.", - }, - business: { - label: "Business", - description: - "Business and sales examples plus business-oriented tier definitions: routine drafting and summarizing " + - "stay at Medium, data-determined analysis is Complex, and only decisions under conflicting tradeoffs " + - "reach Reasoning. Suits sales, support, and go-to-market traffic.", - }, - }; +export const CLASSIFICATION_RUBRIC_DESCRIPTIONS: Record< + ClassificationRubric, + { labelKey: ParseKeys; descriptionKey: ParseKeys } +> = { + legacy: { + labelKey: "addModel.complexityRouterConfig.rubrics.legacy.label", + descriptionKey: "addModel.complexityRouterConfig.rubrics.legacy.description", + }, + agentic: { + labelKey: "addModel.complexityRouterConfig.rubrics.agentic.label", + descriptionKey: "addModel.complexityRouterConfig.rubrics.agentic.description", + }, + chat: { + labelKey: "addModel.complexityRouterConfig.rubrics.chat.label", + descriptionKey: "addModel.complexityRouterConfig.rubrics.chat.description", + }, + business: { + labelKey: "addModel.complexityRouterConfig.rubrics.business.label", + descriptionKey: "addModel.complexityRouterConfig.rubrics.business.description", + }, +}; export const CLASSIFICATION_RUBRIC_KEYS = Object.keys(CLASSIFICATION_RUBRIC_DESCRIPTIONS) as ClassificationRubric[]; @@ -204,7 +195,9 @@ const rowOrigin = (row: TierRow, editing: boolean, t: TFunction = i18n.t.bind(i1 : t("addModel.complexityRouterConfig.rowOrigin.custom"); }; -const builtInTierInfo = (rowId: string): { label: string; description: ParseKeys; examples: ParseKeys } | undefined => { +const builtInTierInfo = ( + rowId: string, +): { labelKey: ParseKeys; description: ParseKeys; examples: ParseKeys } | undefined => { const builtIn = ALL_BUILT_IN_TIERS.find((tier) => tier === rowId); return builtIn ? TIER_DESCRIPTIONS[builtIn] : undefined; }; @@ -531,30 +524,35 @@ interface ComplexityRouterConfigProps { export const TIER_DESCRIPTIONS: Record< keyof ComplexityTiers, - { label: string; description: ParseKeys; examples: ParseKeys } + { label: string; labelKey: ParseKeys; description: ParseKeys; examples: ParseKeys } > = { NON_REASONING: { label: "Non-reasoning", + labelKey: "addModel.complexityRouterConfig.tiers.nonReasoning.label", description: "addModel.complexityRouterConfig.tiers.nonReasoning.description", examples: "addModel.complexityRouterConfig.tiers.nonReasoning.examples", }, SIMPLE: { label: "Simple", + labelKey: "addModel.complexityRouterConfig.tiers.simple.label", description: "addModel.complexityRouterConfig.tiers.simple.description", examples: "addModel.complexityRouterConfig.tiers.simple.examples", }, MEDIUM: { label: "Medium", + labelKey: "addModel.complexityRouterConfig.tiers.medium.label", description: "addModel.complexityRouterConfig.tiers.medium.description", examples: "addModel.complexityRouterConfig.tiers.medium.examples", }, COMPLEX: { label: "Complex", + labelKey: "addModel.complexityRouterConfig.tiers.complex.label", description: "addModel.complexityRouterConfig.tiers.complex.description", examples: "addModel.complexityRouterConfig.tiers.complex.examples", }, REASONING: { label: "Reasoning", + labelKey: "addModel.complexityRouterConfig.tiers.reasoning.label", description: "addModel.complexityRouterConfig.tiers.reasoning.description", examples: "addModel.complexityRouterConfig.tiers.reasoning.examples", }, @@ -565,6 +563,12 @@ export const TIER_KEYS = Object.keys(TIER_DESCRIPTIONS) as Array tierLabels?.[tier]?.trim() || TIER_DESCRIPTIONS[tier].label; +export const effectiveTierDisplayLabel = ( + tier: keyof ComplexityTiers, + tierLabels: ComplexityTierLabels | undefined, + t: TFunction = i18n.t.bind(i18n), +): string => tierLabels?.[tier]?.trim() || t(TIER_DESCRIPTIONS[tier].labelKey); + export const DEFAULT_HEURISTIC_FIRST_MAX_TIER = "SIMPLE"; /** What the Hybrid radio starts at. Required by that type, so the form always has a value to send. */ @@ -797,10 +801,10 @@ const ComplexityRouterConfig: React.FC = ({ handleTierLabelChange(row.id as keyof ComplexityTiers, event.target.value) } placeholder={t("addModel.complexityRouterConfig.displayName.placeholder", { - label: tierInfo.label, + label: t(tierInfo.labelKey), })} aria-label={t("addModel.complexityRouterConfig.displayName.aria", { - label: tierInfo.label, + label: t(tierInfo.labelKey), })} /> {value.tier_labels?.[row.id as keyof ComplexityTiers] && ( @@ -808,7 +812,7 @@ const ComplexityRouterConfig: React.FC = ({ handleTierLabelChange(row.id as keyof ComplexityTiers, "")} > diff --git a/ui/litellm-dashboard/src/components/add_model/CompressionControls.tsx b/ui/litellm-dashboard/src/components/add_model/CompressionControls.tsx index 2c8ef000e61..6df8c3ad13d 100644 --- a/ui/litellm-dashboard/src/components/add_model/CompressionControls.tsx +++ b/ui/litellm-dashboard/src/components/add_model/CompressionControls.tsx @@ -3,6 +3,7 @@ import { SearchSelect, SearchSelectOption } from "@/components/shared/SearchSele import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Info } from "lucide-react"; +import type { ParseKeys } from "i18next"; import React from "react"; import { useTranslation } from "react-i18next"; import { useGuardrails } from "@/app/(dashboard)/hooks/guardrails/useGuardrails"; @@ -17,7 +18,7 @@ interface CompressionControlsProps { onChange: (state: AutoRouterCompressionState) => void; } -const NONE_OPTION: SearchSelectOption = { label: "None (no compression)", value: NO_COMPRESSION }; +const NONE_OPTION_LABEL: ParseKeys = "addModel.compressionControls.noneOption"; const CompressionControls: React.FC = ({ value, onChange }) => { const { t } = useTranslation(); @@ -30,7 +31,7 @@ const CompressionControls: React.FC = ({ value, onChan const compressionOptions: SearchSelectOption[] = (data?.guardrails ?? []) .filter((g) => isCompressionGuardrailProvider(g.litellm_params?.guardrail)) .map((g) => ({ label: g.guardrail_name, value: g.guardrail_name })); - const options: SearchSelectOption[] = [NONE_OPTION, ...compressionOptions]; + const options: SearchSelectOption[] = [{ label: t(NONE_OPTION_LABEL), value: NO_COMPRESSION }, ...compressionOptions]; return (
    diff --git a/ui/litellm-dashboard/src/components/add_model/CustomDimensionRows.tsx b/ui/litellm-dashboard/src/components/add_model/CustomDimensionRows.tsx index 2dfd5c3ce10..ebb5af749bd 100644 --- a/ui/litellm-dashboard/src/components/add_model/CustomDimensionRows.tsx +++ b/ui/litellm-dashboard/src/components/add_model/CustomDimensionRows.tsx @@ -10,8 +10,8 @@ import { Slider } from "@/components/ui/slider"; import type { CustomDimensionRow } from "./custom_dimensions"; const SCORING_MODES = [ - { value: "binary", label: "Binary" }, - { value: "match_count", label: "Match count" }, + { value: "binary", labelKey: "addModel.customDimensionRows.scoringModes.binary" }, + { value: "match_count", labelKey: "addModel.customDimensionRows.scoringModes.matchCount" }, ] as const; interface Props { @@ -109,7 +109,7 @@ export default function CustomDimensionRows({ rows, disabled, onChange, onWeight
    ({ value: rubric, - label: description.label, + label: t(description.labelKey), }))} value={classificationRubric ?? tierSource.classificationRubric} onValueChange={(rubric: ClassificationRubric | null) => rubric && setRubricDraft(rubric)} @@ -210,13 +210,13 @@ const OpeningPromptEditor: React.FC = ({ > {Object.entries(CLASSIFICATION_RUBRIC_DESCRIPTIONS).map(([rubric, description]) => ( - {description.label} + {t(description.labelKey)} ))}

    - {tierSource.rubricRestriction ?? draftRubricSummary?.description} + {tierSource.rubricRestriction ?? (draftRubricSummary && t(draftRubricSummary.descriptionKey))}

    )} diff --git a/ui/litellm-dashboard/src/components/add_model/TierRestrictions.tsx b/ui/litellm-dashboard/src/components/add_model/TierRestrictions.tsx index 4383bea5972..78551f6a398 100644 --- a/ui/litellm-dashboard/src/components/add_model/TierRestrictions.tsx +++ b/ui/litellm-dashboard/src/components/add_model/TierRestrictions.tsx @@ -8,7 +8,8 @@ export const restrictedBy = ( key: keyof typeof CUSTOM_TIER_RESTRICTIONS, t: TFunction = i18n.t.bind(i18n), ): TierRestriction | undefined => { - if (value.custom_tier_set) return CUSTOM_TIER_RESTRICTIONS[key]; + if (value.custom_tier_set) + return { omit: CUSTOM_TIER_RESTRICTIONS[key].omit, reason: t(CUSTOM_TIER_RESTRICTIONS[key].reason) }; if (value.classifier_type === "llm_v2" && key === "adaptive") return { omit: ["adaptive", "adaptive_weights", "adaptive_eligible", "tier_distance_penalty"], diff --git a/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx b/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx index 63def76db8f..ef651b9f7dc 100644 --- a/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx +++ b/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx @@ -1,20 +1,22 @@ +import type { ParseKeys } from "i18next"; + // Define the available test modes -export const TEST_MODES = [ - { value: "chat", label: "Chat - /chat/completions" }, - { value: "completion", label: "Completion - /completions" }, - { value: "embedding", label: "Embedding - /embeddings" }, - { value: "audio_speech", label: "Audio Speech - /audio/speech" }, - { value: "audio_transcription", label: "Audio Transcription - /audio/transcriptions" }, - { value: "image_generation", label: "Image Generation - /images/generations" }, - { value: "image_edit", label: "Image Edit - /images/edits" }, - { value: "video_generation", label: "Video Generation - /videos" }, - { value: "rerank", label: "Rerank - /rerank" }, - { value: "realtime", label: "Realtime - /realtime" }, - { value: "batch", label: "Batch - /batch" }, - { value: "anthropic_messages", label: "Anthropic Messages - /v1/messages" }, - { value: "ocr", label: "OCR - /ocr" }, - { value: "decisions", label: "Decisions - /v1/decisions" }, - { value: "extraction", label: "Extraction - /v1/extraction" }, +export const TEST_MODES: readonly { value: string; labelKey: ParseKeys }[] = [ + { value: "chat", labelKey: "addModel.addModelModes.chat" }, + { value: "completion", labelKey: "addModel.addModelModes.completion" }, + { value: "embedding", labelKey: "addModel.addModelModes.embedding" }, + { value: "audio_speech", labelKey: "addModel.addModelModes.audioSpeech" }, + { value: "audio_transcription", labelKey: "addModel.addModelModes.audioTranscription" }, + { value: "image_generation", labelKey: "addModel.addModelModes.imageGeneration" }, + { value: "image_edit", labelKey: "addModel.addModelModes.imageEdit" }, + { value: "video_generation", labelKey: "addModel.addModelModes.videoGeneration" }, + { value: "rerank", labelKey: "addModel.addModelModes.rerank" }, + { value: "realtime", labelKey: "addModel.addModelModes.realtime" }, + { value: "batch", labelKey: "addModel.addModelModes.batch" }, + { value: "anthropic_messages", labelKey: "addModel.addModelModes.anthropicMessages" }, + { value: "ocr", labelKey: "addModel.addModelModes.ocr" }, + { value: "decisions", labelKey: "addModel.addModelModes.decisions" }, + { value: "extraction", labelKey: "addModel.addModelModes.extraction" }, ]; // Define the available auto router routing strategies diff --git a/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx b/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx index 28cf847587e..83ac6ff465e 100644 --- a/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx +++ b/ui/litellm-dashboard/src/components/add_model/advanced_settings.tsx @@ -58,8 +58,8 @@ const USAGE_COST_FIELDS = [ const REVALIDATED_WHEN_PTU_COUNT_CHANGES = [PTU_RATE_FIELD, PTU_START_FIELD, ...USAGE_COST_FIELDS]; const PRICING_MODEL_ITEMS = [ - { value: "per_token", label: "Per Million Tokens" }, - { value: "per_second", label: "Per Second" }, + { value: "per_token", labelKey: "addModel.advancedSettings.pricingModels.perToken" }, + { value: "per_second", labelKey: "addModel.advancedSettings.pricingModels.perSecond" }, ] as const; const validateNumber = (_: unknown, value: unknown) => { @@ -320,7 +320,7 @@ const AdvancedSettings: React.FC = ({ > {(control) => ( + ({ value: item.value, label: t(item.labelKey) }))} value={point.role ?? null} onValueChange={(selected) => replaceAt(index, { ...point, role: (selected as CacheControlRole | null) ?? undefined }) @@ -119,7 +122,7 @@ const CacheControlInjectionPoints: React.FC = {t("addModel.cacheControlSettings.noRole")} {ROLE_ITEMS.map((item) => ( - {item.label} + {t(item.labelKey)} ))} diff --git a/ui/litellm-dashboard/src/components/add_model/heuristic_scoring_knobs.ts b/ui/litellm-dashboard/src/components/add_model/heuristic_scoring_knobs.ts index 1249323aa39..185785fd120 100644 --- a/ui/litellm-dashboard/src/components/add_model/heuristic_scoring_knobs.ts +++ b/ui/litellm-dashboard/src/components/add_model/heuristic_scoring_knobs.ts @@ -1,3 +1,4 @@ +import type { ParseKeys } from "i18next"; import i18n from "@/i18n/i18n"; import { serializeCustomDimensions, type CustomDimensionRow } from "./custom_dimensions"; import { heuristicScoringRoleFor, type ClassifierFallback } from "./ComplexityRouterConfig"; @@ -43,17 +44,18 @@ export const scorerKnobPayload = (knobs: ScorerKnobInputs) => { * shipped weights come from the proxy (GET /public/complexity_router/scorer_defaults), so a dimension * added backend-side still renders, under its raw key until it is given a label here. */ -export const DIMENSION_LABELS: Record = { - codePresence: "Code presence", - reasoningMarkers: "Reasoning markers", - technicalTerms: "Technical terms", - tokenCount: "Token count", - simpleIndicators: "Simple indicators", - multiStepPatterns: "Multi-step patterns", - questionComplexity: "Question complexity", +export const DIMENSION_LABELS: Record = { + codePresence: "addModel.heuristicScoringKnobs.dimensions.codePresence", + reasoningMarkers: "addModel.heuristicScoringKnobs.dimensions.reasoningMarkers", + technicalTerms: "addModel.heuristicScoringKnobs.dimensions.technicalTerms", + tokenCount: "addModel.heuristicScoringKnobs.dimensions.tokenCount", + simpleIndicators: "addModel.heuristicScoringKnobs.dimensions.simpleIndicators", + multiStepPatterns: "addModel.heuristicScoringKnobs.dimensions.multiStepPatterns", + questionComplexity: "addModel.heuristicScoringKnobs.dimensions.questionComplexity", }; -export const dimensionLabel = (key: string): string => DIMENSION_LABELS[key] ?? key; +export const dimensionLabel = (key: string): string => + Object.hasOwn(DIMENSION_LABELS, key) ? i18n.t(DIMENSION_LABELS[key]) : key; const asRecord = (raw: unknown): Record | undefined => typeof raw === "object" && raw !== null && !Array.isArray(raw) ? (raw as Record) : undefined; diff --git a/ui/litellm-dashboard/src/components/add_model/provider_auth_types.ts b/ui/litellm-dashboard/src/components/add_model/provider_auth_types.ts index 0bf98407bfa..77a08c45393 100644 --- a/ui/litellm-dashboard/src/components/add_model/provider_auth_types.ts +++ b/ui/litellm-dashboard/src/components/add_model/provider_auth_types.ts @@ -1,9 +1,10 @@ +import type { ParseKeys } from "i18next"; import { Providers } from "../provider_info_helpers"; export interface ProviderAuthType { readonly id: string; - readonly label: string; - readonly description: string; + readonly labelKey: ParseKeys; + readonly descriptionKey: ParseKeys; readonly fieldKeys: readonly string[]; readonly requiredFieldKeys: readonly string[]; readonly fixedValues?: Readonly>; @@ -20,18 +21,16 @@ export const PROVIDER_AUTH_TYPES: Partial = ({ )} -

    {selectedAuthType.description}

    +

    {t(selectedAuthType.descriptionKey)}

    )} {credentialOnlySelected ? ( diff --git a/ui/litellm-dashboard/src/components/add_model/tier_rows.ts b/ui/litellm-dashboard/src/components/add_model/tier_rows.ts index a9ea085854c..092dc8a73c5 100644 --- a/ui/litellm-dashboard/src/components/add_model/tier_rows.ts +++ b/ui/litellm-dashboard/src/components/add_model/tier_rows.ts @@ -1,4 +1,4 @@ -import type { TFunction } from "i18next"; +import type { ParseKeys, TFunction } from "i18next"; import i18n from "@/i18n/i18n"; import { isForecastClassifier } from "./forecast_classifier_config"; import type { ClassifierType, ComplexityTiers } from "./ComplexityRouterConfig"; @@ -126,29 +126,27 @@ export interface TierRestriction { export const CUSTOM_TIER_RESTRICTIONS = { displayNames: { omit: ["tier_labels"], - reason: "Display names rename the built-in tiers, which your tier set replaces. Name each tier directly", + reason: "addModel.tierRows.restrictions.displayNames", }, escalation: { omit: ["escalation_keywords"], - reason: "Escalation bumps a request along the built-in tier ladder, which your tier set replaces", + reason: "addModel.tierRows.restrictions.escalation", }, stallEscalation: { omit: ["stall_escalation_enabled", "stall_escalation_window", "stall_escalation_repeat_threshold"], - reason: "Stall escalation bumps a request along the built-in tier ladder, which your tier set replaces", + reason: "addModel.tierRows.restrictions.stallEscalation", }, adaptive: { omit: ["adaptive", "adaptive_weights", "tier_distance_penalty", "adaptive_eligible"], - reason: "Adaptive routing scores models along the built-in tier ladder, which your tier set replaces", + reason: "addModel.tierRows.restrictions.adaptive", }, sessionAffinity: { omit: [], - reason: "Session pinning escalates along the built-in tier ladder, which your tier set replaces", + reason: "addModel.tierRows.restrictions.sessionAffinity", }, heuristicClassifier: { omit: ["heuristic_first_max_tier", "hybrid_boundary_margin", "local_heuristic"], - reason: - "The heuristic scorer only produces the built-in tiers, so an edited set needs the LLM or JEV classifier. " + - "Heuristic first and hybrid are out for the same reason: their local scorer decides the traffic it is sure of", + reason: "addModel.tierRows.restrictions.heuristicClassifier", }, heuristicScoring: { omit: [ @@ -159,17 +157,17 @@ export const CUSTOM_TIER_RESTRICTIONS = { "reasoning_override_min_score", "custom_technical_keywords", ], - reason: "The heuristic scorer never runs under an edited tier set, so its inputs have no effect", + reason: "addModel.tierRows.restrictions.heuristicScoring", }, classificationRubric: { omit: [], - reason: "The preset calibration examples are written against the built-in tiers, which your tier set replaces", + reason: "addModel.tierRows.restrictions.classificationRubric", }, classifierFallback: { omit: ["classifier_fallback"], - reason: "Fallback Tier is where an edited tier set routes when the classifier fails", + reason: "addModel.tierRows.restrictions.classifierFallback", }, -} as const satisfies Record; +} as const satisfies Record; export const CUSTOM_TIER_OMITTED_KEYS: readonly string[] = Object.values(CUSTOM_TIER_RESTRICTIONS).flatMap( (restriction) => restriction.omit, diff --git a/ui/litellm-dashboard/src/components/model_add/CredentialModal.tsx b/ui/litellm-dashboard/src/components/model_add/CredentialModal.tsx index 26c0ca07b07..a7e1d8546ef 100644 --- a/ui/litellm-dashboard/src/components/model_add/CredentialModal.tsx +++ b/ui/litellm-dashboard/src/components/model_add/CredentialModal.tsx @@ -1,3 +1,4 @@ +import type { ParseKeys } from "i18next"; import { Input } from "@/components/ui/input"; import { SearchSelect, type SearchSelectOption } from "@/components/shared/SearchSelect"; import { SimpleTooltip } from "@/components/ui/tooltip"; @@ -54,9 +55,9 @@ const AUTH_METHOD_SELECT_ID = "credential_auth_method"; const API_KEY_FIELDS: readonly string[] = ["api_key"]; const NO_HIDDEN_FIELDS: readonly string[] = []; -const authMethodItems: { value: AuthMethod; label: string }[] = [ - { value: "api_key", label: "API key" }, - { value: "federation", label: "Workload identity federation" }, +const authMethodItems: { value: AuthMethod; labelKey: ParseKeys }[] = [ + { value: "api_key", labelKey: "modelAdd.credentialModal.authMethods.apiKey" }, + { value: "federation", labelKey: "modelAdd.credentialModal.authMethods.federation" }, ]; interface CredentialModalProps { @@ -242,7 +243,7 @@ export default function CredentialModal({ )} ({ ...item, label: t(item.label) }))} value={(control.value as string | undefined) ?? null} onValueChange={handleTransportSelected(control.onChange)} > @@ -879,14 +879,17 @@ const CreateMCPServer: React.FC = ({ }} > {(control) => ( - (control)} + items={AUTH_TYPE_ITEMS.map((item) => ({ ...item, label: t(item.label) }))} + > {AUTH_TYPE_ITEMS.map((item) => ( - {item.label} + {t(item.label)} ))} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/MCPServerCard.tsx b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/MCPServerCard.tsx index 6524985b74a..62e6782bcfc 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/MCPServerCard.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/MCPServerCard.tsx @@ -379,7 +379,7 @@ const HealthChip: FC = ({ />
    {t("mcpServers.serverCard.healthChip.health", { status })}
    - {status === "reachable" &&
    {MCP_REACHABLE_DESCRIPTION}
    } + {status === "reachable" &&
    {t(MCP_REACHABLE_DESCRIPTION)}
    } {lastCheck && (
    {t("mcpServers.serverCard.healthChip.lastCheck", { time: new Date(lastCheck).toLocaleString() })} diff --git a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/StdioAvailability.tsx b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/StdioAvailability.tsx index 4c2ef63c63f..ecae5d89042 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/StdioAvailability.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/StdioAvailability.tsx @@ -24,7 +24,7 @@ export const TransportSelectItems: FC<{ stdioEnabled: boolean }> = ({ stdioEnabl const disabled = item.value === TRANSPORT.STDIO && !stdioEnabled; return ( - {item.label} + {t(item.label)} {disabled && } ); diff --git a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx index ee27d23bf8e..2b86095c1e4 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_server_edit.tsx @@ -896,7 +896,7 @@ const MCPServerEdit: React.FC = ({ > {(control) => ( (control)} items={AUTH_TYPE_ITEMS}> + ({ value: option.settingValue, label: option.label }))} + items={relativeTimeOptions.map((option) => ({ value: option.settingValue, label: t(option.label) }))} onValueChange={(value) => { if (value === null) return; updateSettings( @@ -354,7 +354,7 @@ export default function UISettings() { {relativeTimeOptions.map((option) => ( - {option.label} + {t(option.label)} ))} diff --git a/ui/litellm-dashboard/src/components/SidebarAccountMenu/SidebarAccountMenu.tsx b/ui/litellm-dashboard/src/components/SidebarAccountMenu/SidebarAccountMenu.tsx index 173e3b3f07e..5d419274bc7 100644 --- a/ui/litellm-dashboard/src/components/SidebarAccountMenu/SidebarAccountMenu.tsx +++ b/ui/litellm-dashboard/src/components/SidebarAccountMenu/SidebarAccountMenu.tsx @@ -21,6 +21,7 @@ import { isProxyAdminRole } from "@/utils/roles"; import { ChevronsUpDown, Crown, IdCard, KeyRound, LogOut, Mail, ShieldCheck } from "lucide-react"; import { useRouter } from "next/navigation"; import React from "react"; +import { Trans, useTranslation } from "react-i18next"; const RELEASE_NOTES_URL = "https://docs.litellm.ai/release_notes"; @@ -96,6 +97,7 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla accessToken, loginMethod, } = useAuthorized(); + const { t } = useTranslation(); const router = useRouter(); const [open, setOpen] = React.useState(false); const { data: healthData } = useHealthReadinessDetails(accessToken); @@ -119,29 +121,29 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla const toggles = [ { key: "disableShowNewBadge", - label: "Hide New Feature Indicators", - ariaLabel: "Toggle hide new feature indicators", + label: t("shell.sidebarAccountMenu.toggles.newBadge.label"), + ariaLabel: t("shell.sidebarAccountMenu.toggles.newBadge.ariaLabel"), checked: disableShowNewBadge, onCheckedChange: (checked: boolean) => setFlag("disableShowNewBadge", checked), }, { key: "disableShowPrompts", - label: "Hide All Prompts", - ariaLabel: "Toggle hide all prompts", + label: t("shell.sidebarAccountMenu.toggles.prompts.label"), + ariaLabel: t("shell.sidebarAccountMenu.toggles.prompts.ariaLabel"), checked: disableShowPrompts, onCheckedChange: (checked: boolean) => setFlag("disableShowPrompts", checked), }, { key: "disableBlogPosts", - label: "Hide Blog Posts", - ariaLabel: "Toggle hide blog posts", + label: t("shell.sidebarAccountMenu.toggles.blogPosts.label"), + ariaLabel: t("shell.sidebarAccountMenu.toggles.blogPosts.ariaLabel"), checked: disableBlogPosts, onCheckedChange: (checked: boolean) => setFlag("disableBlogPosts", checked), }, { key: "disableBouncingIcon", - label: "Hide Bouncing Icon", - ariaLabel: "Toggle hide bouncing icon", + label: t("shell.sidebarAccountMenu.toggles.bouncingIcon.label"), + ariaLabel: t("shell.sidebarAccountMenu.toggles.bouncingIcon.ariaLabel"), checked: disableBouncingIcon, onCheckedChange: (checked: boolean) => setFlag("disableBouncingIcon", checked), }, @@ -151,7 +153,10 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla const initials = initialsFromIdentity(userEmail, userId); const hue = hueFromString(seed); const displayName = navAccountDisplayName(userEmail, userId); - const triggerLabel = `Account menu — ${userRole ?? "Unknown role"} — signed in as ${userEmail || userId || "unknown"}`; + const triggerLabel = t("shell.sidebarAccountMenu.triggerLabel", { + role: userRole ?? t("shell.sidebarAccountMenu.unknownRole"), + identity: userEmail || userId || t("shell.sidebarAccountMenu.unknownIdentity"), + }); return ( @@ -192,7 +197,7 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla 🌴 @@ -211,27 +216,27 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla
    - } label="Tier"> + } label={t("shell.sidebarAccountMenu.tier")}> {premiumUser ? ( - Premium + {t("shell.sidebarAccountMenu.premium")} ) : ( - + - Standard + {t("shell.sidebarAccountMenu.standard")} )} - } label="Role"> + } label={t("shell.sidebarAccountMenu.role")}> {userRole} - } label="Email"> - + } label={t("shell.sidebarAccountMenu.email")}> + - } label="User ID"> - + } label={t("shell.sidebarAccountMenu.userId")}> +
    @@ -251,12 +256,14 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla ))} {premiumUser === true && canUseLiteAdmin && (
    - Hide {ARIA_AGENT_LABEL} + + {ARIA_AGENT_LABEL} }} /> +
    )} @@ -274,7 +281,7 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla className="h-[42px] w-full justify-start gap-2.5 rounded-none px-3 text-sm font-medium text-foreground" > - Change Password + {t("shell.sidebarAccountMenu.changePassword")} )} @@ -284,7 +291,7 @@ const SidebarAccountMenu: React.FC = ({ onLogout, colla className="h-[42px] w-full justify-start gap-2.5 rounded-none px-3 text-sm font-medium text-foreground" > - Logout + {t("shell.sidebarAccountMenu.logout")} diff --git a/ui/litellm-dashboard/src/components/SidebarUsageCard.tsx b/ui/litellm-dashboard/src/components/SidebarUsageCard.tsx index effb6c29e8e..ba1ce4a286b 100644 --- a/ui/litellm-dashboard/src/components/SidebarUsageCard.tsx +++ b/ui/litellm-dashboard/src/components/SidebarUsageCard.tsx @@ -4,7 +4,9 @@ import { Button } from "@/components/ui/button"; import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { Meter, MeterIndicator, MeterLabel, MeterTrack } from "@/components/shared/Meter"; import { useQuery } from "@tanstack/react-query"; +import type { TFunction } from "i18next"; import { Award, ChevronDown, Loader2 } from "lucide-react"; +import { useTranslation } from "react-i18next"; import { getRemainingUsers } from "./networking"; interface SidebarUsageCardProps { @@ -26,9 +28,17 @@ const meterTone = (pct: number): "default" | "warning" | "over" => { }; const UsageMeter = ({ label, used, total }: MeterData) => { + const { t } = useTranslation(); const pct = total > 0 ? (used / total) * 100 : 0; return ( - +
    {label} @@ -53,11 +63,15 @@ const remainingUsersQuery = (accessToken: string | null) => ({ staleTime: 5 * 60 * 1000, }); -const buildMeters = (data: RemainingUsage | null): MeterData[] => { +const buildMeters = (data: RemainingUsage | null, t: TFunction): MeterData[] => { if (!data) return []; return [ - ...(data.total_users != null ? [{ label: "Seats", used: data.total_users_used, total: data.total_users }] : []), - ...(data.total_teams != null ? [{ label: "Teams", used: data.total_teams_used, total: data.total_teams }] : []), + ...(data.total_users != null + ? [{ label: t("shell.sidebarUsageCard.seats"), used: data.total_users_used, total: data.total_users }] + : []), + ...(data.total_teams != null + ? [{ label: t("shell.sidebarUsageCard.teams"), used: data.total_teams_used, total: data.total_teams }] + : []), ]; }; @@ -68,6 +82,7 @@ const buildMeters = (data: RemainingUsage | null): MeterData[] => { * design's Spend / API-request meters are intentionally omitted. */ export default function SidebarUsageCard({ accessToken, collapsed, onExpandRail }: SidebarUsageCardProps) { + const { t } = useTranslation(); const licenseInfo = useLicenseInfo(accessToken).data ?? null; const { data: usageData, isLoading } = useQuery(remainingUsersQuery(accessToken)); const data = usageData ?? null; @@ -84,7 +99,7 @@ export default function SidebarUsageCard({ accessToken, collapsed, onExpandRail