Misleading error: You exceeded your current quota, please check your plan and billing details

Created on 26 June 2024, 6 months ago
Updated 9 July 2024, 6 months ago

Problem/Motivation

I tried to analyze an article on my Drupal instance.

Steps to reproduce

I have installed the Open AI Core module and also the OpenAI Content Editing Tools module. I used a local development environment with DDEV under MacOS for this. It is a new Drupal 10.3 site. Also I setup an Open AI account, paid 5 EUR and setup the key and organization ID.

Then I created a node of type article with a lot of text and then I tried a small amount of text.

If I try to analyze text from my article node, I am always getting the same error:

Ein AJAX-HTTP-Fehler ist aufgetreten.
HTTP-Rückgabe-Code: 500
Debugging information follows.
Path: /node/1/edit?ajax_form=1
Statustext: Internal Server Error
Antworttext: The website encountered an unexpected error. Try again later.OpenAI\Exceptions\ErrorException: 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. in OpenAI\Transporters\HttpTransporter->throwIfJsonError() (line 131 of /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php). OpenAI\Transporters\HttpTransporter->requestObject() (Line: 28)
OpenAI\Resources\Moderations->create() (Line: 444)
openai_content_entity_analyze_content()
call_user_func_array() (Line: 69)
Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse() (Line: 112)
Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 239)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable() (Line: 91)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

I double checked my key and organization ID in the Open AI module settings. In doubt I tried a request against the Open AI api via cURL with my key. Like described in the Open AI docs. This worked and I got a MP3 audio file from text. So my Open AI account works in general and I am allowed to use the Open AI API.

Proposed resolution

Fix the Open AI account verification. The Open AI account quota and payment are set. Are there any limitations related to a local development environment? The current error is misleading. Because my Open AI account definitely is setup correctly and does work by a plain cURL request.

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024