According to the docs the function will strip that sequence of chars from the right side of the string.
The expression 'https://odinultra.ai/api'.rstrip('/api')
should result in the string 'https://odinultra.ai'
.
Instead here is what we get in Python 3:
>>> 'https://odinultra.ai/api'.rstrip('/api')
'https://odinultra.'