# Purge the private cache (/docs/api/cache/cache_purge)

Delete cached records by `key`, `tag` or `capability`, or everything with `all=true` (crypto-shreds the workspace cache key: nothing sealed before can be read again).

`DELETE /v1/cache`

```json
{
  "operationId": "cache_purge",
  "summary": "Purge the private cache",
  "description": "Delete cached records by `key`, `tag` or `capability`, or everything with `all=true` (crypto-shreds the workspace cache key: nothing sealed before can be read again).",
  "tags": [
    "cache"
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      },
      "required": false,
      "name": "key",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{1,80}$"
      },
      "required": false,
      "name": "tag",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "pattern": "^[a-z0-9._-]{1,120}$"
      },
      "required": false,
      "name": "capability",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "enum": [
          "true"
        ]
      },
      "required": false,
      "name": "all",
      "in": "query"
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "object": {
                "type": "string",
                "enum": [
                  "cache_purge"
                ]
              },
              "purged": {
                "type": "integer",
                "minimum": 0
              },
              "shredded": {
                "type": "boolean"
              }
            },
            "required": [
              "object",
              "purged",
              "shredded"
            ]
          }
        }
      }
    },
    "default": {
      "description": "Error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "unauthorized",
                      "insufficient_balance",
                      "max_cost_exceeded",
                      "scope_denied",
                      "budget_blocked",
                      "not_found",
                      "idempotency_mismatch",
                      "invalid_meta",
                      "rate_limited",
                      "upstream_error",
                      "response_buffer_limit",
                      "provider_capacity_unavailable",
                      "grid_saturated",
                      "upstream_timeout",
                      "conflict",
                      "internal_error",
                      "account_frozen",
                      "strict_filters",
                      "plan_limit_reached",
                      "validation_failed",
                      "deadline_exceeded",
                      "cancelled"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "retry_after_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
