The Gram dimension gd(G) of a graph is the smallest integer k ≥ 1 such that, for every assignment of unit vectors to the nodes of the graph, there exists another assignment of unit vectors lying in R k , having the same inner products on the edges of the graph. The class of graphs satisfying gd(G) ≤ k is minor closed for fixed k, so it can characterized by a finite list of forbidden minors. For k ≤ 3, the only forbidden minor is K k+1 . We show that a graph has Gram dimension at most 4 if and only if it does not have K5 and K2,2,2 as minors. We also show some close connections to the notion of d-realizability of graphs. In particular, our result implies the characterization of 3-realizable graphs of Belk and Connelly [5,6].