When the AI Agent in the WP Feature Agent Demo plugin tries to connect to the OpenAI API and the account has exceeded its quota, the API correctly returns an insufficient_quota error. However, the plugin does not handle this response properly.
Instead of displaying a clear message to the user (e.g., “Your OpenAI account has exceeded its quota. Please check your billing details.”), the chat interface shows a generic “Unknown error”. This makes it difficult for users to understand the real issue and how to fix it.
Impact:
Users cannot tell whether the error is due to their API key, quota limits, or another issue.
Developers have to manually inspect browser network logs to identify the actual cause.
Poor UX as the plugin hides actionable information from the user.
Suggested Fix:
Add error handling for insufficient_quota responses from the OpenAI API.
Display a clear, user-friendly message such as:
“Your OpenAI account has run out of quota. Please update your billing details or add more credits.”
Error:
{
"error": {
"message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https:\/\/platform.openai.com\/docs\/guides\/error-codes\/api-errors.",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_quota"
}
}
Bug Video and Image:
https://github.com/user-attachments/assets/9f7a70e3-0680-4a70-8cd1-93f66ff7962f
