Getting error:429 rate limit exceeded error when trying azure open ai API calls from python

Subham Goyal 20 Reputation points
2024-08-05T07:37:50.94+00:00

Hi,

I have registered for a free trial azure account and created an open ai resource with gpt-3.5-turbo model deployed. I tried api calls to this using Python but it seems to be failing with below error:
{"error":{"code":"429","message": "Requests to the ChatCompletions_Create Operation under Azure OpenAI API version 2024-04-01-preview have exceeded token rate limit of your current OpenAI S0 pricing tier. Please retry after 86400 seconds. Please go here: https://aka.m

s/oai/quotaincrease if you would like to further increase the default rate limit."}}

I tried waiting 24 hours and recreating a new depolyment but same issue. How do i fix this as i want to try the api call and showcase the results to my managers, only then company will fund me for a pay-as-you-go service.

Please help.

Thanks.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,092 questions
{count} votes

Accepted answer
  1. AshokPeddakotla-MSFT 35,971 Reputation points Moderator
    2024-08-07T06:12:09.71+00:00

    Subham Goyal I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Error Message:

    I have registered for a free trial azure account and created an open ai resource with gpt-3.5-turbo model deployed. I tried api calls to this using Python but it seems to be failing with below error: {"error":{"code":"429","message": "Requests to the ChatCompletions_Create Operation under Azure OpenAI API version 2024-04-01-preview have exceeded token rate limit of your current OpenAI S0 pricing tier. Please retry after 86400 seconds. Please go here: https://aka.m

    s/oai/quotaincrease if you would like to further increase the default rate limit."}}

    I tried waiting 24 hours and recreating a new depolyment but same issue. How do i fix this as i want to try the api call and showcase the results to my managers, only then company will fund me for a pay-as-you-go service.

    Solution:

    The resource created was in different region than that of the resource group. having same group resolved the issue.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 35,971 Reputation points Moderator
    2024-08-05T11:25:26.4433333+00:00

    Subham Goyal Greetings & Welcome to Microsoft Q&A Forum. Thank you for posting your query here!

    Can you try with 2024-05-01-preview API version and see if that solves your issue?

    {"error":{"code":"429","message": "Requests to the ChatCompletions_Create Operation under Azure OpenAI API version 2024-04-01-preview have exceeded token rate limit of your current OpenAI S0 pricing tier. Please retry after 86400 seconds. Please go here: https://aka.m

    The error message is related to rate limits, which is a common practice in APIs to prevent abuse and ensure fair usage.

    In your case, the error message indicates that you’ve exceeded the token rate limit of your current AI Services S0 pricing tier.

    Azure OpenAI’s quota feature enables assignment of rate limits to your deployments, up-to a global limit called your “quota.” Quota is assigned to your subscription on a per-region, per-model basis in units of Tokens-per-Minute (TPM).

    You can check this documentation for more details.

    User's image

    To give more context, Tokens-Per-Minute (TPM) and Requests-Per-Minute (RPM) rate limits for the deployment.

    TPM rate limits are based on the maximum number of tokens that are estimated to be processed by a request at the time the request is received.

    RPM rate limits are based on the number of requests received over time. The rate limit expects that requests be evenly distributed over a one-minute period. If this average flow isn't maintained, then requests may receive a 429 response even though the limit isn't met when measured over the course of a minute.

    Please see Manage Azure OpenAI Service quota for more details.

    To view your quota allocations across deployments in a given region, select Shared Resources> Quota in Azure OpenAI studio and click on the link to increase the quota*.*

    User's image

    I Hope this helps. Do let me know if you have any further queries.

    0 comments No comments

  2. Subham Goyal 20 Reputation points
    2024-08-06T09:39:41.76+00:00

    Thank you. The solution didn't work.

    But i realized that the resource created was in different region than that of the resource group. having same group resolved the issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.