📊 数据看板
💎 积分余额
{{ formatNumber(tStats.credits || 0) }}
{{ tStats.credits_config ? '智能路由 '+tStats.credits_config.smart_routing_cost+' 积分/次' : '' }}
⚡ 网关流量
{{ tStats.total_requests || 0 }}
成功 {{ tStats.success_count || 0 }} / 失败 {{ tStats.failed_count || 0 }}
🛡 风险拦截率
{{ tStats.total_requests ? ((tStats.shield_blocked||0) / tStats.total_requests * 100).toFixed(1) : '0.0' }}%
通过 {{ tStats.shield_passed || 0 }} / 拦截 {{ tStats.shield_blocked || 0 }}
🤖 模型路由
{{ Object.keys(tStats.model_usage || {}).length }} 个
Token {{ formatNumber(tStats.total_tokens || 0) }} · 延迟 {{ Math.round(tStats.avg_latency_ms || 0) }}ms
💰 实际成本
¥{{ (tStats.actual_cost || 0).toFixed(4) }}
最贵模型: ¥{{ (tStats.hypothetical_cost || 0).toFixed(4) }}
✨ 费用优化
¥{{ (tStats.cost_saved || 0).toFixed(4) }}
节省 {{ (tStats.cost_saved_percent || 0).toFixed(1) }}% — 智能路由自动优化
🛡 安全拦截明细
| 拦截类型 | 次数 |
|---|---|
| {{ tsCategoryLabel(reason) }} | {{ count }} |
🤖 模型路由分布
💰 模型成本分布
⏰ 按时段请求量
🛡 安全拦截比例
🔌 如何接入龙虾盾
1获取你的 API Key
进入左侧「🔑 API Key」菜单查看你的密钥,或创建新的 Key。
2替换应用中的 Base URL
将你的 AI 应用中的 OpenAI 地址改为龙虾盾网关:
BASE_URL = "http://{{ gatewayHost }}:8080/v1"
3设置 model 为 "auto"
使用
model: "auto" 启用智能路由,龙虾盾会自动选择最优模型。也可指定具体模型名。4完成!安全开始请求
所有请求将自动经过龙虾盾双向安全检测、智能路由、负载均衡。可在本面板实时查看数据。
📟 cURL 示例
curl http://{{ gatewayHost }}:8080/v1/chat/completions \
-H "Authorization: Bearer {{ myKeys.length ? myKeys[0].api_key : 'sk-your-api-key' }}" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{"role": "user", "content": "Hello!"}
],
"stream": true
}'
🐍 Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="http://{{ gatewayHost }}:8080/v1",
api_key="{{ myKeys.length ? myKeys[0].api_key : 'sk-your-api-key' }}",
)
resp = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello!"}]
)
print(resp.choices[0].message.content)
🟨 Node.js
const resp = await fetch("http://{{ gatewayHost }}:8080/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer {{ myKeys.length ? myKeys[0].api_key : 'sk-your-api-key' }}",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "auto",
messages: [{ role: "user", content: "Hello!" }]
})
});
💡 提示: 龙虾盾完全兼容 OpenAI API 格式。Cursor、Continue、ChatGPT-Next-Web、LobeChat、Open-WebUI 等支持自定义 base_url 的应用均可无缝接入,只需修改 Base URL 和 API Key 即可享受安全防护。每次请求消耗 {{ tStats.credits_config ? tStats.credits_config.smart_routing_cost : 1 }} 积分。
📋 最近请求
| 时间 | 模型 | 状态 | 盾结果 | Token | 成本 | 延迟 |
|---|---|---|---|---|---|---|
| {{ formatTime(e.timestamp) }} | {{ e.model_id || '-' }} | {{ statusLabel(e.status) }} | {{ shieldLabel(e.shield_result) }} | {{ e.total_tokens || '-' }} | {{ e.cost ? '¥'+e.cost.toFixed(4) : '-' }} | {{ e.latency_ms }}ms |
| 暂无数据 | ||||||
🤖 我的模型
已配置模型 ({{ models.length }})
| 模型 ID | 名称 | 类型 | 状态 | 权重 | 优先级 | 输入价格/1M | 输出价格/1M | 操作 |
|---|---|---|---|---|---|---|---|---|
| {{ m.model_id }} | {{ m.model_name }} | {{ m.api_type }} | {{ m.enabled ? '启用' : '禁用' }} | {{ m.weight }} | {{ m.priority }} | ¥{{ m.input_per_1m }} | ¥{{ m.output_per_1m }} | |
| 暂无模型配置,点击上方「添加模型」开始 | ||||||||
📋 请求日志
共 {{ auditLogs.length }} 条记录
| 时间 | 请求ID | 模型 | 流式 | 状态 | 盾结果 | 输入 | 输出 | 成本 | 延迟 | 来源IP |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ formatTime(e.timestamp) }} | {{ e.request_id?.substring(0,8) }}... | {{ e.model_id || '-' }} | {{ e.stream ? '🔄' : '📦' }} | {{ statusLabel(e.status) }} | {{ shieldLabel(e.shield_result) }} | {{ e.input_tokens }} | {{ e.output_tokens }} | {{ e.cost ? '¥'+e.cost.toFixed(4) : '-' }} | {{ e.latency_ms }}ms | {{ e.client_ip }} |
| 暂无日志 | ||||||||||
🔑 API Key 管理
共 {{ myKeys.length }} 个 Key
| 名称 | Key (掩码) | 完整 Key | 状态 | 创建时间 | 操作 |
|---|---|---|---|---|---|
| {{ k.key_name }} | {{ k.key_masked }} |
{{ k.api_key }}
|
{{ k.enabled ? '启用' : '禁用' }} | {{ formatTime(k.created_at) }} | |
| 暂无 Key | |||||
🔐 修改密码
🛡 安全防护
Key
📈 安全事件趋势
🥧 风险类型分布
🔒 安全事件列表 ({{ tsEvents.length }})
| 时间 | 分类 | 方向 | 动作 | 风险详情 | 来源IP |
|---|---|---|---|---|---|
| {{ formatTime(e.created_at) }} | {{ tsCategoryLabel(e.category) }} | {{ e.direction === 'input' ? '⬇️ 入' : '⬆️ 出' }} | {{ e.action === 'block' ? '🚫 拦截' : '✏️ 脱敏' }} | {{ e.client_ip }} | |
| 暂无安全事件 ✅ | |||||