5. Let $A$ and $B$ be the two intersection points of the line $y=kx+1$ and the hyperbola $3x^2-y^2=1$, and let $O$ be the origin. If $\triangle OAB$ is a right triangle, then $k=$ $\qquad$ .
5. $\pm 1$.

Let $A\left(x_{1}, k x_{1}+1\right) 、 B\left(x_{2}, k x_{2}+1\right)$.
From $O A \perp O B$ we get
$$
x_{1} x_{2}+\left(k x_{1}+1\right)\left(k x_{2}+1\right)=0 \text {, }
$$

which simplifies to $\left(1+k^{2}\right) x_{1} x_{2}+k\left(x_{1}+x_{2}\right)+1=0$.
Substituting $y=k x+1$ into $3 x^{2}-y^{2}=1$, we get
$$
3 x^{2}-(k x+1)^{2}=1 \text {, }
$$

which simplifies to $\left(3-k^{2}\right) x^{2}-2 k x-2=0$,
with roots $x_{1} 、 x_{2}$. Therefore,
$$
x_{1}+x_{2}=\frac{2 k}{3-k^{2}}, x_{1} x_{2}=-\frac{2}{3-k^{2}} \text {. }
$$

Substituting into equation (1) we get
$$
\begin{array}{l}
-\left(1+k^{2}\right) \frac{2}{3-k^{2}}+k \cdot \frac{2 k}{3-k^{2}}+1=0 \\
\Rightarrow-2-2 k^{2}+2 k^{2}+\left(3-k^{2}\right)=0 .
\end{array}
$$

Thus, $k= \pm 1$.