Can someone switch between OpenGL and DirectX?

Can I close OpenGL and open DirectX then close DirectX and open OpenGL?

I would like to make a game engine. I am more familiar with OpenGL and if I could do this, I could make the interface in OpenGL and the renderer in DirectX.

Your first sentence doesn’t seem to fit with the rest of your post. Unless by “close” and “open”, you don’t mean like actual windows, but just stop using one of them and switch to the other.

OpenGL and D3D are bound to windows. But they cannot both be bound to the same window. So you could execute some GL stuff that goes into one window and some D3D stuff that goes into another.

I just don’t really see why this would be helpful, since both APIs allow you to do the same stuff. Especially if the two windows are attached to each other.