@cotofe/service-of-litellm
Version:
OpenAPI client for @cotofe/service-of-litellm
173 lines (172 loc) • 16 kB
TypeScript
/**
* Platform
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { GroupByDimension, IpAddress, LiteLlmSpendLogs, SpendAnalyticsPaginatedResponse, SpendCalculateRequest } from '../models/index';
import * as runtime from '../runtime';
export interface BudgetSpendTrackingApiAddAllowedIpAddAllowedIpPostRequest {
ipAddress?: IpAddress;
}
export interface BudgetSpendTrackingApiCalculateSpendSpendCalculatePostRequest {
spendCalculateRequest?: SpendCalculateRequest;
}
export interface BudgetSpendTrackingApiDeleteAllowedIpDeleteAllowedIpPostRequest {
ipAddress?: IpAddress;
}
export interface BudgetSpendTrackingApiGetGlobalSpendReportGlobalSpendReportGetRequest {
startDate?: string | null;
endDate?: string | null;
groupBy?: GetGlobalSpendReportGlobalSpendReportGetGroupByEnum;
apiKey?: string | null;
internalUserId?: string | null;
teamId?: string | null;
customerId?: string | null;
}
export interface BudgetSpendTrackingApiGetUserDailyActivityUserDailyActivityGetRequest {
startDate?: string | null;
endDate?: string | null;
groupBy?: Array<GroupByDimension>;
viewBy?: GetUserDailyActivityUserDailyActivityGetViewByEnum;
teamId?: string | null;
orgId?: string | null;
model?: string | null;
apiKey?: string | null;
page?: number;
pageSize?: number;
}
export interface BudgetSpendTrackingApiGlobalViewSpendTagsGlobalSpendTagsGetRequest {
startDate?: string | null;
endDate?: string | null;
tags?: string | null;
}
export interface BudgetSpendTrackingApiViewSpendLogsSpendLogsGetRequest {
apiKey?: string | null;
userId?: string | null;
requestId?: string | null;
startDate?: string | null;
endDate?: string | null;
}
export interface BudgetSpendTrackingApiViewSpendTagsSpendTagsGetRequest {
startDate?: string | null;
endDate?: string | null;
}
/**
*
*/
export declare class BudgetSpendTrackingApi extends runtime.BaseAPI {
/**
*
* Add Allowed Ip
*/
addAllowedIpAddAllowedIpPostRaw(requestParameters: BudgetSpendTrackingApiAddAllowedIpAddAllowedIpPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
/**
*
* Add Allowed Ip
*/
addAllowedIpAddAllowedIpPost(requestParameters?: BudgetSpendTrackingApiAddAllowedIpAddAllowedIpPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
/**
* Accepts all the params of completion_cost. Calculate spend **before** making call: Note: If you see a spend of $0.0 you need to set custom_pricing for your model: https://docs.litellm.ai/docs/proxy/custom_pricing ``` curl --location \'http://localhost:4000/spend/calculate\' --header \'Authorization: Bearer sk-1234\' --header \'Content-Type: application/json\' --data \'{ \"model\": \"anthropic.claude-v2\", \"messages\": [{\"role\": \"user\", \"content\": \"Hey, how\'\'\'s it going?\"}] }\' ``` Calculate spend **after** making call: ``` curl --location \'http://localhost:4000/spend/calculate\' --header \'Authorization: Bearer sk-1234\' --header \'Content-Type: application/json\' --data \'{ \"completion_response\": { \"id\": \"chatcmpl-123\", \"object\": \"chat.completion\", \"created\": 1677652288, \"model\": \"gpt-3.5-turbo-0125\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\": [{ \"index\": 0, \"message\": { \"role\": \"assistant\", \"content\": \"Hello there, how may I assist you today?\" }, \"logprobs\": null, \"finish_reason\": \"stop\" }] \"usage\": { \"prompt_tokens\": 9, \"completion_tokens\": 12, \"total_tokens\": 21 } } }\' ```
* Calculate Spend
*/
calculateSpendSpendCalculatePostRaw(requestParameters: BudgetSpendTrackingApiCalculateSpendSpendCalculatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
/**
* Accepts all the params of completion_cost. Calculate spend **before** making call: Note: If you see a spend of $0.0 you need to set custom_pricing for your model: https://docs.litellm.ai/docs/proxy/custom_pricing ``` curl --location \'http://localhost:4000/spend/calculate\' --header \'Authorization: Bearer sk-1234\' --header \'Content-Type: application/json\' --data \'{ \"model\": \"anthropic.claude-v2\", \"messages\": [{\"role\": \"user\", \"content\": \"Hey, how\'\'\'s it going?\"}] }\' ``` Calculate spend **after** making call: ``` curl --location \'http://localhost:4000/spend/calculate\' --header \'Authorization: Bearer sk-1234\' --header \'Content-Type: application/json\' --data \'{ \"completion_response\": { \"id\": \"chatcmpl-123\", \"object\": \"chat.completion\", \"created\": 1677652288, \"model\": \"gpt-3.5-turbo-0125\", \"system_fingerprint\": \"fp_44709d6fcb\", \"choices\": [{ \"index\": 0, \"message\": { \"role\": \"assistant\", \"content\": \"Hello there, how may I assist you today?\" }, \"logprobs\": null, \"finish_reason\": \"stop\" }] \"usage\": { \"prompt_tokens\": 9, \"completion_tokens\": 12, \"total_tokens\": 21 } } }\' ```
* Calculate Spend
*/
calculateSpendSpendCalculatePost(requestParameters?: BudgetSpendTrackingApiCalculateSpendSpendCalculatePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
/**
*
* Delete Allowed Ip
*/
deleteAllowedIpDeleteAllowedIpPostRaw(requestParameters: BudgetSpendTrackingApiDeleteAllowedIpDeleteAllowedIpPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
/**
*
* Delete Allowed Ip
*/
deleteAllowedIpDeleteAllowedIpPost(requestParameters?: BudgetSpendTrackingApiDeleteAllowedIpDeleteAllowedIpPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
/**
* Get Daily Spend per Team, based on specific startTime and endTime. Per team, view usage by each key, model [ { \"group-by-day\": \"2024-05-10\", \"teams\": [ { \"team_name\": \"team-1\" \"spend\": 10, \"keys\": [ \"key\": \"1213\", \"usage\": { \"model-1\": { \"cost\": 12.50, \"input_tokens\": 1000, \"output_tokens\": 5000, \"requests\": 100 }, \"audio-modelname1\": { \"cost\": 25.50, \"seconds\": 25, \"requests\": 50 }, } } ] ] }
* Get Global Spend Report
*/
getGlobalSpendReportGlobalSpendReportGetRaw(requestParameters: BudgetSpendTrackingApiGetGlobalSpendReportGlobalSpendReportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LiteLlmSpendLogs>>>;
/**
* Get Daily Spend per Team, based on specific startTime and endTime. Per team, view usage by each key, model [ { \"group-by-day\": \"2024-05-10\", \"teams\": [ { \"team_name\": \"team-1\" \"spend\": 10, \"keys\": [ \"key\": \"1213\", \"usage\": { \"model-1\": { \"cost\": 12.50, \"input_tokens\": 1000, \"output_tokens\": 5000, \"requests\": 100 }, \"audio-modelname1\": { \"cost\": 25.50, \"seconds\": 25, \"requests\": 50 }, } } ] ] }
* Get Global Spend Report
*/
getGlobalSpendReportGlobalSpendReportGet(requestParameters?: BudgetSpendTrackingApiGetGlobalSpendReportGlobalSpendReportGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LiteLlmSpendLogs>>;
/**
* [BETA] This is a beta endpoint. It will change. Meant to optimize querying spend data for analytics for a user. Returns: (by date/team/org/user/model/api_key/model_group/provider) - spend - prompt_tokens - completion_tokens - total_tokens - api_requests - breakdown by team, organization, user, model, api_key, model_group, provider
* Get User Daily Activity
*/
getUserDailyActivityUserDailyActivityGetRaw(requestParameters: BudgetSpendTrackingApiGetUserDailyActivityUserDailyActivityGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SpendAnalyticsPaginatedResponse>>;
/**
* [BETA] This is a beta endpoint. It will change. Meant to optimize querying spend data for analytics for a user. Returns: (by date/team/org/user/model/api_key/model_group/provider) - spend - prompt_tokens - completion_tokens - total_tokens - api_requests - breakdown by team, organization, user, model, api_key, model_group, provider
* Get User Daily Activity
*/
getUserDailyActivityUserDailyActivityGet(requestParameters?: BudgetSpendTrackingApiGetUserDailyActivityUserDailyActivityGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SpendAnalyticsPaginatedResponse>;
/**
* ADMIN ONLY / MASTER KEY Only Endpoint Globally reset spend for All API Keys and Teams, maintain LiteLLM_SpendLogs 1. LiteLLM_SpendLogs will maintain the logs on spend, no data gets deleted from there 2. LiteLLM_VerificationTokens spend will be set = 0 3. LiteLLM_TeamTable spend will be set = 0
* Global Spend Reset
*/
globalSpendResetGlobalSpendResetPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
/**
* ADMIN ONLY / MASTER KEY Only Endpoint Globally reset spend for All API Keys and Teams, maintain LiteLLM_SpendLogs 1. LiteLLM_SpendLogs will maintain the logs on spend, no data gets deleted from there 2. LiteLLM_VerificationTokens spend will be set = 0 3. LiteLLM_TeamTable spend will be set = 0
* Global Spend Reset
*/
globalSpendResetGlobalSpendResetPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
/**
* LiteLLM Enterprise - View Spend Per Request Tag. Used by LiteLLM UI Example Request: ``` curl -X GET \"http://0.0.0.0:4000/spend/tags\" -H \"Authorization: Bearer sk-1234\" ``` Spend with Start Date and End Date ``` curl -X GET \"http://0.0.0.0:4000/spend/tags?start_date=2022-01-01&end_date=2022-02-01\" -H \"Authorization: Bearer sk-1234\" ```
* Global View Spend Tags
*/
globalViewSpendTagsGlobalSpendTagsGetRaw(requestParameters: BudgetSpendTrackingApiGlobalViewSpendTagsGlobalSpendTagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LiteLlmSpendLogs>>>;
/**
* LiteLLM Enterprise - View Spend Per Request Tag. Used by LiteLLM UI Example Request: ``` curl -X GET \"http://0.0.0.0:4000/spend/tags\" -H \"Authorization: Bearer sk-1234\" ``` Spend with Start Date and End Date ``` curl -X GET \"http://0.0.0.0:4000/spend/tags?start_date=2022-01-01&end_date=2022-02-01\" -H \"Authorization: Bearer sk-1234\" ```
* Global View Spend Tags
*/
globalViewSpendTagsGlobalSpendTagsGet(requestParameters?: BudgetSpendTrackingApiGlobalViewSpendTagsGlobalSpendTagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LiteLlmSpendLogs>>;
/**
* View all spend logs, if request_id is provided, only logs for that request_id will be returned Example Request for all logs ``` curl -X GET \"http://0.0.0.0:8000/spend/logs\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific request_id ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?request_id=chatcmpl-6dcb2540-d3d7-4e49-bb27-291f863f112e\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific api_key ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?api_key=sk-Fn8Ej39NkBQmUagFEoUWPQ\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific user_id ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai\" -H \"Authorization: Bearer sk-1234\" ```
* View Spend Logs
*/
viewSpendLogsSpendLogsGetRaw(requestParameters: BudgetSpendTrackingApiViewSpendLogsSpendLogsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LiteLlmSpendLogs>>>;
/**
* View all spend logs, if request_id is provided, only logs for that request_id will be returned Example Request for all logs ``` curl -X GET \"http://0.0.0.0:8000/spend/logs\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific request_id ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?request_id=chatcmpl-6dcb2540-d3d7-4e49-bb27-291f863f112e\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific api_key ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?api_key=sk-Fn8Ej39NkBQmUagFEoUWPQ\" -H \"Authorization: Bearer sk-1234\" ``` Example Request for specific user_id ``` curl -X GET \"http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai\" -H \"Authorization: Bearer sk-1234\" ```
* View Spend Logs
*/
viewSpendLogsSpendLogsGet(requestParameters?: BudgetSpendTrackingApiViewSpendLogsSpendLogsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LiteLlmSpendLogs>>;
/**
* LiteLLM Enterprise - View Spend Per Request Tag Example Request: ``` curl -X GET \"http://0.0.0.0:8000/spend/tags\" -H \"Authorization: Bearer sk-1234\" ``` Spend with Start Date and End Date ``` curl -X GET \"http://0.0.0.0:8000/spend/tags?start_date=2022-01-01&end_date=2022-02-01\" -H \"Authorization: Bearer sk-1234\" ```
* View Spend Tags
*/
viewSpendTagsSpendTagsGetRaw(requestParameters: BudgetSpendTrackingApiViewSpendTagsSpendTagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LiteLlmSpendLogs>>>;
/**
* LiteLLM Enterprise - View Spend Per Request Tag Example Request: ``` curl -X GET \"http://0.0.0.0:8000/spend/tags\" -H \"Authorization: Bearer sk-1234\" ``` Spend with Start Date and End Date ``` curl -X GET \"http://0.0.0.0:8000/spend/tags?start_date=2022-01-01&end_date=2022-02-01\" -H \"Authorization: Bearer sk-1234\" ```
* View Spend Tags
*/
viewSpendTagsSpendTagsGet(requestParameters?: BudgetSpendTrackingApiViewSpendTagsSpendTagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LiteLlmSpendLogs>>;
}
/**
* @export
* @enum {string}
*/
export declare enum GetGlobalSpendReportGlobalSpendReportGetGroupByEnum {
Team = "team",
Customer = "customer",
ApiKey = "api_key"
}
/**
* @export
* @enum {string}
*/
export declare enum GetUserDailyActivityUserDailyActivityGetViewByEnum {
Team = "team",
Organization = "organization",
User = "user"
}