livekit.agents._exceptions.APIStatusError: Invalid...
# ask-ai
m
livekit.agents._exceptions.APIStatusError: Invalid response status (status_code=429, request_id=None, body=None, retryable=False) {"pid": 54871, "job_id": "AJ_e4iAPx9Dt2iq"}
t
Thanks for reaching out, Nikki. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're running into the
APIStatusError
with status code 429. This usually means the API is getting a bit overwhelmed with too many requests in a short time. To help smooth things out, you might want to try adding a retry mechanism with exponential backoff: • Catch the
APIStatusError
in your error handling code. • Check if the status code is 429 and if the error is retryable. • Then, retry the request after a short delay, starting around 1 second, and gradually increase the wait time for each retry. If you're working with a particular plugin or API, double-check that your API keys and quotas are set up to handle the volume of requests you need. Please feel free to reach out if you'd like help setting this up or if you want to dive deeper into troubleshooting. I'm here to support you! Sources: plugins/google/src/llm.ts | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/gemini_t...