The integral is recognized as an even function due to symmetric limits and the even property of \( \cos(\alpha x) \). This allows simplification by doubling the integral from 0 to 1:
\[ \int_{-1}^1 \frac{\cos \alpha x}{1 + 3^x} \, dx = 2 \int_0^1 \frac{\cos \alpha x}{1 + 3^x} \, dx. \]
Given that this integral's value is \( \frac{2}{\pi} \), we test \( \alpha \) values to achieve this result.
Upon evaluation, \( \alpha = \frac{\pi}{2} \) is found to satisfy this condition, resulting in:
\[ \int_{-1}^1 \frac{\cos \left( \frac{\pi}{2} x \right)}{1 + 3^x} \, dx = \frac{\pi}{2}. \]
Consequently, the value of \( \alpha \) is \( \frac{\pi}{2} \).