OpenAPI 3.1.02026-08-226994571.1 MB

1e929292ddd5

key management

Bulk Update Keys

Bulk update multiple keys at once.

This endpoint allows updating multiple keys in a single request. Each key update is processed independently - if some updates fail, others will still succeed.

Parameters:

  • keys: List[BulkUpdateKeyRequestItem] - List of key update requests, each containing:
    • key: str - The key identifier (token) to update
    • budget_id: Optional[str] - Budget ID associated with the key
    • max_budget: Optional[float] - Max budget for key
    • team_id: Optional[str] - Team ID associated with key
    • tags: Optional[List[str]] - Tags for organizing keys

Returns:

  • total_requested: int - Total number of keys requested for update
  • successful_updates: List[SuccessfulKeyUpdate] - List of successfully updated keys with their updated info
  • failed_updates: List[FailedKeyUpdate] - List of failed updates with key_info and failed_reason

Example request:

curl --location 'http://0.0.0.0:4000/key/bulk_update'     --header 'Authorization: Bearer sk-1234'     --header 'Content-Type: application/json'     --data '{
    "keys": [
        {
            "key": "sk-1234",
            "max_budget": 100.0,
            "team_id": "team-123",
            "tags": ["production", "api"]
        },
        {
            "key": "sk-5678",
            "budget_id": "budget-456",
            "tags": ["staging"]
        }
    ]
}'
post/key/bulk_update

Headers

litellm-changed-bystring nullable

The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability

Request body

Response

Successful Response

total_requestedinteger required