You can use relationships between different tori. For instance, your torus lives in a long exact sequence

$T\to \operatorname {Res} _{\mathbb Q(i) / \mathbb Q } \mathbb G_m  \to \mathbb G_m $

This gives you a cohomology long exact sequence:


$ 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 $H^0$s as unit groups and $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 norm map, which is trivial, hence $H^1(\mathbb Z, T) = \mu_2$, and the class number is $2$.

You can probably do this in general but you need a spectral sequence.