Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(otel): normalize gen ai usage details (#13110)

Hassieb Pakzad35e837700e38
diff --git a/packages/shared/src/server/otel/OtelIngestionProcessor.ts b/packages/shared/src/server/otel/OtelIngestionProcessor.ts
index 65aa580f9a..4f8e552217 100644
--- a/packages/shared/src/server/otel/OtelIngestionProcessor.ts
+++ b/packages/shared/src/server/otel/OtelIngestionProcessor.ts
@@ -2476,51 +2476,120 @@ export class OtelIngestionProcessor {
}
if (instrumentationScopeName === "pydantic-ai") {
- const inputTokens = attributes["gen_ai.usage.input_tokens"];
- const outputTokens = attributes["gen_ai.usage.output_tokens"];
- const cacheReadTokens =
- attributes["gen_ai.usage.cache_read_tokens"] ??
- attributes["gen_ai.usage.details.cache_read_input_tokens"];
- const cacheWriteTokens =
- attributes["gen_ai.usage.cache_write_tokens"] ??
- attributes["gen_ai.usage.details.cache_creation_input_tokens"];
-
- return {
- input: inputTokens,
- output: outputTokens,
- input_cache_read: cacheReadTokens,
- input_cache_creation: cacheWriteTokens,
- };
+ const usageDetails = this.extractGenericGenAiUsageDetails(attributes);
+ if (Object.keys(usageDetails).length > 0) return usageDetails;
}
+ return this.extractGenericGenAiUsageDetails(attributes);
+ }
+
+ private extractGenericGenAiUsageDetails(
+ attributes: Record<string, unknown>,
+ ): Record<string, number> {
const usageDetails = Object.keys(attributes).filter(
(key) =>
(key.startsWith("gen_ai.usage.") && key !== "gen_ai.usage.cost") ||
- key.startsWith("llm.token_count"),
+ key.startsWith("llm.token_count."),
);
- const usageDetailKeyMapping: Record<string, string> = {
- prompt_tokens: "input",
- completion_tokens: "output",
- total_tokens: "total",
- input_tokens: "input",
- output_tokens: "output",
- prompt: "input",
- completion: "output",
- };
+ if (usageDetails.length === 0) return {};
- return usageDetails.reduce((acc: any, key) => {
- const usageDetailKey = key
- .replace("gen_ai.usage.", "")
- .replace("llm.token_count.", "");
- const mappedUsageDetailKey =
- usageDetailKeyMapping[usageDetailKey] ?? usageDetailKey;
- const value = Number(attributes[key]);
- if (!Number.isNaN(value)) {
- acc[mappedUsageDetailKey] = value;
- }
- return acc;
- }, {});
+ const rawUsageDetails = usageDetails.reduce(
+ (acc: Record<string, number>, key) => {
+ const usageDetailKey = key
+ .replace("gen_ai.usage.", "")
+ .replace("llm.token_count.", "");
+ const value = Number(attributes[key]);
+
+ if (!Number.isNaN(value)) {
+ acc[usageDetailKey] = value;
+ }
+
+ return acc;
+ },
+ {},
+ );
+
+ const inputTokens =
+ rawUsageDetails["prompt_tokens"] ??
+ rawUsageDetails["input_tokens"] ??
+ rawUsageDetails["prompt"];
+ const outputTokens =
+ rawUsageDetails["completion_tokens"] ??
+ rawUsageDetails["output_tokens"] ??
+ rawUsageDetails["completion"];
+ const totalTokens =
+ rawUsageDetails["total_tokens"] ?? rawUsageDetails["total"];
+ const cacheReadTokens =
+ rawUsageDetails["cache_read.input_tokens"] ??
+ rawUsageDetails["cache_read_tokens"] ??
+ rawUsageDetails["details.cache_read_tokens"] ??
+ rawUsageDetails["details.cache_read_input_tokens"];
+ const cacheCreationTokens =
+ rawUsageDetails["cache_creation.input_tokens"] ??
+ rawUsageDetails["cache_write_tokens"] ??
+ rawUsageDetails["details.cache_write_tokens"] ??
+ rawUsageDetails["details.cache_creation_input_tokens"];
+
+ const normalizedUsageDetails = Object.entries(rawUsageDetails).reduce(
+ (acc: Record<string, number>, [key, value]) => {
+ if (
+ [
+ "prompt_tokens",
+ "input_tokens",
+ "prompt",
+ "completion_tokens",
+ "output_tokens",
+ "completion",
+ "total_tokens",
+ "total",
+ "cache_read.input_tokens",
+ "cache_read_tokens",
+ "details.cache_read_tokens",
+ "details.cache_read_input_tokens",
+ "cache_creation.input_tokens",
+ "cache_write_tokens",
+ "details.cache_write_tokens",
+ "details.cache_creation_input_tokens",
+ ].includes(key)
+ ) {
+ return acc;
+ }
+
+ const normalizedKey = key.startsWith("details.")
+ ? key.replace("details.", "")
+ : key;
+
+ acc[normalizedKey] = value;
+ return acc;
+ },
+ {},
+ );
+
+ if (inputTokens !== undefined) {
+ normalizedUsageDetails.input = Math.max(
+ inputTokens - (cacheReadTokens ?? 0) - (cacheCreationTokens ?? 0),
+ 0,
+ );
+ }
+
+ if (outputTokens !== undefined) {
+ normalizedUsageDetails.output = outputTokens;
+ }
+
+ if (totalTokens !== undefined) {
+ normalizedUsageDetails.total = totalTokens;
+ }
+
+ if (cacheReadTokens !== undefined) {
+ normalizedUsageDetails.input_cached_tokens = cacheReadTokens;
+ }
+
+ if (cacheCreationTokens !== undefined) {
+ normalizedUsageDetails.input_cache_creation = cacheCreationTokens;
+ }
+
+ return normalizedUsageDetails;
}
private extractCostDetails(
diff --git a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts b/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
index 6d77e21305..9b2f098943 100644
--- a/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
+++ b/web/src/__tests__/server/api/otel/otelMapping.servertest.ts
@@ -1885,6 +1885,106 @@ describe("OTel Resource Span Mapping", () => {
expect(metadataAttributes).not.toHaveProperty("pydantic_ai.all_messages");
});
+ it("should normalize current Pydantic AI cache usage fields into Langfuse usage details", async () => {
+ const traceId = "abcdef1234567890abcdef1234567891";
+
+ const pydanticAiRootSpan = {
+ resource: {
+ attributes: [
+ {
+ key: "telemetry.sdk.language",
+ value: { stringValue: "python" },
+ },
+ {
+ key: "telemetry.sdk.name",
+ value: { stringValue: "opentelemetry" },
+ },
+ {
+ key: "service.name",
+ value: { stringValue: "test-service" },
+ },
+ ],
+ },
+ scopeSpans: [
+ {
+ scope: {
+ name: "pydantic-ai",
+ version: "1.66.0",
+ attributes: [],
+ },
+ spans: [
+ {
+ traceId: Buffer.from(traceId, "hex"),
+ spanId: Buffer.from("80854cd6bd218bf6", "hex"),
+ name: "pydantic-cache-test",
+ kind: 1,
+ startTimeUnixNano: {
+ low: 1000000,
+ high: 406528574,
+ unsigned: true,
+ },
+ endTimeUnixNano: {
+ low: 2000000,
+ high: 406528574,
+ unsigned: true,
+ },
+ attributes: [
+ {
+ key: "gen_ai.usage.input_tokens",
+ value: { intValue: { low: 120, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.output_tokens",
+ value: { intValue: { low: 40, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.cache_read.input_tokens",
+ value: { intValue: { low: 30, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.cache_creation.input_tokens",
+ value: { intValue: { low: 10, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.details.input_audio_tokens",
+ value: { intValue: { low: 5, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.details.cache_audio_read_tokens",
+ value: { intValue: { low: 2, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.details.output_audio_tokens",
+ value: { intValue: { low: 7, high: 0, unsigned: false } },
+ },
+ ],
+ events: [],
+ status: { code: 1 },
+ },
+ ],
+ },
+ ],
+ };
+
+ const events = await convertOtelSpanToIngestionEvent(
+ pydanticAiRootSpan,
+ new Set(),
+ );
+
+ const observationEvent = events.find((e) => e.type === "span-create");
+
+ expect(observationEvent).toBeDefined();
+ expect(observationEvent?.body.usageDetails.input).toBe(80);
+ expect(observationEvent?.body.usageDetails.output).toBe(40);
+ expect(observationEvent?.body.usageDetails.input_cached_tokens).toBe(30);
+ expect(observationEvent?.body.usageDetails.input_cache_creation).toBe(10);
+ expect(observationEvent?.body.usageDetails.input_audio_tokens).toBe(5);
+ expect(observationEvent?.body.usageDetails.cache_audio_read_tokens).toBe(
+ 2,
+ );
+ expect(observationEvent?.body.usageDetails.output_audio_tokens).toBe(7);
+ });
+
it("should prepend gen_ai.system_instructions to pydantic_ai.all_messages input when system message is absent", async () => {
const traceId = "9d7aa9a729def1eadc0b2063ca4ebeb4";
@@ -6202,6 +6302,92 @@ describe("OTel Resource Span Mapping", () => {
});
});
+ describe("GenAI usage normalization", () => {
+ it("should normalize official gen_ai cache usage into Langfuse canonical keys", async () => {
+ const traceId = "abcdef1234567890abcdef1234567892";
+
+ const genAiSpan = {
+ resource: {
+ attributes: [
+ {
+ key: "service.name",
+ value: { stringValue: "test-service" },
+ },
+ ],
+ },
+ scopeSpans: [
+ {
+ scope: {
+ name: "gen_ai",
+ version: "1.0.0",
+ },
+ spans: [
+ {
+ traceId: Buffer.from(traceId, "hex"),
+ spanId: Buffer.from("1234567890abcde1", "hex"),
+ name: "normalized-genai-usage",
+ kind: 1,
+ startTimeUnixNano: {
+ low: 1000000,
+ high: 406528574,
+ unsigned: true,
+ },
+ endTimeUnixNano: {
+ low: 2000000,
+ high: 406528574,
+ unsigned: true,
+ },
+ attributes: [
+ {
+ key: "gen_ai.usage.input_tokens",
+ value: { intValue: { low: 100, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.output_tokens",
+ value: { intValue: { low: 40, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.total_tokens",
+ value: { intValue: { low: 140, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.cache_read.input_tokens",
+ value: { intValue: { low: 20, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.cache_creation.input_tokens",
+ value: { intValue: { low: 10, high: 0, unsigned: false } },
+ },
+ {
+ key: "gen_ai.usage.output_audio_tokens",
+ value: { intValue: { low: 5, high: 0, unsigned: false } },
+ },
+ ],
+ status: {},
+ },
+ ],
+ },
+ ],
+ };
+
+ const events = await convertOtelSpanToIngestionEvent(
+ genAiSpan,
+ new Set(),
+ );
+ const observationEvent = events.find(
+ (e) => e.type === "generation-create" || e.type === "span-create",
+ );
+
+ expect(observationEvent).toBeDefined();
+ expect(observationEvent?.body.usageDetails.input).toBe(70);
+ expect(observationEvent?.body.usageDetails.output).toBe(40);
+ expect(observationEvent?.body.usageDetails.total).toBe(140);
+ expect(observationEvent?.body.usageDetails.input_cached_tokens).toBe(20);
+ expect(observationEvent?.body.usageDetails.input_cache_creation).toBe(10);
+ expect(observationEvent?.body.usageDetails.output_audio_tokens).toBe(5);
+ });
+ });
+
describe("Vercel AI SDK Usage details", () => {
it("should extract usage details from both provider metadata and 'ai.usage'", async () => {
const traceId = "abcdef1234567890abcdef1234567890";
diff --git a/worker/src/constants/default-model-prices.json b/worker/src/constants/default-model-prices.json
index 62e9adbf03..3c8448d483 100644
--- a/worker/src/constants/default-model-prices.json
+++ b/worker/src/constants/default-model-prices.json
@@ -1310,7 +1310,7 @@
"modelName": "claude-3-sonnet-20240229",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-sonnet-20240229|anthropic\\.claude-3-sonnet-20240229-v1:0|claude-3-sonnet@20240229)$",
"createdAt": "2024-03-07T17:55:38.139Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1329,6 +1329,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -1538,7 +1539,7 @@
"modelName": "claude-3-5-sonnet-20240620",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-5-sonnet-20240620|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-3-5-sonnet-20240620-v1:0|claude-3-5-sonnet@20240620)$",
"createdAt": "2024-06-25T11:47:24.475Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1557,6 +1558,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -1747,7 +1749,7 @@
"modelName": "claude-3.5-sonnet-20241022",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-5-sonnet-20241022|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-3-5-sonnet-20241022-v2:0|claude-3-5-sonnet-V2@20241022)$",
"createdAt": "2024-10-22T18:48:01.676Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1766,6 +1768,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -1776,7 +1779,7 @@
"modelName": "claude-3.5-sonnet-latest",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-5-sonnet-latest)$",
"createdAt": "2024-10-22T18:48:01.676Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1795,6 +1798,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -1805,7 +1809,7 @@
"modelName": "claude-3-5-haiku-20241022",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-5-haiku-20241022|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-3-5-haiku-20241022-v1:0|claude-3-5-haiku-V1@20241022)$",
"createdAt": "2024-11-05T10:30:50.566Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1824,6 +1828,7 @@
"input_cache_creation_5m": 0.000001,
"input_cache_creation_1h": 0.0000016,
"cache_read_input_tokens": 8e-8,
+ "input_cached_tokens": 8e-8,
"input_cache_read": 8e-8
}
}
@@ -1834,7 +1839,7 @@
"modelName": "claude-3.5-haiku-latest",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-5-haiku-latest)$",
"createdAt": "2024-11-05T10:30:50.566Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -1853,6 +1858,7 @@
"input_cache_creation_5m": 0.000001,
"input_cache_creation_1h": 0.0000016,
"cache_read_input_tokens": 8e-8,
+ "input_cached_tokens": 8e-8,
"input_cache_read": 8e-8
}
}
@@ -2153,7 +2159,7 @@
"modelName": "claude-3.7-sonnet-20250219",
"matchPattern": "(?i)^(anthropic\/)?(claude-3.7-sonnet-20250219|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-3.7-sonnet-20250219-v1:0|claude-3-7-sonnet-V1@20250219)$",
"createdAt": "2025-02-25T09:35:39.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2172,6 +2178,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -2182,7 +2189,7 @@
"modelName": "claude-3.7-sonnet-latest",
"matchPattern": "(?i)^(anthropic\/)?(claude-3-7-sonnet-latest)$",
"createdAt": "2025-02-25T09:35:39.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2201,6 +2208,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -2567,7 +2575,7 @@
"modelName": "claude-sonnet-4-5-20250929",
"matchPattern": "(?i)^(anthropic\/)?(claude-sonnet-4-5(-20250929)?|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-sonnet-4-5(-20250929)?-v1(:0)?|claude-sonnet-4-5-V1(@20250929)?|claude-sonnet-4-5(@20250929)?)$",
"createdAt": "2025-09-29T00:00:00.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2586,6 +2594,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
},
@@ -2612,6 +2621,7 @@
"input_cache_creation_5m": 0.0000075,
"input_cache_creation_1h": 0.000012,
"cache_read_input_tokens": 6e-7,
+ "input_cached_tokens": 6e-7,
"input_cache_read": 6e-7
}
}
@@ -2622,7 +2632,7 @@
"modelName": "claude-sonnet-4-20250514",
"matchPattern": "(?i)^(anthropic\/)?(claude-sonnet-4(-20250514)?|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-sonnet-4(-20250514)?-v1(:0)?|claude-sonnet-4-V1(@20250514)?|claude-sonnet-4(@20250514)?)$",
"createdAt": "2025-05-22T17:09:02.131Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2641,6 +2651,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -2651,7 +2662,7 @@
"modelName": "claude-sonnet-4-latest",
"matchPattern": "(?i)^(anthropic\/)?(claude-sonnet-4-latest)$",
"createdAt": "2025-05-22T17:09:02.131Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2670,6 +2681,7 @@
"input_cache_creation_5m": 0.00000375,
"input_cache_creation_1h": 0.000006,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
}
@@ -2680,7 +2692,7 @@
"modelName": "claude-opus-4-20250514",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4(-20250514)?|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4(-20250514)?-v1(:0)?|claude-opus-4(@20250514)?)$",
"createdAt": "2025-05-22T17:09:02.131Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2699,6 +2711,7 @@
"input_cache_creation_5m": 0.00001875,
"input_cache_creation_1h": 0.00003,
"cache_read_input_tokens": 0.0000015,
+ "input_cached_tokens": 0.0000015,
"input_cache_read": 0.0000015
}
}
@@ -2865,7 +2878,7 @@
"modelName": "claude-opus-4-1-20250805",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-1(-20250805)?|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-1(-20250805)?-v1(:0)?|claude-opus-4-1(@20250805)?)$",
"createdAt": "2025-08-05T15:00:00.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -2884,6 +2897,7 @@
"input_cache_creation_5m": 0.00001875,
"input_cache_creation_1h": 0.00003,
"cache_read_input_tokens": 0.0000015,
+ "input_cached_tokens": 0.0000015,
"input_cache_read": 0.0000015
}
}
@@ -3160,7 +3174,7 @@
"modelName": "claude-haiku-4-5-20251001",
"matchPattern": "(?i)^(anthropic\/)?(claude-haiku-4-5-20251001|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-haiku-4-5-20251001-v1:0|claude-4-5-haiku@20251001)$",
"createdAt": "2025-10-16T08:20:44.558Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerId": "claude",
"pricingTiers": [
{
@@ -3179,6 +3193,7 @@
"input_cache_creation_5m": 0.00000125,
"input_cache_creation_1h": 0.000002,
"cache_read_input_tokens": 1e-7,
+ "input_cached_tokens": 1e-7,
"input_cache_read": 1e-7
}
}
@@ -3249,7 +3264,7 @@
"modelName": "claude-opus-4-5-20251101",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-5(-20251101)?|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-opus-4-5(-20251101)?-v1(:0)?|claude-opus-4-5(@20251101)?)$",
"createdAt": "2025-11-24T20:53:27.571Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerConfig": null,
"tokenizerId": "claude",
"pricingTiers": [
@@ -3269,6 +3284,7 @@
"input_cache_creation_5m": 6.25e-6,
"input_cache_creation_1h": 10e-6,
"cache_read_input_tokens": 0.5e-6,
+ "input_cached_tokens": 0.5e-6,
"input_cache_read": 0.5e-6
}
}
@@ -3279,7 +3295,7 @@
"modelName": "claude-sonnet-4-6",
"matchPattern": "(?i)^(anthropic\\/)?(claude-sonnet-4-6|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-sonnet-4-6(-v1(:0)?)?|claude-sonnet-4-6)$",
"createdAt": "2026-02-18T00:00:00.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerConfig": null,
"tokenizerId": "claude",
"pricingTiers": [
@@ -3299,6 +3315,7 @@
"input_cache_creation_5m": 3.75e-6,
"input_cache_creation_1h": 6e-6,
"cache_read_input_tokens": 3e-7,
+ "input_cached_tokens": 3e-7,
"input_cache_read": 3e-7
}
},
@@ -3325,6 +3342,7 @@
"input_cache_creation_5m": 7.5e-6,
"input_cache_creation_1h": 12e-6,
"cache_read_input_tokens": 6e-7,
+ "input_cached_tokens": 6e-7,
"input_cache_read": 6e-7
}
}
@@ -3335,7 +3353,7 @@
"modelName": "claude-opus-4-6",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.|global\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$",
"createdAt": "2026-02-09T00:00:00.000Z",
- "updatedAt": "2026-03-04T00:00:00.000Z",
+ "updatedAt": "2026-04-13T00:00:00.000Z",
"tokenizerConfig": null,
"tokenizerId": "claude",
"pricingTiers": [
@@ -3355,6 +3373,7 @@
"input_cache_creation_5m": 6.25e-6,
"input_cache_creation_1h": 10e-6,
"cache_read_input_tokens": 0.5e-6,
+ "input_cached_tokens": 0.5e-6,
"input_cache_read": 0.5e-6
}
}