- 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
463 lines
17 KiB
JSON
463 lines
17 KiB
JSON
{
|
|
"/customer/block": {
|
|
"post": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "Block User",
|
|
"description": "[BETA] Reject calls with this end-user id\n\nParameters:\n- user_ids (List[str], required): The unique `user_id`s for the users to block\n\n (any /chat/completion call with this user={end-user-id} param, will be rejected.)\n\n ```\n curl -X POST \"http://0.0.0.0:8000/user/block\"\n -H \"Authorization: Bearer sk-1234\"\n -d '{\n \"user_ids\": [<user_id>, ...]\n }'\n ```",
|
|
"operationId": "block_user_customer_block_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BlockUsers"
|
|
}
|
|
}
|
|
},
|
|
"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": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/customer/daily/activity": {
|
|
"get": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "Get Customer Daily Activity",
|
|
"description": "Get daily activity for specific organizations or all accessible organizations.",
|
|
"operationId": "get_customer_daily_activity_customer_daily_activity_get",
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "end_user_ids",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "End User Ids"
|
|
}
|
|
},
|
|
{
|
|
"name": "start_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Start Date"
|
|
}
|
|
},
|
|
{
|
|
"name": "end_date",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "End Date"
|
|
}
|
|
},
|
|
{
|
|
"name": "model",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Model"
|
|
}
|
|
},
|
|
{
|
|
"name": "api_key",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Api Key"
|
|
}
|
|
},
|
|
{
|
|
"name": "page",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 1,
|
|
"title": "Page"
|
|
}
|
|
},
|
|
{
|
|
"name": "page_size",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"default": 10,
|
|
"title": "Page Size"
|
|
}
|
|
},
|
|
{
|
|
"name": "exclude_end_user_ids",
|
|
"in": "query",
|
|
"required": false,
|
|
"schema": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"title": "Exclude End User Ids"
|
|
}
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/customer/delete": {
|
|
"post": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "Delete End User",
|
|
"description": "Delete multiple end-users.\n\nParameters:\n- user_ids (List[str], required): The unique `user_id`s for the users to delete\n\nExample curl:\n```\ncurl --location 'http://0.0.0.0:4000/customer/delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"user_ids\" :[\"ishaan-jaff-5\"]\n}'\n\nSee below for all params \n```",
|
|
"operationId": "delete_end_user_customer_delete_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DeleteCustomerRequest"
|
|
}
|
|
}
|
|
},
|
|
"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": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/customer/info": {
|
|
"get": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "End User Info",
|
|
"description": "Get information about an end-user. An `end_user` is a customer (external user) of the proxy.\n\nParameters:\n- end_user_id (str, required): The unique identifier for the end-user\n\nExample curl:\n```\ncurl -X GET 'http://localhost:4000/customer/info?end_user_id=test-litellm-user-4' -H 'Authorization: Bearer sk-1234'\n```",
|
|
"operationId": "end_user_info_customer_info_get",
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "end_user_id",
|
|
"in": "query",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"description": "End User ID in the request parameters",
|
|
"title": "End User Id"
|
|
},
|
|
"description": "End User ID in the request parameters"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/LiteLLM_EndUserTable"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"422": {
|
|
"description": "Validation Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/customer/list": {
|
|
"get": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "List End User",
|
|
"description": "[Admin-only] List all available customers\n\nExample curl:\n```\ncurl --location --request GET 'http://0.0.0.0:4000/customer/list' --header 'Authorization: Bearer sk-1234'\n```",
|
|
"operationId": "list_end_user_customer_list_get",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successful Response",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"items": {
|
|
"$ref": "#/components/schemas/LiteLLM_EndUserTable"
|
|
},
|
|
"type": "array",
|
|
"title": "Response List End User Customer List Get"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"APIKeyHeader": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/customer/new": {
|
|
"post": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "New End User",
|
|
"description": "Allow creating a new Customer \n\n\nParameters:\n- user_id: str - The unique identifier for the user.\n- alias: Optional[str] - A human-friendly alias for the user.\n- blocked: bool - Flag to allow or disallow requests for this end-user. Default is False.\n- max_budget: Optional[float] - The maximum budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both.\n- budget_id: Optional[str] - The identifier for an existing budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both.\n- allowed_model_region: Optional[Union[Literal[\"eu\"], Literal[\"us\"]]] - Require all user requests to use models in this specific region.\n- default_model: Optional[str] - If no equivalent model in the allowed region, default all requests to this model.\n- metadata: Optional[dict] = Metadata for customer, store information for customer. Example metadata = {\"data_training_opt_out\": True}\n- budget_duration: Optional[str] - Budget is reset at the end of specified duration. If not set, budget is never reset. You can set duration as seconds (\"30s\"), minutes (\"30m\"), hours (\"30h\"), days (\"30d\").\n- tpm_limit: Optional[int] - [Not Implemented Yet] Specify tpm limit for a given customer (Tokens per minute)\n- rpm_limit: Optional[int] - [Not Implemented Yet] Specify rpm limit for a given customer (Requests per minute)\n- model_max_budget: Optional[dict] - [Not Implemented Yet] Specify max budget for a given model. Example: {\"openai/gpt-4o-mini\": {\"max_budget\": 100.0, \"budget_duration\": \"1d\"}}\n- max_parallel_requests: Optional[int] - [Not Implemented Yet] Specify max parallel requests for a given customer.\n- soft_budget: Optional[float] - [Not Implemented Yet] Get alerts when customer crosses given budget, doesn't block requests.\n- spend: Optional[float] - Specify initial spend for a given customer.\n- budget_reset_at: Optional[str] - Specify the date and time when the budget should be reset.\n- object_permission: Optional[LiteLLM_ObjectPermissionBase] - Customer-specific object permissions to control access to resources.\n Supported fields:\n * mcp_servers: List[str] - List of allowed MCP server IDs\n * mcp_access_groups: List[str] - List of MCP access group names\n * mcp_tool_permissions: Dict[str, List[str]] - Map of server ID to allowed tool names (e.g., {\"server_1\": [\"tool_a\", \"tool_b\"]})\n * vector_stores: List[str] - List of allowed vector store IDs\n * agents: List[str] - List of allowed agent IDs\n * agent_access_groups: List[str] - List of agent access group names\n Example: {\"mcp_servers\": [\"server_1\", \"server_2\"], \"vector_stores\": [\"vector_store_1\"], \"agents\": [\"agent_1\"]}\n IF null or {} then no object-level restrictions apply.\n\n\n- Allow specifying allowed regions \n- Allow specifying default model\n\nExample curl:\n```\ncurl --location 'http://0.0.0.0:4000/customer/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"user_id\" : \"ishaan-jaff-3\",\n \"allowed_region\": \"eu\",\n \"budget_id\": \"free_tier\",\n \"default_model\": \"azure/gpt-3.5-turbo-eu\"\n }'\n\n# With object permissions\ncurl -L -X POST 'http://localhost:4000/customer/new' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{\n \"user_id\": \"user_1\",\n \"object_permission\": {\n \"mcp_servers\": [\"server_1\"],\n \"mcp_access_groups\": [\"public_group\"],\n \"vector_stores\": [\"vector_store_1\"]\n }\n }'\n\n # return end-user object\n```\n\nNOTE: This used to be called `/end_user/new`, we will still be maintaining compatibility for /end_user/XXX for these endpoints",
|
|
"operationId": "new_end_user_customer_new_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/NewCustomerRequest"
|
|
}
|
|
}
|
|
},
|
|
"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": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/customer/unblock": {
|
|
"post": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "Unblock User",
|
|
"description": "[BETA] Unblock calls with this user id\n\nExample\n```\ncurl -X POST \"http://0.0.0.0:8000/user/unblock\"\n-H \"Authorization: Bearer sk-1234\"\n-d '{\n\"user_ids\": [<user_id>, ...]\n}'\n```",
|
|
"operationId": "unblock_user_customer_unblock_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BlockUsers"
|
|
}
|
|
}
|
|
},
|
|
"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": []
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"/customer/update": {
|
|
"post": {
|
|
"tags": [
|
|
"Customer Management"
|
|
],
|
|
"summary": "Update End User",
|
|
"description": "Example curl \n\nParameters:\n- user_id: str\n- alias: Optional[str] = None # human-friendly alias\n- blocked: bool = False # allow/disallow requests for this end-user\n- max_budget: Optional[float] = None\n- budget_id: Optional[str] = None # give either a budget_id or max_budget\n- allowed_model_region: Optional[AllowedModelRegion] = (\n None # require all user requests to use models in this specific region\n)\n- default_model: Optional[str] = (\n None # if no equivalent model in allowed region - default all requests to this model\n)\n- object_permission: Optional[LiteLLM_ObjectPermissionBase] - Customer-specific object permissions to control access to resources.\n Supported fields:\n * mcp_servers: List[str] - List of allowed MCP server IDs\n * mcp_access_groups: List[str] - List of MCP access group names\n * mcp_tool_permissions: Dict[str, List[str]] - Map of server ID to allowed tool names\n * vector_stores: List[str] - List of allowed vector store IDs\n * agents: List[str] - List of allowed agent IDs\n * agent_access_groups: List[str] - List of agent access group names\n Example: {\"mcp_servers\": [\"server_1\"], \"vector_stores\": [\"vector_store_1\"]}\n IF null or {} then no object-level restrictions apply.\n\nExample curl:\n```\ncurl --location 'http://0.0.0.0:4000/customer/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"user_id\": \"test-litellm-user-4\",\n \"budget_id\": \"paid_tier\"\n}'\n\n# Updating object permissions\ncurl -L -X POST 'http://localhost:4000/customer/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{\n \"user_id\": \"user_1\",\n \"object_permission\": {\n \"mcp_servers\": [\"server_3\"],\n \"vector_stores\": [\"vector_store_2\", \"vector_store_3\"]\n }\n }'\n\nSee below for all params\n```",
|
|
"operationId": "update_end_user_customer_update_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/UpdateCustomerRequest"
|
|
}
|
|
}
|
|
},
|
|
"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": []
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |