Customer Management

Update End User

Example curl

Parameters:

  • user_id: str
  • alias: Optional[str] = None # human-friendly alias
  • blocked: bool = False # allow/disallow requests for this end-user
  • max_budget: Optional[float] = None
  • budget_id: Optional[str] = None # give either a budget_id or max_budget
  • allowed_model_region: Optional[AllowedModelRegion] = ( None # require all user requests to use models in this specific region )
  • default_model: Optional[str] = ( None # if no equivalent model in allowed region - default all requests to this model )
  • object_permission: Optional[LiteLLM_ObjectPermissionBase] - Customer-specific object permissions to control access to resources. Supported fields:
    • mcp_servers: List[str] - List of allowed MCP server IDs
    • mcp_access_groups: List[str] - List of MCP access group names
    • mcp_tool_permissions: Dict[str, List[str]] - Map of server ID to allowed tool names
    • vector_stores: List[str] - List of allowed vector store IDs
    • agents: List[str] - List of allowed agent IDs
    • agent_access_groups: List[str] - List of agent access group names Example: {"mcp_servers": ["server_1"], "vector_stores": ["vector_store_1"]} IF null or {} then no object-level restrictions apply.

Example curl:

curl --location 'http://0.0.0.0:4000/customer/update'     --header 'Authorization: Bearer sk-1234'     --header 'Content-Type: application/json'     --data '{
    "user_id": "test-litellm-user-4",
    "budget_id": "paid_tier"
}'

# Updating object permissions
curl -L -X POST 'http://localhost:4000/customer/update'     --header 'Authorization: Bearer sk-1234'     --header 'Content-Type: application/json'     --data '{
    "user_id": "user_1",
    "object_permission": {
      "mcp_servers": ["server_3"],
      "vector_stores": ["vector_store_2", "vector_store_3"]
    }
  }'

See below for all params
post/customer/update

Request body

user_idstring required
aliasstring nullable
blockedboolean
max_budgetnumber nullable
budget_idstring nullable
allowed_model_region'eu' | 'us' nullable
default_modelstring nullable

Response

Successful Response

user_idstring required
blockedboolean required
aliasstring nullable
spendnumber
allowed_model_region'eu' | 'us' nullable
default_modelstring nullable
budget_idstring nullable
object_permission_idstring nullable

Changes

Changed in 1 of the 42 revisions of this API.113

  • 082b5fabd909113See the full diff
    • ▲

      the response's body type changed from no type to object for status

      response-body-type-changed

    • ○

      added the new optional request property //

      new-optional-request-property

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property // to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the optional property to the response with the status

      response-optional-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    • ○

      added the required property to the response with the status

      response-required-property-added

    This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog