you could use this service:
http://sldn.softlayer.com/reference/services/SoftLayer_Resource_Metadata
This service is desing to identify the device. the service must run whithin the machine and you do not need specify your username or API key.
So you can run the method to get the id of the machine e.g.
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET https://api.service.softlayer.com/rest/v3/SoftLayer_Resource_Metadata/getId
Once you get the ID of the device you can see if this ID belongs to a bare metal server or VSI, for that you can use the getObject methods.
http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/getObject
http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/getObject
For example if your ID belongs to VSI and you call the SoftLayer_Hardware_Server::getObject method you will get an error like that ID does not exist, and when you call the SoftLayer_Virtual_Guest::getObject method you will able to get information about the machine.
Also you could list all the bare metal and VSI servers in your account, an verify if your ID belongs to bare metal or VSI, you can use these methods:
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getVirtualGuests
http://sldn.softlayer.com/reference/services/SoftLayer_Account/getHardware
Regards