A hyperelasticity for granular medium is proposed in this study, considering the inherent and stress-induced anisotropy. The nonlinear elastic behavior is described by defining an elastic potential energy model in terms of the elastic strain invariants that are coupled with a fabric tensor accounting for the transverse isotropy of granular solids formed under gravity. Such an approach provides a unified consideration on the stress-induced and inherent anisotropic behavior of the nonlinear elasticity and its stability. The six independent constants of the elastic modulus tensor of granular medium consolidated under different stress levels and consolidation stress ratios are well predicted using the granular hyperelasticity. Furthermore, the proposed anisotropic model of elastic potential results in a state region within which the thermodynamic stability is broken and thus naturally enables the predictions of the mechanically instable behavior of transversely anisotropic granular solids. From such a thermodynamic perspective, the state boundary of granular medium corresponds to the states at which the positive definiteness of the Hessian matrix of the elastic potential density function is violated and is used to define the strength criterion. Therefore, the proposed granular hyperelasticity in this study provided a generalized approach predicting the nonlinear elasticity and strength criterion of granular medium.