6. Given that $a$ and $b$ are positive integers, and the parabola $y = a x^{2} + b x + 1$ intersects the $x$-axis at two distinct points $A$ and $B$. If the distances from $A$ and $B$ to the origin are both less than 1, then the minimum value of $a + b$ is ( ).
(A) 16
(B) 10
(C) 4
(D) 1
6. B.

Since $a, b$ are positive integers, we have
$$
-\frac{b}{2 a} < 0 \text{. }
$$

The parabola $y=a x^{2}+b x+1$ intersects the $x$-axis at two distinct points $A$ and $B$, and the distances from points $A$ and $B$ to the origin are both less than 1. Therefore, points $A$ and $B$ lie between 0 and -1. Thus, $a$ and $b$ must satisfy
$$
\left\{\begin{array}{l}
\Delta = b^{2} - 4 a > 0, \\
a - b + 1 > 0, \\
-1 < -\frac{b}{2a} < 0, \\
a > \frac{b^{2}}{4}, \\
a > \frac{b}{2}.
\end{array}\right.
$$

When $\frac{b}{2} \geqslant b-1$, i.e., $b \leqslant 2$, we have $\frac{b^{2}}{4} \leqslant 1$.
Also, $a > \frac{b^{2}}{4} > 2$.
If $b-1 \geqslant \frac{b^{2}}{4}$, then $(b-2)^{2} \leqslant 0$, so $b = 2$.
Thus, $a > \frac{2^{2}}{4} = 1$, and the smallest value of $a$ is 2.
Therefore, the minimum value of $a + b$ is 4.

If $b > 2$, then $b-1 < \frac{b^{2}}{4}$, and $a > \frac{b^{2}}{4} > 4$. Taking the smallest value of $a = 5$.
Hence, the minimum value of $a + b$ is 10.