feeeei
530fb20f25
refactor(billing): 长上下文阶梯计价改为价格目录数据驱动
...
删除 GPT/Gemini 系列写死的阶梯规则,阶梯一律由目录数据驱动:
- 解析层折算 LiteLLM 的 *_above_XXXk_tokens 绝对价字段为阈值+倍率
(阈值取自字段名,倍率 = above/基础价,cache 侧跟随输入倍率,
xAI 按 provider 用达到即进高档语义);显式 long_context_* 字段
按"字段存在"优先,显式 threshold=0 或 multiplier=1 可关闭阶梯
- 删除 OpenAI 272K 常量与 applyModelSpecificPricingPolicy 的长上下文
强补分支、fallbackPrices/静态兜底条目的 LongContext 字段、Gemini 旧
边际规则全链路(CalculateCostWithLongContext / RecordUsageWithLongContext /
阶梯表 marginal 基准);保留 fastRatio 与 GPT-5.6 cache_write 1.25x
防御分支、grok 静态兜底阶梯
- 渠道配置定价区间时完全以渠道区间为准,不再叠加目录阶梯
- 长上下文倍率 ≤0 在应用点按 1 计,防止显式字段残缺把分项乘 0 免费
- 目录重载时对比新旧数据,原有阶梯丢失打 WARN 哨兵告警
行为变化:Gemini 由边际 2x(仅 /v1beta、全模型)改为整单换档(数据
驱动、仅带 above_200k 的 pro 系),渠道平价之上叠加目录阶梯;Claude
sonnet-4/4.5 随目录数据获得 200K 整单阶梯(与官方定价一致);模型广场
官方参考价列与实付列同源展示目录阶梯。
2026-09-01 01:26:55 +08:00
shaw
4795650d21
fix(openai): record actual upstream endpoint on errors
2026-08-26 09:42:28 +08:00
Rain
bfac49fef9
fix(codex): handle responses input token preflight
2026-08-19 11:34:18 +08:00
chinnsenn
71d7f86883
fix(antigravity):
...
1. harden OpenAI compatibility forwarding
2. reject usage-only non-stream responses
2026-07-26 20:23:50 +09:00
haruka
1fb942dd77
feat: add async image generation tasks
2026-07-15 19:57:37 -07:00
Wesley Liddick
502097026f
Revert "feat: 支持异步生图任务与结果轮询"
2026-07-16 09:47:27 +08:00
haruka
134179085c
feat: add async image generation tasks
2026-07-15 22:13:37 +08:00
chenjian
909b96edd2
feat: support Grok video edits and extensions
2026-07-13 10:50:42 +08:00
shaw
8d51364c3d
Merge remote-tracking branch 'origin/main' into feat/grok-prompt-cache-identity
...
# Conflicts:
# backend/internal/handler/endpoint.go
# backend/internal/service/openai_gateway_grok_test.go
2026-07-13 09:12:44 +08:00
superman2003
7050070aa3
fix(grok): route cacheable chat requests via responses
2026-07-12 11:50:56 +08:00
Tian Lee
52071d391b
fix(openai): 转发 Codex alpha/search 独立搜索端点
2026-07-11 20:31:33 +08:00
alfadb
75e3089496
fix: normalize inbound endpoints from raw request path
2026-07-07 10:20:23 +08:00
alfadb
2fb212b7d6
fix(openai): 区分 responses compact 入站端点
...
/v1/responses/compact 及其别名路径(/responses/compact、/openai/v1/responses/compact、
/backend-api/codex/responses/compact 等,含嵌套子路径)是独立的客户端端点,
新增 EndpointResponsesCompact 常量并单独归一化,不再与根 /v1/responses 混同。
根 Responses 别名(/responses、/backend-api/codex/responses 等)仍归一到
EndpointResponses。NormalizeInboundEndpoint 优先匹配 compact 分支,避免根路径
前缀提前命中。DeriveUpstreamEndpoint 在 inbound 已为 compact 但原始路径无法
派生后缀时,回退到 compact 而非根 upstream。
2026-07-07 10:20:23 +08:00
Heatherm Huang
3b5d812f7a
fix: route grok media endpoints
2026-07-01 11:43:35 +08:00
Heatherm Huang
39be1ec97f
feat: add grok subscription support
2026-06-26 10:36:09 +08:00
Wey Gu
ccace69d4e
Add OpenAI embeddings gateway
2026-05-28 19:39:52 +08:00
lucas morgan
c548021921
feat(openai): 同步生图 API 支持并接入图片计费调度
...
- 同步 OpenAI 图片生成与编辑接口
- 接入图片请求解析、账号调度、转发与用量记录
- 接入图片计费与图片用量落库
- 限制 OAuth 生图仅支持无显式模型和尺寸的基础请求
2026-04-22 12:30:08 +08:00
erio
62e80c602d
revert: completely remove all Sora functionality
2026-04-05 17:11:01 +08:00
Ethan0x0000 and Sisyphus
2c9dcfe27b
refactor: add unified endpoint normalization infrastructure
...
Introduce endpoint.go with shared constants, NormalizeInboundEndpoint, DeriveUpstreamEndpoint, InboundEndpointMiddleware, and context helpers. This replaces the two separate normalization implementations (OpenAI and Gateway) with a single source of truth. Includes comprehensive test coverage.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai >
2026-03-15 22:13:31 +08:00