Error: 'You exceeded your current quota' When Using AI Module in Drupal 10 with CKEditor Tool

Created on 7 October 2024, 2 months ago

I have installed Drupal 10 and successfully configured the Drupal AI contributed module (drupal/ai:^1.0@alpha) using the following command:

composer require 'drupal/ai:^1.0@alpha'

After setting up the AI provider and adding the API key in the backend configuration, I attempted to use the CKEditor tool to generate a response. However, I encountered the following 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.

It seems the AI integration is not working as expected, and I would like assistance in resolving this issue. The API key and configuration have been checked and seem to be in order.

Is this an issue related to the module's integration with the CKEditor, or could there be a bug in the way quota checks are being handled by the module? Any guidance or support from the module maintainers or community would be greatly appreciated.

🐛 Bug report
Status

Active

Version

1.0

Component

AI CKEditor

Created by

🇮🇳India hiramanpatil

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

Comments & Activities

  • Issue created by @hiramanpatil
  • 🇩🇪Germany marcus_johansson

    That error message comes from the OpenAI API endpoint, please check that you have money on your account and that you have set limits for the key.

    You can use https://platform.openai.com/ to check if you get a similar error there. If you get a similar error there, please close this ticket, otherwise we more need information to solve this ticket.

    If you feel that this is an actual bug, please revert it to a bug request, but I will change this into a support request for the time being.

    Note that we will not do any support for the free OpenAI accounts, but you are free to ask the community for help.

  • 🇮🇳India hiramanpatil

    Thank you for the quick response. Getting the same error using CURL.

    $ curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer OPENAI_API_KEY" -d '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "write a haiku about ai"}]}'
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 432 100 337 100 95 549 154 --:--:-- --:--:-- --:--:-- 714{
    "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"
    }
    }

Production build 0.71.5 2024