It depends on the version of opencv, at least for Python.
For opencv-python='4.5.4.60'. The angle is that between positive x-axis and the first line the axis meets when it rotates anti-clock wise. The following is the code to snippet.
import cv2
import numpy as np
box1 = [[0, 0], [1, 0], [1, 2], [0, 2]]
cv2.minAreaRect(np.asarray(box1)) # angel = 90.0
box2 = [[0, 0], [2, 0], [2, 1], [0, 1]]
cv2.minAreaRect(np.asarray(box2)) # angel = 90.0
box3 = [[0, 0], [2**0.5, 2**0.5], [0.5*2**0.5, 1.5*2**0.5], [-0.5*2**0.5, 0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box3, dtype=np.float32)) # angle = 44.999
box4 = [[0, 0], [-2**0.5, 2**0.5], [-0.5*2**0.5, 1.5*2**0.5], [0.5*2**0.5, 0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box4, dtype=np.float32)) # angle = 45.0
box5 = [[0, 0], [-0.5*2**0.5, 0.5*2**0.5], [-2**0.5, 0], [-0.5*2**0.5, -0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box5, dtype=np.float32)) # angle = 45.0
For opencv-python='3.4.13.47'. The angle is that between positive x-axis and the first line the axis meets when it rotates clock wise. The following is the code to snippet.
import cv2
import numpy as np
box1 = [[0, 0], [1, 0], [1, 2], [0, 2]]
cv2.minAreaRect(np.asarray(box1)) # angel = -90.0
box2 = [[0, 0], [2, 0], [2, 1], [0, 1]]
cv2.minAreaRect(np.asarray(box2)) # angel = -90.0
box3 = [[0, 0], [2**0.5, 2**0.5], [0.5*2**0.5, 1.5*2**0.5], [-0.5*2**0.5, 0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box3, dtype=np.float32)) # angle = -44.999
box4 = [[0, 0], [-2**0.5, 2**0.5], [-0.5*2**0.5, 1.5*2**0.5], [0.5*2**0.5, 0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box4, dtype=np.float32)) # angle = -45.0
box5 = [[0, 0], [-0.5*2**0.5, 0.5*2**0.5], [-2**0.5, 0], [-0.5*2**0.5, -0.5*2**0.5]]
cv2.minAreaRect(np.asarray(box5, dtype=np.float32)) # angle = -45.0