- Add mask_api_key() and is_masked_or_placeholder() to llm_provider service - Return masked keys in all provider CRUD endpoints - Reject masked/placeholder keys in fetch_models and test_provider_config - Show masked key with Change button in ProviderConfig.svelte edit form - Exclude masked keys from fetch-models, test, and submit payloads on frontend - Update semantics-core skill with clarified complexity tier rules - Switch agent modes from subagent to all
299 lines
9.3 KiB
JSON
299 lines
9.3 KiB
JSON
{
|
|
"/global/spend/report": {
|
|
"get": {
|
|
"tags": [
|
|
"Budget & Spend Tracking"
|
|
],
|
|
"summary": "Get Global Spend Report",
|
|
"description": "Get Daily Spend per Team, based on specific startTime and endTime. Per team, view usage by each key, model\n[\n {\n \"group-by-day\": \"2024-05-10\",\n \"teams\": [\n {\n \"team_name\": \"team-1\"\n \"spend\": 10,\n \"keys\": [\n \"key\": \"1213\",\n \"usage\": {\n \"model-1\": {\n \"cost\": 12.50,\n \"input_tokens\": 1000,\n \"output_tokens\": 5000,\n \"requests\": 100\n },\n \"audio-modelname1\": {\n \"cost\": 25.50,\n \"seconds\": 25,\n \"requests\": 50\n },\n }\n }\n ]\n ]\n}",
|
|
"operationId": "get_global_spend_report_global_spend_report_get",
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "start_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Time from which to start viewing spend",
|
|
"title": "Start Date"
|
|
},
|
|
"description": "Time from which to start viewing spend"
|
|
},
|
|
{
|
|
"name": "end_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Time till which to view spend",
|
|
"title": "End Date"
|
|
},
|
|
"description": "Time till which to view spend"
|
|
},
|
|
{
|
|
"name": "group_by",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"enum": [
|
|
"team",
|
|
"customer",
|
|
"api_key"
|
|
],
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Group spend by internal team or customer or api_key",
|
|
"default": "team",
|
|
"title": "Group By"
|
|
},
|
|
"description": "Group spend by internal team or customer or api_key"
|
|
},
|
|
{
|
|
"name": "api_key",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "View spend for a specific api_key. Example api_key='sk-1234",
|
|
"title": "Api Key"
|
|
},
|
|
"description": "View spend for a specific api_key. Example api_key='sk-1234"
|
|
},
|
|
{
|
|
"name": "internal_user_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "View spend for a specific internal_user_id. Example internal_user_id='1234",
|
|
"title": "Internal User Id"
|
|
},
|
|
"description": "View spend for a specific internal_user_id. Example internal_user_id='1234"
|
|
},
|
|
{
|
|
"name": "team_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "View spend for a specific team_id. Example team_id='1234",
|
|
"title": "Team Id"
|
|
},
|
|
"description": "View spend for a specific team_id. Example team_id='1234"
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "View spend for a specific customer_id. Example customer_id='1234. Can be used in conjunction with team_id as well.",
|
|
"title": "Customer Id"
|
|
},
|
|
"description": "View spend for a specific customer_id. Example customer_id='1234. Can be used in conjunction with team_id as well."
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/LiteLLM_SpendLogs"
|
|
},
|
|
"title": "Response 200 Get Global Spend Report Global Spend Report Get"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/global/spend/reset": {
|
|
"post": {
|
|
"tags": [
|
|
"Budget & Spend Tracking"
|
|
],
|
|
"summary": "Global Spend Reset",
|
|
"description": "ADMIN ONLY / MASTER KEY Only Endpoint\n\nGlobally reset spend for All API Keys and Teams, maintain LiteLLM_SpendLogs\n\n1. LiteLLM_SpendLogs will maintain the logs on spend, no data gets deleted from there\n2. LiteLLM_VerificationTokens spend will be set = 0\n3. LiteLLM_TeamTable spend will be set = 0",
|
|
"operationId": "global_spend_reset_global_spend_reset_post",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/global/spend/tags": {
|
|
"get": {
|
|
"tags": [
|
|
"Budget & Spend Tracking"
|
|
],
|
|
"summary": "Global View Spend Tags",
|
|
"description": "LiteLLM Enterprise - View Spend Per Request Tag. Used by LiteLLM UI\n\nExample Request:\n```\ncurl -X GET \"http://0.0.0.0:4000/spend/tags\" -H \"Authorization: Bearer sk-1234\"\n```\n\nSpend with Start Date and End Date\n```\ncurl -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\"\n```",
|
|
"operationId": "global_view_spend_tags_global_spend_tags_get",
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "start_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Time from which to start viewing key spend",
|
|
"title": "Start Date"
|
|
},
|
|
"description": "Time from which to start viewing key spend"
|
|
},
|
|
{
|
|
"name": "end_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Time till which to view key spend",
|
|
"title": "End Date"
|
|
},
|
|
"description": "Time till which to view key spend"
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "comman separated tags to filter on",
|
|
"title": "Tags"
|
|
},
|
|
"description": "comman separated tags to filter on"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/LiteLLM_SpendLogs"
|
|
},
|
|
"title": "Response 200 Global View Spend Tags Global Spend Tags Get"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |