AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Use Azure OpenAI with AutoGPT latest version, return 'Invalid OpenAI API key' error. Where Can I set Azure key?

Open 35sui-com opened this issue 9 months ago • 11 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Linux

Which version of AutoGPT are you using?

Latest Release

Do you use OpenAI GPT-3 or GPT-4?

GPT-4(32k)

Which area covers your issue best?

Installation and setup

Describe your issue.

I set .env and azure.yaml in AutoGPT/autogpts/autogpt.

.env content ` OPENAI_API_KEY=14fcdXXXXX -- Azure key start without sk-,and its pattern is not like OpenAI

TELEMETRY_OPT_IN=false

USE_AZURE=True

AZURE_CONFIG_FILE=azure.yaml azure.yaml content azure_api_type: azure

azure_api_version: 2024-04-01-preview

azure_endpoint: https://xxxx.openai.azure.com/

azure_model_map:

gpt-3.5-turbo-0125: gpt-35-turbo

gpt-4-turbo-preview: gpt-4-1106-Preview

text-embedding-3-small: text-embedding-3-small

`

when I ran ./autogpt.sh serve in AutoGPT/autogpts/autogpt, it report AutoGPT/autogpts/autogpt 2024-05-06 15:09:18,850 ERROR Invalid OpenAI API key! Please set your OpenAI API key in .env or as an environment variable. 2024-05-06 15:09:18,850 INFO You can get your key from https://platform.openai.com/account/api-keys

Where Can I set Azure key?

Upload Activity Log Content

AutoGPT/autogpts/autogpt 2024-05-06 15:09:18,850 ERROR Invalid OpenAI API key! Please set your OpenAI API key in .env or as an environment variable. 2024-05-06 15:09:18,850 INFO You can get your key from https://platform.openai.com/account/api-keys

Upload Error Log Content

AutoGPT/autogpts/autogpt 2024-05-06 15:09:18,850 ERROR Invalid OpenAI API key! Please set your OpenAI API key in .env or as an environment variable. 2024-05-06 15:09:18,850 INFO You can get your key from https://platform.openai.com/account/api-keys

35sui-com avatar May 06 '24 07:05 35sui-com

the same problem.

klonhj2015 avatar May 08 '24 03:05 klonhj2015

Same problem

image

l33tm3 avatar May 20 '24 20:05 l33tm3

image when setting USE_AZURE=True it use OPENAI_API_KEY as AZURE's api_key

IthacaDream avatar May 23 '24 06:05 IthacaDream

same problem

h496022202 avatar May 23 '24 07:05 h496022202

Same problem

joostgrunwald avatar May 23 '24 18:05 joostgrunwald

Same problem

foreee avatar May 26 '24 11:05 foreee

same problem

aaaaaxiaoli avatar May 28 '24 07:05 aaaaaxiaoli

same problem

trend-johnson-jao avatar May 31 '24 03:05 trend-johnson-jao

I changed the code as the screenshot below, then success to run the azure api, for the 0.5.1 version

image image image

foreee avatar Jun 01 '24 07:06 foreee

Please fix this issue. Having the same problem

ShahrOZe69 avatar Jul 08 '24 16:07 ShahrOZe69

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar Aug 28 '24 01:08 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Oct 06 '24 02:10 github-actions[bot]