@D-0887 Thanks for the question, Here is sample to fails over between regions whenever you exceed rate limit or you can use the APIM.
https://github.com/kirkhofer/data-ai/tree/main/aoai
Kindly mark the answer as Accepted and Upvote in case it helped!