I think Cg is just a shading language. It's not an API nor middleware.
T-Buffer is a hardware implementation of multi-sample buffers. It's also not an API. An API such as DirectX, OpenGL, or Glide may have some interfaces that can control T-Buffer, though.
Middlewares are more like game engines or physics engines, etc.