Add /v1/responses endpoint for direct OpenAI forwarding
Features: - Add new /v1/responses endpoint for transparent request/response forwarding - Only supports openai type endpoints (rejects anthropic with 400 error) - No request transformation - forwards original request body as-is - No response transformation - streams and non-streaming responses forwarded directly - /v1/chat/completions keeps original behavior with format conversion Differences between endpoints: - /v1/chat/completions: Converts formats for all endpoint types (anthropic, openai) - /v1/responses: Direct proxy for openai endpoints only, zero transformation
This commit is contained in:
@@ -29,7 +29,8 @@ app.get('/', (req, res) => {
|
||||
description: 'OpenAI Compatible API Proxy',
|
||||
endpoints: [
|
||||
'GET /v1/models',
|
||||
'POST /v1/chat/completions'
|
||||
'POST /v1/chat/completions',
|
||||
'POST /v1/responses'
|
||||
]
|
||||
});
|
||||
});
|
||||
@@ -86,7 +87,8 @@ app.use((req, res, next) => {
|
||||
timestamp: errorInfo.timestamp,
|
||||
availableEndpoints: [
|
||||
'GET /v1/models',
|
||||
'POST /v1/chat/completions'
|
||||
'POST /v1/chat/completions',
|
||||
'POST /v1/responses'
|
||||
]
|
||||
});
|
||||
});
|
||||
@@ -118,6 +120,7 @@ app.use((err, req, res, next) => {
|
||||
logInfo('Available endpoints:');
|
||||
logInfo(' GET /v1/models');
|
||||
logInfo(' POST /v1/chat/completions');
|
||||
logInfo(' POST /v1/responses');
|
||||
})
|
||||
.on('error', (err) => {
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
|
||||
Reference in New Issue
Block a user