You can use relationships between different tori. For instance, your torus lives in a long exact sequence
$T\to \mathbb G_m (\mathbb Q(i)) \to \mathbb G_m (\mathbb Q)$$T\to \operatorname {Res} _{\mathbb Q(i) / \mathbb Q } \mathbb G_m \to \mathbb G_m $
This gives you a cohomology long exact sequence which relates your class number to:
$ H^0( \mathbb Z, \operatorname {Res} _{\mathbb Q(i) / \mathbb Q } \mathbb G_m) \to H^0( \mathbb Z, \mathbb G_m) \to H^1(\mathbb Z, T) \to H^1 ( \mathbb Z, \operatorname {Res} _{\mathbb Q(i) / \mathbb Q }\mathbb G_m ) \to H^1(\mathbb Z, \mathbb G_m)$
Equivalently:
$ H^0( \mathbb Z[i], \mathbb G_m) \to H^0( \mathbb Z, \mathbb G_m) \to H^1(\mathbb Z, T) \to H^1 ( \mathbb Z[i], \mathbb G_m ) \to H^1(\mathbb Z, \mathbb G_m)$
Evaluating the class numbers and$H^0$s as unit groups ofand $H^1$s as class groups:
$ \mu_4 \to \mu_2 \to H^1(\mathbb Z, T) \to 0 \to 1$
The map $\mu_4 \to \mu_2$ is the fields. In this casenorm map, I thinkwhich is trivial, hence $H^1(\mathbb Z, T) = \mu_2$, and the class number is $2$, corresponding to the twist $x^2+ y^2=-1$.
You can probably do this in general but you need a spectral sequence.