eidolon-ai / eidolon

The first AI Agent Server, Eidolon is a pluggable Agent SDK and enterprise ready, deployment server for Agentic applications
https://www.eidolonai.com/
Apache License 2.0
217 stars 29 forks source link

Unfunded OpenAI account does not produce easy to understand errors #709

Open abhi-vachani opened 1 week ago

abhi-vachani commented 1 week ago

Problem:

Solution: Display clear error message explaining problem is due to unfunded OpenAI account.

flynntsang commented 6 days ago

FYI, I got this error with Anthropic when my free credits ran out:

Error Anthropic Status Error: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your credit balance is too low to access the Claude API. Please go to Plans & Billing to upgrade or purchase credits.'}}

coryfoo commented 11 hours ago

I submitted a PR that handles the OpenAI specific messaging. The response message from OpenAI is particularly vague, but the one reference about Anthropic above seems to do a good job of detailing the issue. I'm very new to the project, but at first blush it would seem that handling these issues generically across all LLMs might be a pretty big refactor.

abhi-vachani commented 5 hours ago

I submitted a PR that handles the OpenAI specific messaging. The response message from OpenAI is particularly vague, but the one reference about Anthropic above seems to do a good job of detailing the issue. I'm very new to the project, but at first blush it would seem that handling these issues generically across all LLMs might be a pretty big refactor.

Hey Cory, saw your PR: the other thing to consider is what the error should be given an actual "model not found" issue for example when incorrectly typing a gpt model name. However, that being said, not sure if there's really a way to know when this is the case or when it is due to insufficient funds given the error is the same, so your response might actually cover both cases.

LukeLalor commented 21 minutes ago

commented on the pr, but I wanted to bring the conversation back here as well. one approach could be to list models via /v1/models. Would cover most scenarios.

coryfoo commented 18 minutes ago

commented on the pr, but I wanted to bring the conversation back here as well. one approach could be to list models via /v1/models. Would cover most scenarios.

I had considered something like this, too. However, using my own account as an example (which is unfunded / has no billing), I don't see the model in the list of models on the page. I would suspect that once I enabled billing for the account then I would be able to see the model in the list -- so again, this would still be a scenario related to insufficient funds vs a bad model name. I'm not sure that we would really be able to programmatically tell the difference using their API.