We consider a hyperbolic equation with variable leading part and nonlinearity in the lower-order term.The coefficients of the equation are smooth functionsconstant beyond some compact domain in the three-dimensional space.A plane wave with direction $ \ell $ falls to the heterogeneity from the exterior of this domain.A solution to the corresponding Cauchy problem for the original equation is measured at boundary points of the domain fora time interval including the moment of arrival of the wave at these points.The unit vector $ \ell $ is assumed to be a parameter of the problem andcan run through all possible values sequentially.We study the inverse problem of determining the coefficient of the nonlinearity on using thisinformation about solutions. We describe the structure of a solution to the direct problem anddemonstrate that the inverse problem reduces to an integral geometry problem.The latter problem consists of constructing the desired function on using given integralsof the product of this function and a weight function.The integrals are taken along the geodesic lines of the Riemannian metricassociated with the leading part of the differential equation. We analyze this new problemand find some stability estimate for its solution, which yieldsa stability estimate for solutions to the inverse problem.