openapi: 3.2.0 info: title: LiteLLM Budget & Spend Tracking API description: "Enterprise Edition \n\nProxy Server to call 100+ LLMs in the OpenAI format. [**Customize Swagger Docs**](https://docs.litellm.ai/docs/proxy/enterprise#swagger-docs---custom-routes--branding)\n\n\U0001F449 [```LiteLLM Admin Panel on /ui```](/ui). Create, Edit Keys with SSO. Having issues? Try [```Fallback Login```](/fallback/login)\n\n\U0001F4B8 [```LiteLLM Model Cost Map```](https://models.litellm.ai/).\n\n\U0001F50E [```LiteLLM Model Hub```](/ui/model_hub_table). See available models on the proxy. [**Docs**](https://docs.litellm.ai/docs/proxy/ai_hub)" version: 1.95.0 x-operator: institution x-provenance: method: probed source: https://llmproxy.uva.nl/openapi.json retrieved: '2026-08-19' note: Document is generated by the LiteLLM proxy software the University of Amsterdam self-hosts; the deployment, the key issuance and the host (llmproxy.uva.nl, UvA Azure) are the institution's. servers[] added by API Evangelist because the served document omits it; nothing else altered. servers: - url: https://llmproxy.uva.nl description: University of Amsterdam / Amsterdam University of Applied Sciences shared AI gateway tags: - name: Budget & Spend Tracking paths: /user/daily/activity: get: tags: - Budget & Spend Tracking summary: Get User Daily Activity description: '[BETA] This is a beta endpoint. It will change. Meant to optimize querying spend data for analytics for a user. Returns: (by date) - spend - prompt_tokens - completion_tokens - cache_read_input_tokens - cache_creation_input_tokens - total_tokens - api_requests - breakdown by model, api_key, provider' operationId: get_user_daily_activity_user_daily_activity_get security: - APIKeyHeader: [] parameters: - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date in YYYY-MM-DD format title: Start Date description: Start date in YYYY-MM-DD format - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date in YYYY-MM-DD format title: End Date description: End date in YYYY-MM-DD format - name: model in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific model title: Model description: Filter by specific model - name: api_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific API key title: Api Key description: Filter by specific API key - name: user_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id. title: User Id description: Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id. - name: page in: query required: false schema: type: integer minimum: 1 description: Page number for pagination default: 1 title: Page description: Page number for pagination - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Items per page default: 50 title: Page Size description: Items per page - name: timezone in: query required: false schema: anyOf: - type: integer - type: 'null' description: Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention. title: Timezone description: Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SpendAnalyticsPaginatedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /user/daily/activity/aggregated: get: tags: - Budget & Spend Tracking summary: Get User Daily Activity Aggregated description: 'Aggregated analytics for a user''s daily activity without pagination. Returns the same response shape as the paginated endpoint with page metadata set to single-page.' operationId: get_user_daily_activity_aggregated_user_daily_activity_aggregated_get security: - APIKeyHeader: [] parameters: - name: start_date in: query required: false schema: anyOf: - type: string - type: 'null' description: Start date in YYYY-MM-DD format title: Start Date description: Start date in YYYY-MM-DD format - name: end_date in: query required: false schema: anyOf: - type: string - type: 'null' description: End date in YYYY-MM-DD format title: End Date description: End date in YYYY-MM-DD format - name: model in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific model title: Model description: Filter by specific model - name: api_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific API key title: Api Key description: Filter by specific API key - name: user_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id. title: User Id description: Filter by specific user ID. Admins can filter by any user or omit for global view. Non-admins must provide their own user_id. - name: timezone in: query required: false schema: anyOf: - type: integer - type: 'null' description: Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention. title: Timezone description: Timezone offset in minutes from UTC (e.g., 480 for PST). Matches JavaScript's Date.getTimezoneOffset() convention. responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SpendAnalyticsPaginatedResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /management/v1/spend_logs/end_users: get: tags: - Budget & Spend Tracking summary: List Spend Log End Users description: 'The distinct end users appearing in spend logs over a time window, for the logs page filter dropdown. Scoped like `/spend/logs/ui`: a proxy admin sees every end user in the window, anyone else sees only end users from their own requests or from teams they administer (or hold the `/spend/logs` permission on). The window is required and the inner scan is capped at SPEND_LOGS_FACET_SCAN_CAP rows, so the query cannot degrade into a full-table scan the way `/global/all_end_users` does. Example curl: ``` curl --location --globoff ''http://0.0.0.0:4000/management/v1/spend_logs/end_users?filter[startTime][gte]=2026-07-23T00:00:00Z&filter[startTime][lte]=2026-07-24T00:00:00Z&page_size=50&q=acme'' --header ''Authorization: Bearer sk-1234'' ```' operationId: list_spend_log_end_users_management_v1_spend_logs_end_users_get security: - APIKeyHeader: [] parameters: - name: filter[startTime][gte] in: query required: true schema: type: string format: date-time description: Window start (UTC when no offset is given) title: Filter[Starttime][Gte] description: Window start (UTC when no offset is given) - name: filter[startTime][lte] in: query required: true schema: type: string format: date-time description: Window end (UTC when no offset is given) title: Filter[Starttime][Lte] description: Window end (UTC when no offset is given) - name: q in: query required: false schema: anyOf: - type: string - type: 'null' description: Case-insensitive partial match on the end user id title: Q description: Case-insensitive partial match on the end user id - name: page in: query required: false schema: type: integer minimum: 1 description: Page number default: 1 title: Page description: Page number - name: page_size in: query required: false schema: type: integer maximum: 100 minimum: 1 description: Page size default: 50 title: Page Size description: Page size responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/FacetListResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /spend/tags: get: tags: - Budget & Spend Tracking summary: View Spend Tags description: '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" ```' operationId: view_spend_tags_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 responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/LiteLLM_SpendLogs' title: Response 200 View Spend Tags Spend Tags Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /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/tags: get: tags: - Budget & Spend Tracking summary: Global View Spend Tags description: '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" ```' 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' /spend/calculate: post: tags: - Budget & Spend Tracking summary: Calculate Spend description: "Accepts all the params of completion_cost.\n\nCalculate spend **before** making call:\n\nNote: 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\n\n```\ncurl --location 'http://localhost:4000/spend/calculate'\n--header 'Authorization: Bearer sk-1234'\n--header 'Content-Type: application/json'\n--data '{\n \"model\": \"anthropic.claude-v2\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Hey, how'''s it going?\"}]\n}'\n```\n\nCalculate spend **after** making call:\n\n```\ncurl --location 'http://localhost:4000/spend/calculate'\n--header 'Authorization: Bearer sk-1234'\n--header 'Content-Type: application/json'\n--data '{\n \"completion_response\": {\n \"id\": \"chatcmpl-123\",\n \"object\": \"chat.completion\",\n \"created\": 1677652288,\n \"model\": \"gpt-3.5-turbo-0125\",\n \"system_fingerprint\": \"fp_44709d6fcb\",\n \"choices\": [{\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello there, how may I assist you today?\"\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }]\n \"usage\": {\n \"prompt_tokens\": 9,\n \"completion_tokens\": 12,\n \"total_tokens\": 21\n }\n }\n}'\n```" operationId: calculate_spend_spend_calculate_post requestBody: content: application/json: schema: $ref: '#/components/schemas/SpendCalculateRequest' required: true responses: '200': description: The calculated cost content: application/json: schema: properties: cost: type: number description: The calculated cost example: 0.0 type: object '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] /spend/logs/v2: get: tags: - Budget & Spend Tracking summary: Ui View Spend Logs description: 'View spend logs with pagination support. Available at both `/spend/logs/v2` (public API) and `/spend/logs/ui` (internal UI). Returns paginated response with data, total, page, page_size, and total_pages. Example: ``` curl -X GET "http://0.0.0.0:8000/spend/logs/v2?start_date=2025-11-25%2000:00:00&end_date=2025-11-26%2023:59:59&page=1&page_size=50" -H "Authorization: Bearer sk-1234" ```' operationId: ui_view_spend_logs_spend_logs_v2_get security: - APIKeyHeader: [] parameters: - name: api_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Get spend logs based on api key title: Api Key description: Get spend logs based on api key - name: user_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Get spend logs based on user_id title: User Id description: Get spend logs based on user_id - name: request_id in: query required: false schema: anyOf: - type: string - type: 'null' description: request_id to get spend logs for specific request_id title: Request Id description: request_id to get spend logs for specific request_id - name: session_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter spend logs by session_id (partial string match) title: Session Id description: Filter spend logs by session_id (partial string match) - name: team_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter spend logs by team_id title: Team Id description: Filter spend logs by team_id - name: min_spend in: query required: false schema: anyOf: - type: number - type: 'null' description: Filter logs with spend greater than or equal to this value title: Min Spend description: Filter logs with spend greater than or equal to this value - name: max_spend in: query required: false schema: anyOf: - type: number - type: 'null' description: Filter logs with spend less than or equal to this value title: Max Spend description: Filter logs with spend less than or equal to this value - 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: page in: query required: false schema: type: integer minimum: 1 description: Page number for pagination default: 1 title: Page description: Page number for pagination - name: page_size in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: Number of items per page default: 50 title: Page Size description: Number of items per page - name: status_filter in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by status (e.g., success, failure) title: Status Filter description: Filter logs by status (e.g., success, failure) - name: model in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by model title: Model description: Filter logs by model - name: model_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by model ID (litellm model deployment id) title: Model Id description: Filter logs by model ID (litellm model deployment id) - name: model_group in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by model group title: Model Group description: Filter logs by model group - name: key_alias in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by key alias title: Key Alias description: Filter logs by key alias - name: end_user in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by end user title: End User description: Filter logs by end user - name: error_code in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by error code (e.g., '404', '500') title: Error Code description: Filter logs by error code (e.g., '404', '500') - name: error_message in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter logs by error message (partial string match) title: Error Message description: Filter logs by error message (partial string match) - name: sort_by in: query required: false schema: type: string description: 'Sort logs by field: spend, total_tokens, startTime, endTime, request_duration_ms, model, or ttft_ms' default: startTime title: Sort By description: 'Sort logs by field: spend, total_tokens, startTime, endTime, request_duration_ms, model, or ttft_ms' - name: sort_order in: query required: false schema: anyOf: - type: string - type: 'null' description: 'Sort order: asc or desc' default: desc title: Sort Order description: 'Sort order: asc or desc' responses: '200': description: Successful Response content: application/json: schema: type: object additionalProperties: true title: Response 200 Ui View Spend Logs Spend Logs V2 Get '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /spend/logs: get: tags: - Budget & Spend Tracking summary: View Spend Logs description: '[DEPRECATED] This endpoint is not paginated and can cause performance issues. Please use `/spend/logs/v2` instead for paginated access to spend logs. View all spend logs, if request_id is provided, only logs for that request_id will be returned When start_date and end_date are provided: - summarize=true (default): Returns aggregated spend data grouped by date (maintains backward compatibility) - summarize=false: Returns filtered individual log entries within the date range 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-test-example-key-123" -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" ``` Example Request for date range with individual logs (unsummarized) ``` curl -X GET "http://0.0.0.0:8000/spend/logs?start_date=2024-01-01&end_date=2024-01-02&summarize=false" -H "Authorization: Bearer sk-1234" ```' operationId: view_spend_logs_spend_logs_get security: - APIKeyHeader: [] parameters: - name: api_key in: query required: false schema: anyOf: - type: string - type: 'null' description: Get spend logs based on api key title: Api Key description: Get spend logs based on api key - name: user_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Get spend logs based on user_id title: User Id description: Get spend logs based on user_id - name: request_id in: query required: false schema: anyOf: - type: string - type: 'null' description: request_id to get spend logs for specific request_id. If none passed then pass spend logs for all requests title: Request Id description: request_id to get spend logs for specific request_id. If none passed then pass spend logs for all requests - 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: summarize in: query required: false schema: type: boolean description: When start_date and end_date are provided, summarize=true returns aggregated data by date (legacy behavior), summarize=false returns filtered individual logs default: true title: Summarize description: When start_date and end_date are provided, summarize=true returns aggregated data by date (legacy behavior), summarize=false returns filtered individual logs responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/LiteLLM_SpendLogs' title: Response 200 View Spend Logs Spend Logs 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 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' operationId: global_spend_reset_global_spend_reset_post responses: '200': description: Successful Response content: application/json: schema: {} security: - APIKeyHeader: [] /add/allowed_ip: post: tags: - Budget & Spend Tracking summary: Add Allowed Ip operationId: add_allowed_ip_add_allowed_ip_post requestBody: content: application/json: schema: $ref: '#/components/schemas/IPAddress' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] /delete/allowed_ip: post: tags: - Budget & Spend Tracking summary: Delete Allowed Ip operationId: delete_allowed_ip_delete_allowed_ip_post requestBody: content: application/json: schema: $ref: '#/components/schemas/IPAddress' required: true responses: '200': description: Successful Response content: application/json: schema: {} '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' security: - APIKeyHeader: [] components: schemas: SpendAnalyticsPaginatedResponse: properties: results: items: $ref: '#/components/schemas/DailySpendData' type: array title: Results metadata: $ref: '#/components/schemas/DailySpendMetadata' type: object required: - results title: SpendAnalyticsPaginatedResponse LiteLLM_SpendLogs: properties: request_id: type: string title: Request Id api_key: type: string title: Api Key model: anyOf: - type: string - type: 'null' title: Model default: '' api_base: anyOf: - type: string - type: 'null' title: Api Base default: '' call_type: type: string title: Call Type spend: anyOf: - type: number - type: 'null' title: Spend default: 0.0 total_tokens: anyOf: - type: integer - type: 'null' title: Total Tokens default: 0 prompt_tokens: anyOf: - type: integer - type: 'null' title: Prompt Tokens default: 0 completion_tokens: anyOf: - type: integer - type: 'null' title: Completion Tokens default: 0 startTime: anyOf: - type: string - type: string format: date-time - type: 'null' title: Starttime endTime: anyOf: - type: string - type: string format: date-time - type: 'null' title: Endtime user: anyOf: - type: string - type: 'null' title: User default: '' metadata: anyOf: - {} - type: 'null' title: Metadata default: {} cache_hit: anyOf: - type: string - type: 'null' title: Cache Hit default: 'False' cache_key: anyOf: - type: string - type: 'null' title: Cache Key request_tags: anyOf: - {} - type: 'null' title: Request Tags requester_ip_address: anyOf: - type: string - type: 'null' title: Requester Ip Address messages: anyOf: - type: string - items: {} type: array - additionalProperties: true type: object - type: 'null' title: Messages response: anyOf: - type: string - items: {} type: array - additionalProperties: true type: object - type: 'null' title: Response type: object required: - request_id - api_key - call_type - startTime - endTime - messages - response title: LiteLLM_SpendLogs DailySpendMetadata: properties: total_spend: type: number title: Total Spend default: 0.0 total_prompt_tokens: type: integer title: Total Prompt Tokens default: 0 total_completion_tokens: type: integer title: Total Completion Tokens default: 0 total_tokens: type: integer title: Total Tokens default: 0 total_api_requests: type: integer title: Total Api Requests default: 0 total_successful_requests: type: integer title: Total Successful Requests default: 0 total_failed_requests: type: integer title: Total Failed Requests default: 0 total_cache_read_input_tokens: type: integer title: Total Cache Read Input Tokens default: 0 total_cache_creation_input_tokens: type: integer title: Total Cache Creation Input Tokens default: 0 total_compression_saved_tokens: type: integer title: Total Compression Saved Tokens default: 0 total_compression_savings_spend: type: number title: Total Compression Savings Spend default: 0.0 total_prompt_caching_savings_spend: type: number title: Total Prompt Caching Savings Spend default: 0.0 page: type: integer title: Page default: 1 total_pages: type: integer title: Total Pages default: 1 has_more: type: boolean title: Has More default: false type: object title: DailySpendMetadata KeyMetadata: properties: key_alias: anyOf: - type: string - type: 'null' title: Key Alias team_id: anyOf: - type: string - type: 'null' title: Team Id type: object title: KeyMetadata description: Metadata for a key PageLinks: properties: self: type: string title: Self prev: anyOf: - type: string - type: 'null' title: Prev next: anyOf: - type: string - type: 'null' title: Next type: object required: - self title: PageLinks description: 'Hypermedia for a paginated list. No `first`/`last`: without a total count the last page is unknown.' SpendCalculateRequest: properties: model: anyOf: - type: string - type: 'null' title: Model messages: anyOf: - items: {} type: array - type: 'null' title: Messages completion_response: anyOf: - additionalProperties: true type: object - type: 'null' title: Completion Response type: object title: SpendCalculateRequest SpendMetrics: properties: spend: type: number title: Spend default: 0.0 prompt_tokens: type: integer title: Prompt Tokens default: 0 completion_tokens: type: integer title: Completion Tokens default: 0 cache_read_input_tokens: type: integer title: Cache Read Input Tokens default: 0 cache_creation_input_tokens: type: integer title: Cache Creation Input Tokens default: 0 compression_saved_tokens: type: integer title: Compression Saved Tokens default: 0 compression_savings_spend: type: number title: Compression Savings Spend default: 0.0 prompt_caching_savings_spend: type: number title: Prompt Caching Savings Spend default: 0.0 total_tokens: type: integer title: Total Tokens default: 0 successful_requests: type: integer title: Successful Requests default: 0 failed_requests: type: integer title: Failed Requests default: 0 api_requests: type: integer title: Api Requests default: 0 type: object title: SpendMetrics DailySpendData: properties: date: type: string format: date title: Date metrics: $ref: '#/components/schemas/SpendMetrics' breakdown: $ref: '#/components/schemas/BreakdownMetrics' type: object required: - date - metrics title: DailySpendData ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError KeyMetricWithMetadata: properties: metrics: $ref: '#/components/schemas/SpendMetrics' metadata: $ref: '#/components/schemas/KeyMetadata' type: object required: - metrics title: KeyMetricWithMetadata description: Base class for metrics with additional metadata MetricWithMetadata: properties: metrics: $ref: '#/components/schemas/SpendMetrics' metadata: additionalProperties: true type: object title: Metadata api_key_breakdown: additionalProperties: $ref: '#/components/schemas/KeyMetricWithMetadata' type: object title: Api Key Breakdown type: object required: - metrics title: MetricWithMetadata HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError FacetListResponse: properties: data: items: type: string type: array title: Data meta: $ref: '#/components/schemas/PageMeta' links: $ref: '#/components/schemas/PageLinks' type: object required: - data - meta - links title: FacetListResponse description: The distinct values one column takes over a filtered query. `data` holds bare values, not entity rows. IPAddress: properties: ip: type: string title: Ip type: object required: - ip title: IPAddress BreakdownMetrics: properties: mcp_servers: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Mcp Servers models: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Models model_groups: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Model Groups providers: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Providers endpoints: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Endpoints api_keys: additionalProperties: $ref: '#/components/schemas/KeyMetricWithMetadata' type: object title: Api Keys entities: additionalProperties: $ref: '#/components/schemas/MetricWithMetadata' type: object title: Entities type: object title: BreakdownMetrics description: Breakdown of spend by different dimensions PageMeta: properties: page: type: integer title: Page page_size: type: integer title: Page Size has_more: type: boolean title: Has More type: object required: - page - page_size - has_more title: PageMeta description: '`has_more` rather than `total_count`, which would need a COUNT(*) over the whole match set per keystroke.' securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key