I think that this is not yet implemented. A work-a-round could be to call the Retrieve Environments Tags (or any other GET retrieve that only works on V4). With a proper response you know the environment is running in V4. When receiving a 404 you know the enviroment is not running in V4.
Perhaps this could help you.