4. Given that $AB$ is a diameter of the smallest circle with center $C(0,1)$ that has common points with the graph of the function $y=\frac{1}{|x|-1}$, and $O$ is the origin. Then $\overrightarrow{O A} \cdot \overrightarrow{O B}$ $=$ $\qquad$
4. -2 .

For any point $P(x, y)$ on the function $y=\frac{1}{|x|-1}(x>1)$, we have
$$
R^{2}=x^{2}+(y-1)^{2}=x^{2}+\left(\frac{1}{x-1}-1\right)^{2} \text {. }
$$

Let $t=x-1$. Then $t>0$,
$$
\begin{array}{l}
R^{2}=(t+1)^{2}+\left(\frac{1}{t}-1\right)^{2} \\
=t^{2}+\frac{1}{t^{2}}+2\left(t-\frac{1}{t}\right)+2 .
\end{array}
$$

Let $u=t-\frac{1}{t}$. Then $R=\sqrt{u^{2}+2 u+4}$.
Thus, when $u=-1$, i.e., $t=\frac{-1 \pm \sqrt{5}}{2}$, or $x=\frac{1 \pm \sqrt{5}}{2}$, the minimum value of $R$ is $\sqrt{3}$.
$$
\begin{array}{l}
\text { Hence } \overrightarrow{O A} \cdot \overrightarrow{O B}=(\overrightarrow{O C}+\overrightarrow{C A}) \cdot(\overrightarrow{O C}+\overrightarrow{C B}) \\
=(\overrightarrow{O C}+\overrightarrow{C A}) \cdot(\overrightarrow{O C}-\overrightarrow{C A}) \\
=\overrightarrow{O C}^{2}-\overrightarrow{C A}^{2}=1-R^{2}=-2 .
\end{array}
$$