I am solving a model with baron through gams. I would like to retrieve the lower bound and the upper bound of the objective function obj.
There is a variable where the LB is saved: I image that obj.l return the upper bound.
Correct, obj.l or modelname.objval return the incumbent and hence an upper bound on the global optimum (for minimization problems). modelname.objest (see https://www.gams.com/latest/docs/UG_ModelSolve.html?search=objest) give you the lower bound returned by Baron (and many other solvers that work with a global lower bound):
option minlp=baron;
solve spring using minlp minimizing volume;
display spring.objest, spring.objval;