diff --git a/src/app/[locale]/api/generate/route.ts b/src/app/[locale]/api/generate/route.ts index a00d93d..d89b4a0 100644 --- a/src/app/[locale]/api/generate/route.ts +++ b/src/app/[locale]/api/generate/route.ts @@ -1,8 +1,4 @@ - - -export const apiKey = process.env.OPENAI_API_KEY || 'sk-xxxxxx' -export const model = process.env.OPENAI_API_MODEL || 'sora-1.0-turbo' -export const baseUrl = process.env.OPENAI_API_BASE_URL || 'https://fake-sora-api.sorawebui.com' +import {apiKey, baseUrl, model} from "~/configs/openai"; export async function POST(req: Request, res: Response) { diff --git a/src/configs/openai.ts b/src/configs/openai.ts new file mode 100644 index 0000000..9822f87 --- /dev/null +++ b/src/configs/openai.ts @@ -0,0 +1,3 @@ +export const apiKey = process.env.OPENAI_API_KEY || 'sk-xxxxxx' +export const model = process.env.OPENAI_API_MODEL || 'sora-1.0-turbo' +export const baseUrl = process.env.OPENAI_API_BASE_URL || 'https://fake-sora-api.sorawebui.com'