Converting Texture Render Target 2D to base64

Hello. I am working on a project that is using OpenAI GPT Vision API calls. I would like to be able to capture my scene image and send that via API. The API requires either image URLs or base 64 image strings. I have the API setup working but have had some issues converting my scene capture Render Target 2D to base64. Any assistance would be nice.