Open ausiasrt opened 1 week ago
Same thing, but using a business account., QGIS 3.40 thought.
Hi @ausiasrt @CharlesGag ,
The error message suggests the API key is either invalid, not configured or does not have enough credits. As this section of the user manual describes, you need to configure the API key settings before using this plugin.
The OpenAI API quickstart explains how to set up an API key.
Notes:
To check if your key works, run the following command (source, see the documentation if curl
is not available):
$ export OPENAI_API_KEY="your_api_key_here"
$ curl "https://api.openai.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku that explains the concept of recursion."
}
]
}'
Thanks!
Thank you @yumemio for your response!
@ausiasrt and @CharlesGag, please be sure you are using correct API key. Let me know if you are able to solve this issue
Hi and thanks for your work. I get this error when I send a request:
Error: Error code: 404 - {'error': {'message': 'The model
gpt-4does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
Same error for model gpt-4o.And I got this error for gpt-4o-mini:
Error: Error code: 429 - {'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': None, 'code': 'insufficient_quota'}}
I am using a free account of OpenAI. Tested on QGIS 3.22.16-Białowieża on Debian 12. Thanks.