feat(api): support custom BYO API header override on client fetches and backend config

This commit is contained in:
DESKTOP-I1T6TF3\Q
2026-06-04 13:48:31 +08:00
parent af155ac107
commit e04c51e875
10 changed files with 510 additions and 21 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const result = await requestBeatAudio(config, body);
return NextResponse.json(result);
} catch (err) {
+1 -1
View File
@@ -22,7 +22,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const result = await requestInsertBeat(config, body);
return NextResponse.json(result);
} catch (err) {
+1 -1
View File
@@ -51,7 +51,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const raw = await analyzeImageDataUrl(
config.vision,
body.imageDataUrl,
+1 -1
View File
@@ -23,7 +23,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const result = await requestScene(config, body);
return NextResponse.json(result);
} catch (err) {
+1 -1
View File
@@ -41,7 +41,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const result = await startSession(config, body);
return NextResponse.json(result);
} catch (err) {
+1 -1
View File
@@ -42,7 +42,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig();
const config = loadEngineConfig(req.headers);
const result = await visionDecide(config, body);
return NextResponse.json(result);
} catch (err) {