Need to hide cli not but not the api

HI I have a container that I need to hide in cli mode, but it should work when I call the api.

How can I make that happen?

This appears to be a duplicate posting. Refer to for a possible solution.