haruka and Claude Opus 4.8
62d57c02d8
feat(billing): usage_logs 单独记录图片输入 token 与费用
...
图片编辑/图生图请求的图片输入 token 此前并入 input_tokens/input_cost,
无法对账。拆分上报口径,total_cost 保持不变。
后端:
- CostBreakdown 新增 ImageInputCost;computeTokenBreakdown 将图片输入费用
从 InputCost 拆出(InputCost 从此仅含文本输入),并纳入 tier 倍率与总额;
长上下文合并路径同步携带 ImageInputCost
- 迁移 179:usage_logs 新增 image_input_tokens / image_input_cost 列
- UsageLog、insert/query 仓储(含定位参数数组、CTE 列表、扫描顺序)、
DTO 与 mapper 补齐两列
- openai_gateway_usage 从 usage 与 cost 落库图片输入 token/费用
前端:
- UsageLog 类型、imageUsage 工具(hasImageInputTokens/Cost、textInputTokens)
- 用量表 token 徽标、Token/费用 tooltip 与单价行按图/文输入拆分展示
- zh/en usage.* i18n
测试:
- 新增 gpt-image-2 图片编辑复现用例(复现 #4386 的 $0.016081 期望值)
- 新增 usage 提取器图片输入 token 解析用例(input_tokens_details.image_tokens)
- 更新 doubao 图文分价用例与仓储/契约测试以匹配新的 input/image 拆分口径
相关 #4386。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_015wcJTKDddxXSQrepSs3wrU
2026-07-15 10:03:38 -07:00
Tian Lee
90ee85f3ef
feat: 按上游计费倍率调度 OpenAI 账号
2026-07-16 00:40:46 +08:00
siyuan
72fada40f6
fix(lint): check alpha search builder writes
2026-07-16 00:36:38 +08:00
siyuan
695665cbc8
fix(openai): fallback PAT alpha search to responses web_search
2026-07-16 00:36:38 +08:00
siyuan
776f3f0de7
fix(openai): align alpha search PAT forwarding
2026-07-16 00:36:38 +08:00
haruka and Claude Opus 4.8
06e03f467a
feat(billing): 渠道自定义定价支持图片输入 token 单价 image_input_price
...
渠道 token 计费模式此前无法为图片输入 token 单独定价,gpt-image-2
图片编辑等请求的图像输入被按文本 input_price 计费。新增
channel_model_pricing.image_input_price 列及全链路支持。
后端:
- 迁移 178:channel_model_pricing 新增 image_input_price 列
- ChannelModelPricing 新增 ImageInputPrice 字段,repo 读写、校验补齐
- model_pricing_resolver / GetModelPricingWithChannel 映射到
ImageInputPricePerToken;未配置时归零,由 computeTokenBreakdown
回退文本输入价(向后兼容,与 image_output_price 的渠道权威规则一致)
- admin / 用户侧定价 DTO 与 model-pricing 自动填充接口补充该字段
前端:
- 渠道定价表单新增「图片输入」价格输入(token 模式)
- API 类型、表单模型、form↔API 换算、自动填充、用户侧模型定价卡展示
- zh/en i18n 标签
相关 #4386。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_015wcJTKDddxXSQrepSs3wrU
2026-07-15 09:35:34 -07:00
haruka and Claude Opus 4.8
7c43b7327d
feat(billing): 解析 usage.input_tokens_details 拆分图/文输入 token
...
/v1/images/edits 等带图请求,上游在 input_tokens_details.image_tokens
单独回传图片输入 token,此前被合并进 input_tokens 整体按文本输入价计费。
- openAIUsageFromGJSON 读取 input_tokens_details.image_tokens
(回退 prompt_tokens_details.image_tokens)写入 OpenAIUsage.ImageInputTokens
- mergeOpenAIUsage 补充 ImageInputTokens 的流式合并
配合全局定价的 input_cost_per_image_token,gpt-image-2 图片编辑请求的
图像输入即按独立单价计费。相关 #4386。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_015wcJTKDddxXSQrepSs3wrU
2026-07-15 09:24:44 -07:00
haruka and Claude Opus 4.8
10cb2ca42c
feat(billing): 全局定价解析 input_cost_per_image_token
...
LiteLLM 定价数据中 gpt-image-2 等模型已含 input_cost_per_image_token
(图片输入 token 单价),但此前未被解析,导致图片编辑/图生图请求的
图像输入 token 被按文本输入价计费。
- LiteLLMModelPricing / LiteLLMRawEntry 新增 InputCostPerImageToken 字段并解析
- GetModelPricing 将其映射到 ModelPricing.ImageInputPricePerToken
计费拆分算术(computeTokenBreakdown)已支持图/文输入分价,本提交补齐
全局定价路径的数据来源。相关 #4386。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_015wcJTKDddxXSQrepSs3wrU
2026-07-15 09:23:35 -07:00
王鹏
3db00d3fee
fix(openai): fail over account-specific body limits
2026-07-16 00:19:20 +08:00
superman2003
410ea8490c
fix(grok): allow passive Codex image tool declarations
2026-07-16 00:16:21 +08:00
jjaw
a8a8a58f65
优化批量账户事件的调度重建范围
2026-07-16 00:11:17 +08:00
Tian Lee
0765d10c1d
feat: 增加上游 Sub2API 计费倍率探测与账号展示
2026-07-15 23:58:46 +08:00
王鹏
40b8f04a6a
fix(openai): scope transient cooldowns by model
2026-07-15 22:52:35 +08:00
Tian Lee
f59a6ed74c
feat: 增加 API Key 计费倍率自省接口
2026-07-15 22:42:53 +08:00
王鹏
5e4da92dec
fix(openai): retry explicitly rejected Responses fields
2026-07-15 22:37:30 +08:00
wucm667
56650d6aed
fix(openai): normalize Responses Lite reasoning context
2026-07-15 22:23:57 +08:00
wucm667
2fe7df9b81
fix(openai): reject image models on chat completions
2026-07-15 22:22:51 +08:00
王鹏
4f641208a0
fix(openai-ws): close ingress reads cleanly
2026-07-15 22:15:44 +08:00
haruka
134179085c
feat: add async image generation tasks
2026-07-15 22:13:37 +08:00
王鹏
716fcc6f3d
fix(openai): reject malformed WS v2 events
2026-07-15 21:20:41 +08:00
Wesley Liddick
be6cd1250c
Merge pull request #4367 from Wei-Shaw/feat/grok-custom-base-url-and-headers
...
feat(grok): 支持账号级自定义上游地址与请求头覆写
2026-07-15 20:55:16 +08:00
Wesley Liddick
34015a1791
Merge pull request #4359 from catoncat/agent/fix-agent-identity-import-expiry
...
fix(openai): make Agent Identity usable end to end
2026-07-15 20:55:05 +08:00
Wesley Liddick
a733e66330
Merge pull request #4358 from DanisJiang/feat/admin-recharge-affiliate-rebate
...
feat(affiliate): support rebates for admin balance deposits
2026-07-15 20:54:48 +08:00
Wesley Liddick
960d1886f3
Merge pull request #4323 from turingcat/feat/plan-currency-label
...
feat(payment): 订阅套餐支持币种标注,区分 $ 符号对应币种
2026-07-15 20:54:34 +08:00
shaw
221581400b
feat(grok): 支持账号级自定义上游地址与请求头覆写
...
将账号级请求头覆写从 anthropic/openai 的 api_key 账号扩展到 Grok 的
api_key 与 oauth 账号,并放开 Grok OAuth 账号的自定义上游地址(仅作用于
转发端点,授权与 token 刷新链路不变)。
后端:
- IsHeaderOverrideEligible 扩展到 Grok(api_key+oauth),禁止名单新增
x-grok-conv-id(逐请求会话路由头)。
- 所有 Grok 上游请求路径接线 ApplyHeaderOverrides(Responses/Chat 桥/
媒体/配额探测/billing 探测/连通性测试),统一置于内置默认头之后。
- GetGrokBaseURL/GetGrokMediaBaseURL 放开 OAuth 自定义地址:官方地址
视同未定制回落官方网关,仅显式第三方 host 改发转发流量。
- 非官方 host 允许任意 path 前缀,官方 host 仍强制 /v1。
- OAuth base_url 校验按 host 判定官方/自定义,自定义 host 恒受运营方
URL 策略约束,不受 XAI_ALLOW_UNSAFE_URL_OVERRIDES 调试开关放宽。
- 给 GrokQuotaService 注入 config,使配额/billing 探测与转发共用同一
URL 策略。
前端:
- Edit 模态为 Grok OAuth 账号新增「自定义上游地址」开关。
- 请求头表单新增 JSON 快速导入与按 JSON 一键复制(复用 useClipboard,
兼容非安全上下文 HTTP 页面)。
- 门控改为平台×类型判定,Bulk 批量 base_url 增加格式校验,zh/en 文案同步。
2026-07-15 20:30:23 +08:00
cat
2147da682b
fix(openai): 修复 Agent Identity 审查问题
2026-07-15 18:30:16 +08:00
cat
12e6e70775
fix(openai): 补全 Agent Identity Codex 能力
2026-07-15 17:52:10 +08:00
Yuhao Jiang
736824dd7a
feat(affiliate): add admin recharge rebate option
2026-07-15 04:28:55 -05:00
Wesley Liddick
0de768e8be
Merge pull request #4221 from heathermhuang/codex/fix-grok-oauth-pool-health
...
fix(grok): refresh OAuth pools proactively
2026-07-15 16:07:09 +08:00
Wesley Liddick
bac925624f
Merge pull request #4289 from Tiantianr/fix/openai-ws-first-message-timeout
...
fix(openai-ws): make first-message timeout configurable
2026-07-15 15:45:24 +08:00
xiaohei210509
ade5944201
fix(openai): preserve Codex image function tools
2026-07-15 15:10:43 +08:00
Wesley Liddick
44452d4a9d
Merge pull request #4334 from lenzhang/fix/grok-vision-image-bridge
...
fix(grok): bridge image_url content parts through Responses API for vision models
2026-07-15 14:43:44 +08:00
Wesley Liddick
8e84071f21
Merge pull request #4307 from wp-a/fix/openai-first-output-timeout
...
fix(openai): bound native responses first output wait
2026-07-15 14:41:11 +08:00
Wesley Liddick
788b1cebf1
Merge pull request #4333 from superman2003/fix/grok-free-messages-function-cache
...
fix(grok): cache Free Messages function tools
2026-07-15 14:40:14 +08:00
shaw
986310d0bd
fix(lint): apply De Morgan's law to grok vision bridge gate (QF1001)
2026-07-15 14:30:47 +08:00
Wesley Liddick
2d218fbe61
Merge pull request #4317 from yan9651688/feat/account-one-click-copy
...
feat(accounts): add safe one-click account duplication
2026-07-15 14:23:35 +08:00
Wesley Liddick
9d1b44e6a0
Merge pull request #4324 from superman2003/fix/responses-lite-tool-compat
...
fix(openai): normalize Responses Lite tool declarations
2026-07-15 14:22:15 +08:00
Wesley Liddick
601a1d1662
Merge pull request #4305 from wp-a/fix/outbox-degraded-rebuild-latch
...
fix(scheduler): latch degraded outbox rebuilds
2026-07-15 14:22:03 +08:00
superman2003
3170c110a0
fix(openai): surface Messages stream error events
2026-07-15 14:07:01 +08:00
superman2003
08ea29428d
fix(grok): recognize probed Free cache accounts
2026-07-15 14:07:01 +08:00
Wesley Liddick
156cabd260
Merge pull request #4316 from fengshao1227/fix/grok-image-model-responses-reject
...
fix(grok): 拦截图片模型发往 Responses 端点,返回明确错误
2026-07-15 13:49:25 +08:00
Wesley Liddick
3e30862ddd
Merge pull request #4295 from caigee-cmd/perf/direct-anthropic-chatcompletions-bridge
...
perf(apicompat): force-chat 路径直转 Anthropic↔ChatCompletions,跳过 Responses 中间层
2026-07-15 13:46:56 +08:00
王鹏
9950f4a2e2
fix(scheduler): latch degraded outbox rebuilds
2026-07-15 13:24:08 +08:00
lenzhang
d5bc576b4f
fix(grok): bridge image_url content parts through Responses API for vision models
...
The eligibility gate in grokChatResponsesBridgeEligibility rejected any
structured content (arrays), including standard OpenAI image_url parts.
This forced image-bearing requests to fall back to raw Chat Completions
forwarding, where non-Composer models have no image bridge — silently
dropping the images or causing upstream errors.
Changes:
- Allow content arrays containing only text and image_url parts to pass
eligibility, so ChatCompletionsToResponses can convert them to
input_image parts that Grok vision models natively support.
- Force image-bearing requests to use Responses even when no prompt
cache identity is available, since the raw path cannot forward images
for non-Composer models.
- Add grokChatStructuredContentBridgeable helper with conservative
validation: unknown part types (e.g. input_audio) still fall back.
- Update tests: image_url content is now bridgeable; add cases for
text+image, text-only arrays, unknown parts, and empty arrays.
2026-07-14 22:24:03 -07:00
superman2003
f041b5cf0a
fix(grok): cache Free Messages function tools
2026-07-15 13:05:13 +08:00
王鹏
fc4089f292
fix(openai): bound native responses first output wait
...
Add an opt-in first semantic output budget for native HTTP Responses, including response-header wait. Keep preamble and keepalive bytes non-semantic so a stalled account can fail over once without replaying its response IDs. Defaults remain disabled.
Related to #4201 , #4185 , and #4248 . Complements the HTTP/2 dead-connection fix in #4207 .
2026-07-15 13:01:16 +08:00
superman2003
bc6d9c47d2
fix(openai): normalize Responses Lite tool declarations
2026-07-15 11:37:38 +08:00
turingcat and Claude Fable 5
2bbdd47002
feat(payment): 订阅套餐支持币种标注,区分 $ 符号对应币种
...
后台配置与用户端展示的套餐价格统一使用 $ 符号,而实际扣款币种随
支付渠道配置漂移(如 Stripe 配置 NZD 时按新西兰元扣款),用户易
误认为美元。本次为套餐新增可选的展示性币种标注:
- SubscriptionPlan 新增 currency 字段(ISO 4217 三字母码,默认空)
- 空值不展示任何标注,存量套餐行为完全不变
- 非空值复用 payment.NormalizePaymentCurrency 校验并规范化为大写
- 后台套餐编辑弹窗新增可选币种输入,列表价格列展示币种小字
- 用户端套餐卡片价格与划线原价旁展示币种小字
- 纯展示性质,不影响任何支付/扣款逻辑
Closes #4315
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-07-15 11:17:45 +08:00
li
6a61b2daca
fix(grok): 拦截图片模型发往 Responses 端点,返回明确错误
...
Fixes #4301
2026-07-15 11:16:07 +08:00
Wesley Liddick
5b5e41450c
Merge pull request #4310 from jianjianai/codex/perf-scheduler-final
...
perf(scheduler): 完善缓存桶生命周期并复用重建批次查询
2026-07-15 11:09:47 +08:00