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
- object_permission: Optional[LiteLLM_ObjectPermissionBase] - key-specific object permission, as on /key/update
Only the fields an item carries are written: a field left out keeps its current value, and a field sent explicitly, null included, is applied exactly as /key/update applies it.
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
Request
- Base URL: https://apiclaw.biz (the document declares no server; this is the origin it was published from)
- URL: https://apiclaw.biz/key/bulk_update
- Auth: API key in header x-litellm-api-key
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
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.