@swiss-ai-hub/web 0.319.0 → 0.320.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -157,6 +157,12 @@ import type {
157
157
  GetLitellmModelsByModeResponse,
158
158
  GetLitellmModelsData,
159
159
  GetLitellmModelsResponse,
160
+ GetLlmSpendByTenantData,
161
+ GetLlmSpendByTenantError,
162
+ GetLlmSpendByTenantResponse,
163
+ GetLlmSpendByUserData,
164
+ GetLlmSpendByUserError,
165
+ GetLlmSpendByUserResponse,
160
166
  GetLocaleData,
161
167
  GetLocaleResponse,
162
168
  GetModelsData,
@@ -875,6 +881,72 @@ export const getAgentEventTimeseries = <
875
881
  ...options,
876
882
  });
877
883
 
884
+ /**
885
+ * Get Llm Spend By User
886
+ *
887
+ * LLM spend per user, from the platform's own cost events.
888
+ *
889
+ * Scoped to the caller's acting tenant: spend reveals who used which agents and how much,
890
+ * so a tenant admin must not see other tenants' users. Only a sysadmin, who acts outside
891
+ * any single tenant, sees the whole platform.
892
+ */
893
+ export const getLlmSpendByUser = <
894
+ TComposable extends Composable = "$fetch",
895
+ DefaultT extends GetLlmSpendByUserResponse = GetLlmSpendByUserResponse,
896
+ >(
897
+ options: Options<
898
+ TComposable,
899
+ GetLlmSpendByUserData,
900
+ GetLlmSpendByUserResponse,
901
+ DefaultT
902
+ >,
903
+ ) =>
904
+ (options.client ?? client).get<
905
+ TComposable,
906
+ GetLlmSpendByUserResponse | DefaultT,
907
+ GetLlmSpendByUserError,
908
+ DefaultT
909
+ >({
910
+ security: [
911
+ { scheme: "bearer", type: "http" },
912
+ { scheme: "bearer", type: "http" },
913
+ ],
914
+ url: "/{tenant_id}/events/spend/users",
915
+ ...options,
916
+ });
917
+
918
+ /**
919
+ * Get Llm Spend By Tenant
920
+ *
921
+ * LLM spend per tenant across the whole platform.
922
+ *
923
+ * Sysadmin-only: a cross-tenant total is exactly the view a single tenant must not have.
924
+ */
925
+ export const getLlmSpendByTenant = <
926
+ TComposable extends Composable = "$fetch",
927
+ DefaultT extends GetLlmSpendByTenantResponse = GetLlmSpendByTenantResponse,
928
+ >(
929
+ options: Options<
930
+ TComposable,
931
+ GetLlmSpendByTenantData,
932
+ GetLlmSpendByTenantResponse,
933
+ DefaultT
934
+ >,
935
+ ) =>
936
+ (options.client ?? client).get<
937
+ TComposable,
938
+ GetLlmSpendByTenantResponse | DefaultT,
939
+ GetLlmSpendByTenantError,
940
+ DefaultT
941
+ >({
942
+ security: [
943
+ { scheme: "bearer", type: "http" },
944
+ { scheme: "bearer", type: "http" },
945
+ ],
946
+ url: "/{tenant_id}/events/spend/tenants",
947
+ ...options,
948
+ });
949
+
878
950
  /**
879
951
  * Get Litellm Models
880
952
  *