Compare commits

...

2 Commits

Author SHA1 Message Date
zimk
09e7f1de0d fix: 恢复自定义域名 nekoai-api.git.llc 2026-03-23 01:33:15 +08:00
zimk
8ca8a6ce85 feat: 强制 max_tokens=2048 限制 2026-03-23 01:32:28 +08:00
2 changed files with 6 additions and 0 deletions

View File

@@ -70,6 +70,8 @@ async function handleChat(request, env) {
return json({ error: 'Invalid JSON body' }, 400, request, env);
}
payload.max_tokens = 2048;
const upstream = await fetch(joinUrl(env.OPENAI_BASE_URL, '/v1/chat/completions'), {
method: 'POST',
headers: {

View File

@@ -2,3 +2,7 @@ name = "nekoai-api"
main = "src/index.js"
compatibility_date = "2026-03-12"
workers_dev = true
routes = [
{ pattern = "nekoai-api.git.llc", custom_domain = true }
]