@acarmisc/backstage-plugin-litellm-backend 0.12.0 → 0.14.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.
- package/config.d.ts +28 -0
- package/dist/client.d.ts +18 -1
- package/dist/client.js +54 -0
- package/dist/index.cjs.js +298 -9
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -1
- package/dist/openapi.js +9 -0
- package/dist/opencode.d.ts +30 -0
- package/dist/opencode.js +13 -0
- package/dist/router.js +196 -9
- package/dist/teamBudgetVisibility.d.ts +48 -0
- package/dist/teamBudgetVisibility.js +76 -0
- package/dist/types.cjs.js.map +1 -1
- package/dist/types.d.ts +46 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -34,6 +34,16 @@ export interface TeamInfo {
|
|
|
34
34
|
/** Spend-reset period for max_budget, e.g. "30d". */
|
|
35
35
|
budget_duration?: string;
|
|
36
36
|
spend: number;
|
|
37
|
+
/**
|
|
38
|
+
* Share of max_budget consumed (0-100), present only on redacted records.
|
|
39
|
+
* Set by the backend when litellm.display.hideTeamBudgetFor* is enabled so
|
|
40
|
+
* clients can render the consumption level without dollar amounts.
|
|
41
|
+
*/
|
|
42
|
+
budget_pct?: number;
|
|
43
|
+
/** ok | near (>=80%) | over (>=100%), present only on redacted records. */
|
|
44
|
+
budget_status?: 'ok' | 'near' | 'over';
|
|
45
|
+
/** True when max_budget/spend were stripped by budget hiding. */
|
|
46
|
+
budget_hidden?: boolean;
|
|
37
47
|
members_with_roles?: TeamMember[];
|
|
38
48
|
models?: string[];
|
|
39
49
|
tpm_limit?: number;
|
|
@@ -273,6 +283,42 @@ export interface PaginatedAuditLogs {
|
|
|
273
283
|
page_size: number;
|
|
274
284
|
total_pages: number;
|
|
275
285
|
}
|
|
286
|
+
/** One row from LiteLLM's `/spend/logs` (per-request spend log entry). */
|
|
287
|
+
export interface SpendLogEntry {
|
|
288
|
+
request_id?: string;
|
|
289
|
+
/** ISO timestamp of the call. */
|
|
290
|
+
startTime?: string;
|
|
291
|
+
endTime?: string;
|
|
292
|
+
spend?: number;
|
|
293
|
+
total_tokens?: number;
|
|
294
|
+
prompt_tokens?: number;
|
|
295
|
+
completion_tokens?: number;
|
|
296
|
+
model?: string;
|
|
297
|
+
/** Virtual key alias or hash the request was billed to. */
|
|
298
|
+
api_key?: string;
|
|
299
|
+
user?: string;
|
|
300
|
+
team_id?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Tags attached to the request (e.g. `channel:backstage`,
|
|
303
|
+
* `session:<thread>`, `invoked-by:<user>`). Shape varies across LiteLLM
|
|
304
|
+
* versions (array or object) and is normalised to a string[].
|
|
305
|
+
*/
|
|
306
|
+
request_tags?: string[] | Record<string, string>;
|
|
307
|
+
/** LiteLLM `metadata` blob; carries trace ids and session grouping. */
|
|
308
|
+
metadata?: Record<string, unknown> | string | null;
|
|
309
|
+
}
|
|
310
|
+
export interface SpendLogsParams {
|
|
311
|
+
/** ISO date `YYYY-MM-DD` (inclusive). */
|
|
312
|
+
start_date: string;
|
|
313
|
+
/** ISO date `YYYY-MM-DD` (inclusive). */
|
|
314
|
+
end_date: string;
|
|
315
|
+
/** Restrict to the given virtual key. */
|
|
316
|
+
api_key?: string;
|
|
317
|
+
user_id?: string;
|
|
318
|
+
team_id?: string;
|
|
319
|
+
/** Max rows to return (LiteLLM caps at 1000 per page). */
|
|
320
|
+
page_size?: number;
|
|
321
|
+
}
|
|
276
322
|
export interface AuditLogsParams {
|
|
277
323
|
page?: number;
|
|
278
324
|
page_size?: number;
|