I got it working like this:
> curl -F 'file[0]=@/home/store/img.jpg' -F 'data={"o:ingester": "upload", "file_index": "0", "o:item": {"o:id": "11"}}' 'http://localhost:8080/api/media?key_identity=hTHRcFByROlLsO5X2On9orAAwIrKqx6E&key_credential=Zcks0DyoYDGv0ZIyYxscuD5ATYoNZz6L'
This adds image to an item 11.