AI API 中转平台
数据统计 API端点 API池管理 API Key 请求日志 聊天测试
{{ pageTitle }}
{{ adminUsername }} 退出

总请求数

{{ formatNumber(statistics.total_requests) }}
成功: {{ formatNumber(statistics.success_requests) }} / 失败: {{ formatNumber(statistics.error_requests) }}

成功率

{{ statistics.success_rate ? statistics.success_rate.toFixed(1) : 0 }}%
错误请求: {{ formatNumber(statistics.error_requests) }}

总Tokens消耗

{{ formatTokens(statistics.total_tokens) }}
输入: {{ formatTokens(statistics.request_tokens) }} / 输出: {{ formatTokens(statistics.response_tokens) }}

平均响应时间

{{ formatResponseTime(statistics.avg_response_time) }}
统计范围: 最近{{ statistics.time_range_hours || statisticsHours }}小时

Token消耗详情

输入Tokens (Prompt)
{{ formatTokens(statistics.request_tokens) }}
占比: {{ statistics.total_tokens ? ((statistics.request_tokens / statistics.total_tokens) * 100).toFixed(1) : 0 }}%
输出Tokens (Completion)
{{ formatTokens(statistics.response_tokens) }}
占比: {{ statistics.total_tokens ? ((statistics.response_tokens / statistics.total_tokens) * 100).toFixed(1) : 0 }}%
平均每请求Tokens
{{ statistics.total_requests ? Math.round(statistics.total_tokens / statistics.total_requests) : 0 }}
总请求数: {{ formatNumber(statistics.total_requests) }}

费用统计

总费用 (USD)
${{ (statistics.total_cost || 0).toFixed(4) }}
平均每请求费用 (USD)
${{ statistics.total_requests ? (statistics.total_cost / statistics.total_requests).toFixed(6) : '0.000000' }}
{{ endpoints.filter(e => e.status === 'active').length }}
活跃端点
{{ endpoints.filter(e => e.status === 'disabled').length }}
禁用端点
{{ endpointTotal }}
总端点数
{{ endpoint.name }}
#{{ endpoint.id }}
{{ endpoint.status === 'active' ? '✓ 启用' : endpoint.status === 'disabled' ? '⏸ 禁用' : '✗ 错误' }}
提供商
{{ endpoint.provider_name }}
模型
{{ endpoint.model }}
API地址
{{ endpoint.base_url }}
优先级
{{ endpoint.priority }}
权重
{{ endpoint.weight }}
超时
{{ endpoint.timeout }}s
重试
{{ endpoint.max_retries }}次
创建时间
{{ formatTime(endpoint.created_at) }}
更新时间
{{ formatTime(endpoint.updated_at) }}
自定义Headers
{{ typeof endpoint.headers === 'string' ? endpoint.headers : JSON.stringify(endpoint.headers) }}
测试连通性 编辑 删除
{{ endpoint.testResult.title }}
{{ endpoint.testResult.message }}
{{ endpoint.testResult.details }}
创建API池
{{ pools.length }} 总池数
{{ pools.filter(p => p.status === 'active').length }} 活跃池

{{ pool.name || '未命名池' }}

#{{ pool.id }}
{{ pool.status === 'active' ? '启用' : '禁用' }}
{{ pool.default_strategy === 'race' ? '竞速模式' : '轮询模式' }}
端点数量
{{ pool.endpoint_ids ? pool.endpoint_ids.length : 0 }} 个
总请求
{{ pool.total_requests }}
成功率
{{ pool.total_requests > 0 ? Math.round((pool.success_requests / pool.total_requests) * 100) : 0 }}%
平均响应
{{ pool.avg_response_time }}ms

{{ pool.description }}

最后使用: {{ formatTime(pool.last_used_at) }}
创建: {{ formatTime(pool.created_at) }}
测试池 编辑 删除
{{ pool.testResult.title }}
{{ pool.testResult.message }}
{{ JSON.stringify(pool.testResult.details, null, 2) }}
{{ keys.length }} API Keys
{{ keys.filter(k => k.status === 'active').length }} 启用中
创建API Key
🔑

{{ key.key_name }}

ID: {{ key.id }}
{{ key.status === 'active' ? '启用' : key.status === 'disabled' ? '禁用' : '过期' }}
{{ key.api_key_masked || key.api_key }}
复制完整Key
允许的池 全部池 {{ key.allowed_pools.length }} 个池
默认池 {{ key.default_pool_id || '未设置' }}
速率限制 {{ key.rate_limit_per_minute }}/分钟
配额使用 {{ key.used_quota }} / {{ key.quota_type === 'unlimited' ? '∞' : key.total_quota }}
最后使用 {{ formatTime(key.last_used_at) }}
创建时间 {{ formatTime(key.created_at) }}
编辑 禁用 启用 重置配额 删除
🔑
暂无API Key,点击上方按钮创建
总请求数
{{ logTotal }}
成功请求
{{ logStats.success }}
失败请求
{{ logStats.failed }}
平均响应时间
{{ logStats.avgResponseTime }}ms
{{ log.success === 'true' ? '✓ 成功' : '✗ 失败' }} {{ log.strategy_used === 'race' ? '⚡ 竞速' : '🔄 轮询' }} {{ log.stream === 'true' ? '📡 流式' : '📄 非流式' }}
{{ formatTime(log.created_at) }}
模型: {{ log.model }}
端点: {{ log.endpoint_name || `ID: ${log.endpoint_id}` }}
{{ log.stream === 'true' ? '首Token时间:' : '响应时间:' }} {{ log.stream === 'true' ? (log.first_byte_time_ms || 0) : (log.response_time_ms || 0) }}ms
总响应时间: {{ log.response_time_ms || 0 }}ms
Tokens: {{ log.total_tokens || 0 }} {{ log.total_tokens || 0 }}
{{ msg.role === 'user' ? '👤' : '🤖' }}
⏱️ {{ msg.responseTime }}
{{ formatChatTime(msg.timestamp) }}
🤖
{{ currentResponseTime }}
AI 正在思考...
📎 {{ chatLoading ? '发送中...' : '发送 🚀' }}
使用 | 分隔:Base URL | API Key | Model,点击解析自动填充下方字段
选择该端点支持的API调用格式(如OpenAI格式、Anthropic格式等)
请输入有效的JSON格式,留空则不添加自定义头部
启用 禁用
{{ testResult.title }}
{{ testResult.message }}
{{ testResult.details }}
竞速模式 轮询模式
竞速:并发请求多个端点,返回最快的;轮询:按顺序使用端点
启用 禁用
{{ poolTestResult.title }}
{{ poolTestResult.message }}
{{ poolTestResult.details }}
不选择任何池表示允许访问所有API池
启用 禁用
{{ currentLog.request_id }} {{ formatFullTime(currentLog.created_at) }} {{ currentLog.endpoint_name || `ID: ${currentLog.endpoint_id}` }} {{ currentLog.provider_name }} {{ currentLog.model }} {{ currentLog.strategy_used === 'race' ? '⚡ 竞速' : '🔄 轮询' }} {{ currentLog.stream === 'true' ? '📡 流式请求' : '📄 非流式请求' }} {{ currentLog.success === 'true' ? '✓ 成功' : '✗ 失败' }} {{ currentLog.status_code }} {{ currentLog.ip_address || '-' }} {{ currentLog.request_tokens || 0 }} {{ currentLog.response_tokens || 0 }} {{ currentLog.total_tokens || 0 }} {{ currentLog.cost ? '$' + currentLog.cost : '-' }} {{ currentLog.first_byte_time_ms || 0 }}ms {{ currentLog.response_time_ms || 0 }}ms {{ currentLog.retry_count || 0 }}
{{ currentLog.error_message }}