mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
load api base url from env;
This commit is contained in:
@@ -144,7 +144,7 @@
|
||||
// Send API request
|
||||
/*
|
||||
// Not working yet: a way to get the response as a stream
|
||||
await fetchEventSource("https://api.openai.com/v1/chat/completions", {
|
||||
await fetchEventSource(import.meta.env.VITE_API_BASE + "/v1/chat/completions", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization:
|
||||
@@ -185,7 +185,7 @@
|
||||
}, {})
|
||||
}
|
||||
response = await (
|
||||
await fetch('https://api.openai.com/v1/chat/completions', {
|
||||
await fetch(import.meta.env.VITE_API_BASE + '/v1/chat/completions', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${$apiKeyStorage}`,
|
||||
@@ -275,7 +275,7 @@
|
||||
|
||||
// Load available models from OpenAI
|
||||
const allModels = (await (
|
||||
await fetch('https://api.openai.com/v1/models', {
|
||||
await fetch(import.meta.env.VITE_API_BASE + '/v1/models', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${$apiKeyStorage}`,
|
||||
|
||||
Reference in New Issue
Block a user