---
title: "Block Key"
method: POST
path: "/key/block"
tags: ["key management"]
---

# Block Key

`POST /key/block`

Block an Virtual key from making any requests.

Parameters:
- key: str - The key to block. Can be either the unhashed key (sk-...) or the hashed key value

 Example:
```bash
curl --location 'http://0.0.0.0:4000/key/block'     --header 'Authorization: Bearer sk-1234'     --header 'Content-Type: application/json'     --data '{
    "key": "sk-Fn8Ej39NxjAXrvpUGKghGw"
}'
```

Note: This is an admin-only endpoint. Only proxy admins, team admins, or org admins can block keys.

## Headers

- `litellm-changed-by` string, 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

- BlockKeyRequest
  - `key` string, required

## Response `200`

Successful Response

- LiteLLMVerificationToken
  - `token` string, nullable
  - `key_name` string, nullable
  - `key_alias` string, nullable
  - `spend` number
  - `max_budget` number, nullable
  - `expires` union
    - string
    - string, date-time
  - `models` unknown[]
    - unknown
  - `aliases` object
  - `config` object
  - `user_id` string, nullable
  - `team_id` string, nullable
  - `agent_id` string, nullable
  - `project_id` string, nullable
  - `max_parallel_requests` integer, nullable
  - `metadata` object
  - `tpm_limit` integer, nullable
  - `rpm_limit` integer, nullable
  - `budget_duration` string, nullable
  - `budget_reset_at` string, date-time, nullable
  - `allowed_cache_controls` unknown[], nullable
    - unknown
  - `allowed_routes` unknown[], nullable
    - unknown
  - `permissions` object
  - `model_spend` object
  - `model_max_budget` object
  - `soft_budget_cooldown` boolean
  - `blocked` boolean, nullable
  - `litellm_budget_table` object, nullable
  - `org_id` string, nullable
  - `created_at` string, date-time, nullable
  - `created_by` string, nullable
  - `updated_at` string, date-time, nullable
  - `updated_by` string, nullable
  - `last_active` string, date-time, nullable
  - `object_permission_id` string, nullable
  - `object_permission` LiteLLMObjectPermissionTable — Represents a LiteLLM_ObjectPermissionTable record
    - `object_permission_id` string, required
    - `mcp_servers` string[], nullable
    - `mcp_access_groups` string[], nullable
    - `mcp_tool_permissions` object, nullable
    - `vector_stores` string[], nullable
    - `agents` string[], nullable
    - `agent_access_groups` string[], nullable
    - `mcp_toolsets` string[], nullable
    - `blocked_tools` string[], nullable
    - `search_tools` string[], nullable
  - `access_group_ids` string[], nullable
  - `rotation_count` integer, nullable
  - `auto_rotate` boolean, nullable
  - `rotation_interval` string, nullable
  - `last_rotation_at` string, date-time, nullable
  - `key_rotation_at` string, date-time, nullable
  - `router_settings` object, nullable
  - `budget_limits` object[], nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/flock/apis/litellm-api.md) · [All operations](https://skmtc.net/flock/apis/litellm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flock/litellm-api/revisions/8fbaab4fc7c5/schema)
