Calling on internal Hass API?

I was looking to utilize the following API: Text-to-speech (TTS) - Home Assistant to obtain the MP3 file URL from generating a TTS sentence.

I couldn’t find a way to call upon this API from within HASS itself. Is this possible? Alternatively, I ended up configuring a long live token and calling a rest_command to myself which works but don’t know if I’m missing something:

    url: http://localhost:8123/api/tts_get_url
    method: post
    payload: '{ "message": "{{ message }}", "engine_id": "cloud" }'
      content-type: 'application/json'
      authorization: !secret tts_token
    verify_ssl: false