6. Let the hyperbola $\frac{x^{2}}{a^{2}}-\frac{y^{2}}{b^{2}}=1(a>0, b>0)$ have its left and right foci as $F_{1}$ and $F_{2}$, respectively, and let $A$ be a point on the asymptote of the hyperbola such that $A F_{2} \perp F_{1} F_{2}$. The distance from the origin $O$ to the line $A F_{1}$ is $\frac{1}{3}\left|O F_{1}\right|$. Then the eccentricity of the hyperbola is
6. $\frac{\sqrt{6}}{2}$.

Given that the distance from point $O$ to line $A F_{1}$ is $\frac{1}{3}\left|O F_{1}\right|$, we know $\sin \angle A F_{1} F_{2}=\frac{1}{3}$.
Then $\tan \angle A F_{1} F_{2}=\frac{\left|A F_{2}\right|}{\left|F_{1} F_{2}\right|}=\frac{1}{2 \sqrt{2}}$. Let $F_{1} F_{2}=2 c$, and the equation of the asymptote is $y=\frac{b}{a} x$.
Thus, $A\left(c, \frac{b c}{a}\right)$.
From equation (1), we get
bc
$\frac{\frac{a}{2 c}}{2 c}=\frac{1}{2 \sqrt{2}} \Rightarrow \frac{b}{a}=\frac{\sqrt{2}}{2}$
$\Rightarrow e=\frac{c}{a}=\sqrt{\frac{a^{2}+b^{2}}{a^{2}}}=\sqrt{1+\left(\frac{b}{a}\right)^{2}}=\frac{\sqrt{6}}{2}$.