Quota Issue on First Prompt of New Key

Created on 2 August 2024, 4 months ago
Updated 3 September 2024, 3 months ago

Problem/Motivation

I created a new project key at Open Ai, configured the key name and password (secret key). When I enter a prompt via the CKEditor 5 Text Completion box I get the following (note that OpenAI shows 0 usage of the key):

The website encountered an unexpected error. Try again later.<br><br><em class="placeholder">Drupal\ai\Exception\AiRequestErrorException</em>: Error invoking model response: 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 <em class="placeholder">Drupal\ai\Plugin\ProviderProxy-&gt;wrapperCall()</em> (line <em class="placeholder">165</em> of <em class="placeholder">modules/contrib/ai/src/Plugin/ProviderProxy.php</em>). <pre class="backtrace">Drupal\ai\Plugin\ProviderProxy-&gt;__call(&#039;chat&#039;, Array) (Line: 64)
Drupal\ai_ckeditor\Controller\Completion-&gt;generate(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: works as designed

Version

1.0

Component

AI Core module

Created by

🇺🇸United States j. ayen green

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

Comments & Activities

  • Issue created by @j. ayen green
  • 🇩🇪Germany marcus_johansson

    The link provided in the error message will give you more information: https://platform.openai.com/docs/guides/error-codes/api-errors

    You probably need to setup a credit card or something else is missing in the OpenAI billing setup.

    From the page:

    This error message indicates that you hit your monthly usage limit for the API, or for prepaid credits customers that you've consumed all your credits. You can view your maximum usage limit on the limits page. This could happen for several reasons, such as:

    You are using a high-volume or complex service that consumes a lot of credits or tokens.
    Your monthly budget is set too low for your organization’s usage.
    Your monthly budget is set too low for your project's usage.
    To resolve this error, please follow these steps:

    Check your current usage of your account, and compare that to your account's limits.
    If you are on a free plan, consider upgrading to a paid plan to get higher limits.
    Reach out to your organization owner to increase the budgets for your project.

  • 🇩🇪Germany marcus_johansson

    @j. ayen green - Could I go ahead and close this ticket as its answered? I'll close it in one week if it stays unactive.

  • Status changed to Closed: works as designed 3 months ago
Production build 0.71.5 2024