File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
# Get your OpenAI API key here: https://platform.openai.com/account/api-keys
6
6
OPENAI_API_KEY =
7
+ # OPTIONAL: OpenAI Base URL (default to https://api.openai.com/v1)
8
+ OPENAI_BASE_URL =
7
9
8
10
# OPTIONAL: Vercel Blob (for uploading images)
9
11
# Get your Vercel Blob credentials here: https://vercel.com/docs/storage/vercel-blob/quickstart#quickstart
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const llama = new OpenAI({
19
19
export async function POST ( req : Request ) : Promise < Response > {
20
20
const openai = new OpenAI ( {
21
21
apiKey : process . env . OPENAI_API_KEY ,
22
+ baseURL : process . env . OPENAI_BASE_URL || "https://api.openai.com/v1" ,
22
23
} ) ;
23
24
// Check if the OPENAI_API_KEY is set, if not return 400
24
25
if ( ! process . env . OPENAI_API_KEY || process . env . OPENAI_API_KEY === "" ) {
You can’t perform that action at this time.
0 commit comments