Note that those errors are not directly related to AI Engine, but they might appear as you are using it.
Youâve reached your usage limit / Quota Exceeded
Since OpenAIâs shift to prepaid billing in early 2024, all API users must maintain a positive account balance before making requests. If you see this error, it usually means your balance has reached zero.
To fix this:
- Check your account balance in the OpenAI billing dashboard
- Add credits to your account (minimum $5 purchase)
- Set both hard and soft usage limits in your billing settings
- Wait 10-15 minutes after adding credits before testing again
If errors persist despite having credits, try generating a new API keyâOpenAIâs system sometimes requires fresh authentication tokens after billing changes.
Rate Limit Error (429)
This error occurs when youâre sending too many requests too quickly. OpenAI imposes rate limits based on your account tier and the model youâre using.
There are two types of 429 errors:
- insufficient_quota â This is a billing/account issue. Check your balance and add credits.
- Rate limiting â Youâre hitting the requests-per-minute limit. The error message will include details like âCurrent: 10020.000000 / minâ.
For rate limiting issues, wait a few seconds and try again. AI Engine handles this automatically with exponential backoff.
Invalid API Key / Authentication Error
This error means your API key is incorrect, expired, or hasnât been properly configured.
To fix this:
- Verify your API key in AI Engine settingsâmake sure there are no extra spaces
- Generate a new API key from your OpenAI dashboard
- Ensure the key has the proper permissions for the models youâre using
That model is currently overloaded with other requests (503)
The specific AI model you are trying to access is experiencing high traffic from numerous users at the same time. Consider waiting for a short period before attempting to access the model again, as the server load may decrease. In the meantime, you can also explore other available models that might suit your needs and check if they are less congested.
cURL error 28: Failed to connect to api.openai.com port 443
This is a connection timeout error. Common causes:
- Geographic restrictions â For users in China, OpenAI servers may be blocked. Using a proxy for WordPress is necessary to bypass these restrictions.
- Security plugins â A security plugin within WordPress may be preventing external requests. Check your security plugin settings to allow connections to api.openai.com.
- Firewall rules â Your serverâs firewall might be blocking outgoing connections. Contact your hosting provider.
Context length exceeded
Each model has a maximum token limit for the combined input (your prompt + context) and output. If you exceed this limit, youâll get this error.
To fix this:
- Reduce the length of your context or system prompt in AI Engine settings
- Use a model with a larger context window (e.g., gpt-4-turbo supports 128K tokens)
- Limit the conversation history thatâs sent with each request
Model not found / Invalid model
This error occurs when youâre trying to use a model that doesnât exist, has been deprecated, or that your account doesnât have access to.
Common causes:
- The model name has a typo
- OpenAI has deprecated the model (e.g., older GPT-3 models)
- Your account tier doesnât have access to that model (e.g., GPT-4 requires a paid account)
Check the OpenAI models documentation for the current list of available models.