(apiEndpoint: string)
| 8 | }; |
| 9 | |
| 10 | const getApiEndpoint = (apiEndpoint: string) => { |
| 11 | const url = new URL(apiEndpoint); |
| 12 | url.pathname = "/v1/chat/completions"; |
| 13 | return url; |
| 14 | }; |
| 15 | |
| 16 | const handler = async (req: NextRequest) => { |
| 17 | const reqBody = await req.json(); |