Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
35sui-com opened this issue May 6, 2024 · 6 comments

Comments

@35sui-com
Copy link

35sui-com commented May 6, 2024

⚠️ Search for existing issues first ⚠️

  • 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

@klonhj2015
Copy link

the same problem.

@l33tm3
Copy link

l33tm3 commented May 20, 2024

Same problem

image

@IthacaDream
Copy link

IthacaDream commented May 23, 2024

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

@h496022202
Copy link

same problem

@joostgrunwald
Copy link

Same problem

1 similar comment
@foreee
Copy link

foreee commented May 26, 2024

Same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants