When you define an environment inline, you pass it with the "env" key as part of the [params] argument (which is in JSON format IIUC). I'm not sure how that applies to predefined environments created through the API though.