Skip to main content
Clear the execution result cache to free memory or force re-execution of previously cached code.

Endpoint

POST /cache/clear

Request

Headers

Authorization: Bearer YOUR_JWT_TOKEN

Example Request

curl -X POST https://sandbox_abc123xyz.hopx.dev/cache/clear \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

Success (200 OK)

{
  "message": "Cache cleared successfully",
  "cleared_entries": 25,
  "freed_bytes": 512000
}

Status Codes

CodeDescription
200Cache cleared
401Unauthorized

Use Cases

Force Code Re-execution

# Clear cache
curl -X POST https://sandbox_abc123xyz.hopx.dev/cache/clear \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

# Execute code (will not use cache)
curl -X POST https://sandbox_abc123xyz.hopx.dev/execute \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "print(\"Fresh execution\")",
    "language": "python"
  }'

Next Steps