fix: strip AIUI-specific fields from Claude API proxy requests
Remove webSearch, webResults, context fields before forwarding to Anthropic API — these are AIUI-internal and cause 400 errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0264920e33
commit
2938d8159b
@ -1031,10 +1031,14 @@ app.post('/aiui/api/claude/*', (req, res) => {
|
||||
|
||||
const apiPath = '/' + req.params[0]
|
||||
|
||||
// Ensure max_tokens is set — Claude API requires it but AIUI may omit it
|
||||
// Clean request body for Anthropic API
|
||||
const body = req.body
|
||||
if (body && !body.max_tokens) {
|
||||
body.max_tokens = 4096
|
||||
if (body) {
|
||||
if (!body.max_tokens) body.max_tokens = 4096
|
||||
// Strip AIUI-specific fields that Anthropic API rejects
|
||||
delete body.webSearch
|
||||
delete body.webResults
|
||||
delete body.context
|
||||
}
|
||||
|
||||
const bodyStr = JSON.stringify(body)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user