mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 修复API统计和OpenAI路由问题
This commit is contained in:
@@ -562,8 +562,14 @@ router.post('/api/batch-stats', async (req, res) => {
|
|||||||
name: stats.name,
|
name: stats.name,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
usage: stats.usage,
|
usage: stats.usage,
|
||||||
dailyUsage: stats.dailyStats,
|
dailyUsage: {
|
||||||
monthlyUsage: stats.monthlyStats
|
...stats.dailyStats,
|
||||||
|
formattedCost: CostCalculator.formatCost(stats.dailyStats.cost || 0)
|
||||||
|
},
|
||||||
|
monthlyUsage: {
|
||||||
|
...stats.monthlyStats,
|
||||||
|
formattedCost: CostCalculator.formatCost(stats.monthlyStats.cost || 0)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ router.post('/responses', authenticateApiKey, async (req, res) => {
|
|||||||
headers['host'] = 'chatgpt.com'
|
headers['host'] = 'chatgpt.com'
|
||||||
headers['accept'] = isStream ? 'text/event-stream' : 'application/json'
|
headers['accept'] = isStream ? 'text/event-stream' : 'application/json'
|
||||||
headers['content-type'] = 'application/json'
|
headers['content-type'] = 'application/json'
|
||||||
req.body['store'] = false
|
req.body['store'] = true
|
||||||
|
|
||||||
// 创建代理 agent
|
// 创建代理 agent
|
||||||
const proxyAgent = createProxyAgent(proxy)
|
const proxyAgent = createProxyAgent(proxy)
|
||||||
|
|||||||
Reference in New Issue
Block a user