You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/ExamplesContent.tsx
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -175,6 +175,39 @@ ORDER BY total_cost DESC`,
175
175
scope: "environment",
176
176
table: "llm_usage",
177
177
},
178
+
{
179
+
title: "LLM cost by user",
180
+
description:
181
+
"Total LLM cost per user from run tags or AI SDK telemetry metadata. Uses metadata.userId which comes from experimental_telemetry metadata or run tags like user:123.",
182
+
query: `SELECT
183
+
metadata.userId AS user_id,
184
+
SUM(total_cost) AS total_cost,
185
+
SUM(total_tokens) AS total_tokens,
186
+
count() AS call_count
187
+
FROM llm_usage
188
+
WHERE metadata.userId != ''
189
+
GROUP BY metadata.userId
190
+
ORDER BY total_cost DESC
191
+
LIMIT 50`,
192
+
scope: "environment",
193
+
table: "llm_usage",
194
+
},
195
+
{
196
+
title: "LLM cost by metadata key",
197
+
description:
198
+
"Browse all metadata keys and their LLM cost. Metadata comes from run tags (key:value) and AI SDK telemetry metadata.",
"Key-value metadata from run tags (key:value format) and AI SDK telemetry metadata. Access keys with dot notation (metadata.userId) or bracket syntax (metadata['userId']).",
0 commit comments