Skip to content

fix: show provider-specific rate limit message instead of hardcoded OpenAI text#1730

Open
octo-patch wants to merge 1 commit intoopeninterpreter:mainfrom
octo-patch:fix/issue-1706-provider-agnostic-rate-limit-message
Open

fix: show provider-specific rate limit message instead of hardcoded OpenAI text#1730
octo-patch wants to merge 1 commit intoopeninterpreter:mainfrom
octo-patch:fix/issue-1706-provider-agnostic-rate-limit-message

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #1706

Problem

When users hit a rate limit or quota error while using non-OpenAI providers (e.g., Groq, Anthropic, Mistral), the error handler always displays a message that says "You ran out of current quota for OpenAI's API" and links to the OpenAI billing page. This is confusing and misleading for users who aren't using OpenAI at all.

Solution

Detect the API provider from the model prefix (LiteLLM convention: provider/model-name) and display an appropriate message:

  • OpenAI models (no prefix or openai/ prefix): show the existing OpenAI-specific message with the OpenAI billing page link
  • Other providers (e.g., groq/llama3-8b-8192): show a generic message naming the actual provider (e.g., "You have exceeded your quota for Groq's API") without incorrect OpenAI-specific links

The extraction uses model.split("/")[0].title() which correctly maps:

  • groq/llama3-8b-8192Groq
  • anthropic/claude-3Anthropic
  • mistral/mistral-7bMistral
  • gpt-4, o1-mini (no prefix) → OpenAI

Testing

  • Using Groq API and hitting rate limit now shows "You have exceeded your quota for Groq's API" instead of mentioning OpenAI
  • Using OpenAI API still shows the original OpenAI-specific message with billing link
  • Models without a provider prefix continue to default to the OpenAI message

@endolith
Copy link
Copy Markdown
Contributor

endolith commented Apr 18, 2026

I'm my fork I just display such messages as they come from the API, including markdown or HTML formatting if it exists

https://github.com/endolith/open-interpreter

@octo-patch
Copy link
Copy Markdown
Author

Thanks! That's a nice approach in your fork — passing through the raw provider message preserves whatever formatting/details the API returns. This PR is a more conservative change: it just removes the misleading hardcoded "Check OpenAI API key" text when the actual provider isn't OpenAI, and shows the underlying error message instead. It's a smaller surface change but addresses the same underlying issue users hit when seeing OpenAI guidance for non-OpenAI rate limit errors. A more comprehensive rewrite (like yours) could be a good follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

while using grooq api ... its saying You ran out of current quota for OpenAI's API, .. totally confused here

2 participants