Open-Custom-GPT
Open-Custom-GPT copied to clipboard
API key request using other devices
Is there a way to set the API key as fixed so that external users can interact with the chat?
I've installed it and it works perfectly in Chrome; however, when I open it in another browser or device, it asks me to enter the API KEY.?
It is designed by default to take the api key from the user and use it for generating the response
is there any way to keep my API key?
For me the only job I am looking for is the use of the chat by external people via my key.
Any news about this ? Would be nice to have the possibility to store an api key for all users. So when you share a custom gpt, the end user has not to put in the API key
Just thinking about the easiest way to do this, then I'll PR an "option" to make it public (without the key being visible to the client)
I got this working by changing all the client-side openai
calls to server side API calls, so
This...
const messages = await openai.beta.threads.messages.list(threadId);
Becomes this...
const getMessagesResponses = await fetch(`/api/openai`, {
method: "post",
body: JSON.stringify({
method: "messages",
action: "list",
threadId,
}),
});
const messages = await getMessagesResponses.json();
And the API route returns this...
const listMessages = await openai.beta.threads[method].list(threadId);
return NextResponse.json({
...listMessages,
});
See this branch: https://github.com/mledwards/Open-Custom-GPT/tree/update/make-server-side
@hcdgsv @SamuelChabal @vonbarnekowa
Now added support for using api key of owner instead of requesting it everytime in the web version. Do try at customgpt.thesamur.ai