refactor(web): remove client-side BYO API key feature

The BYO (Bring Your Own) API key configuration for LLM and image
generation will be re-implemented via Cloudflare Workers. Remove
the client-side implementation to prepare for that migration.

TTS (text-to-speech) BYO key support is intentionally preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuanzonghao
2026-06-06 17:42:00 +08:00
parent 3625f935ed
commit d646ce8db8
11 changed files with 11 additions and 584 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig(req.headers);
const config = loadEngineConfig();
const result = await requestBeatAudio(config, body);
if (!result.audio) return new Response(null, { status: 204 });
const binary = Buffer.from(result.audio.base64, "base64");
+1 -1
View File
@@ -22,7 +22,7 @@ export async function POST(req: Request) {
}
try {
const base = loadEngineConfig(req.headers);
const base = loadEngineConfig();
// See StartRequest.clientTts — BYO clients synth in-browser, so drop server TTS.
const config = body.clientTts === true ? { ...base, tts: undefined } : base;
const result = await requestInsertBeat(config, body);
+1 -1
View File
@@ -51,7 +51,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig(req.headers);
const config = loadEngineConfig();
const raw = await analyzeImageDataUrl(
config.vision,
body.imageDataUrl,
+1 -1
View File
@@ -32,7 +32,7 @@ export async function POST(req: Request) {
}
try {
const base = loadEngineConfig(req.headers);
const base = loadEngineConfig();
// See StartRequest.clientTts — BYO clients synth in-browser, so drop server TTS.
const config = body.clientTts === true ? { ...base, tts: undefined } : base;
const result = await requestScene(config, body);
+1 -1
View File
@@ -41,7 +41,7 @@ export async function POST(req: Request) {
}
try {
const base = loadEngineConfig(req.headers);
const base = loadEngineConfig();
// BYO key: the browser provisions + synths voices directly against Xiaomi
// (key never reaches us), so strip server-side TTS so the engine skips all
// provisioning + synth. See StartRequest.clientTts.
+1 -1
View File
@@ -42,7 +42,7 @@ export async function POST(req: Request) {
}
try {
const config = loadEngineConfig(req.headers);
const config = loadEngineConfig();
const result = await visionDecide(config, body);
return NextResponse.json(result);
} catch (err) {