Create drupal content programmatically with custom entity ( assets )
I think you can try to use core and EntityAPI methods for this task like this:

$asset = entity_get_controller('asset');
$asset-&gt;type = 'MY_TYPE';
$asset-&gt;... = '...';
....

$asset-&gt;save();