I know this is an older thread- but I'm new here and have a thread asking for help so I thought maybe I could try to help others with my knowledge. My passion is for Chinese opium paraphernalia.
I'm sorry to report, your item was not for opium. The opening is too small and would cause a struggle to get the thick tar-like opium paste out. True opium storage containers were always lined with copper as they believed anything else would taint the taste of Chandu (smoking opium). Plus, he's holding a tobacco pipe.
It certainly is interesting- it's too small to be an inkwell. If It had a latch, I'd peg it as a snuff container with a missing spoon. But sadly, I'm stumped on what your item is.