-
Notifications
You must be signed in to change notification settings - Fork 436
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
How to set the default API key #83
Labels
enhancement
New feature or request
Comments
This issue is similar to #1. This project does not support setting environment variables now. However, if your project (source code) is not public, you can try: // src/providers/openai/api.ts
export const fetchChatCompletion = async(payload: OpenAIFetchPayload) => {
if (!payload.apiKey) {
payload.apiKey = 'sk-xxx'
}
const initOptions = {
// same
}
return fetch(`${payload.baseUrl}/v1/chat/completions`, initOptions)
} It will not display your key in web. And if the user enters his key, it will be used first. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the feature
how to set the default API key
Additional context
I don't want people to enter the API, I added it by default so that the openai API is recognized automatically and everyone can chat.
Participation
The text was updated successfully, but these errors were encountered: