Block

Block Key

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:

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 can block keys.

POST/key/block
Authorization
Header parameters
Body
key*Key
Response

Successful Response

Body
Response Block Key Key Block Post
Request
const response = await fetch('/key/block', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "key": "text"
    }),
});
const data = await response.json();
Response
{
  "token": "text",
  "key_name": "text",
  "key_alias": "text",
  "spend": 0,
  "max_budget": 0,
  "expires": "text",
  "models": [],
  "user_id": "text",
  "team_id": "text",
  "max_parallel_requests": 0,
  "tpm_limit": 0,
  "rpm_limit": 0,
  "budget_duration": "text",
  "budget_reset_at": "2025-01-29T19:58:01.026Z",
  "allowed_cache_controls": [],
  "soft_budget_cooldown": false,
  "blocked": false,
  "org_id": "text",
  "created_at": "2025-01-29T19:58:01.026Z",
  "updated_at": "2025-01-29T19:58:01.026Z"
}