64
Views
5
Comments
[SQL Sandbox] 429 Too Many Requests
sql-sandbox
Web icon
Forge asset by Leonardo Fernandes
Application Type
Traditional Web

I wanted to test out the chatgpt feature. I have generated the secret key from OpenAI and changed the Site property OpenAI_SecretKey. When I open the "open conversation" and write something and press send I get "429 Too Many Requests "

2020-10-27 09-20-27
John Salamat
 
MVP

Hi Joachim,

Are you able to check Integration logs in Service Center if there are further logs? One of the common 429 is that quota for api request already exceeded.


John


UserImage.jpg
Joachim Ullmann Miller

Action: Openai.PostCompletions 

Endpoint: https://api.openai.com/v1/chat/completions 

Stack: 429 Too Many Requests
   at ssSQL.CcOpenai.ActionPostCompletions(HeContext heContext, ICcOpenaiCallbacks _callbacks, STPostCompletionsRequestStructure inParamRequest, STPostCompletionsResponseStructure& outParamResponse) 

My account in OpenAI is a free user (if that matters)

2020-10-27 09-20-27
John Salamat
 
MVP

Free should be ok. You can change the integration log to full to see more details https://www.outsystems.com/forums/discussion/33272/setting-logging-level-of-a-rest-api/. 

UserImage.jpg
Joachim Ullmann Miller

The full error log is attached

Screenshot 2024-06-03 122237.png
2021-11-12 04-59-31
Manikandan Sambasivam

The "429 Too Many Requests" error typically indicates that your application is sending too many requests to the OpenAI API in a short period. 

Troubleshooting Steps

  1. Check API Usage Limits:

    • Verify your current API usage and limits on your OpenAI account dashboard. Ensure you are within your usage limits.
  2. Implement Rate Limiting:

    • Add rate limiting to your application to ensure it does not exceed the allowed number of requests per minute/hour.
  3. Check for API Key Issues:

    • Ensure the API key is correctly set in the OpenAI_SecretKey site property.
    • Double-check that there are no typos or extra spaces in the API key.
  4. Handle Retries Gracefully:

    • Implement a retry mechanism with exponential backoff to handle rate-limited responses gracefully.
  5. Reduce Request Frequency:

    • Optimize your application to reduce the frequency of API requests. This can involve caching results or consolidating multiple requests into a single request where possible.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.