42 Commits

Author SHA1 Message Date
Seefs
9ecad90652 refactor: optimize billing flow for OpenAI-to-Anthropic convert 2026-03-23 14:22:12 +08:00
CaIon
ffb06d084b fix: update OpenAI response structure to use json.RawMessage for dynamic fields 2026-03-06 17:50:45 +08:00
Seefs
25f88050d3 fix: map Responses reasoning stream to chat completion deltas
fix: default summary = detailed

fix ReasoningContent

fix ReasoningContent

fix ReasoningContent

fix ReasoningContent

Revert "fix ReasoningContent"

This reverts commit 45a88f78b91ce2376bca68745d19374bb9e95e88.

fix ReasoningContent

fix ReasoningContent
2026-02-05 00:12:16 +08:00
Seefs
2a15e3b152 feat: codex channel (#2652)
* feat: codex channel

* feat: codex channel

* feat: codex oauth flow

* feat: codex refresh cred

* feat: codex usage

* fix: codex err message detail

* fix: codex setting ui

* feat: codex refresh cred task

* fix: import err

* fix: codex store must be false

* fix: chat -> responses tool call

* fix: chat -> responses tool call
2026-01-14 22:29:43 +08:00
Seefs
71460cba15 feat: /v1/chat/completion -> /v1/response (#2629)
* feat: /v1/chat/completion -> /v1/response
2026-01-11 21:38:07 +08:00
Seefs
e1b9317531 feat: claude 1h cache (#2155)
* feat: claude 1h cache

* feat: claude 1h cache

* fix price
2025-11-04 00:20:50 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
feitianbubu
1d1759aaae feat: add sora video submit task 2025-10-09 15:00:02 +08:00
creamlike1024
f6984272bf fix: openai responses api 未统计图像生成调用计费 2025-09-16 12:47:59 +08:00
CaIon
f181ca254b fix: remove redundant reasoning assignment in ChatCompletionsStreamResponseChoiceDelta 2025-08-17 18:43:31 +08:00
CaIon
5b5b97eb30 feat: 完善格式抓换,修复gemini渠道和openai渠道在claude code中使用的问题 2025-08-08 16:45:37 +08:00
CaIon
c4666934be Revert "feat: update Usage struct to support dynamic token handling with ceil function #1503"
This reverts commit 97b8d7de9e.
2025-08-07 16:22:40 +08:00
CaIon
97b8d7de9e feat: update Usage struct to support dynamic token handling with ceil function #1503 2025-08-07 15:40:12 +08:00
CaIon
563d056ff7 refactor: update error handling to support dynamic error types 2025-07-31 21:16:01 +08:00
feitianbubu
9c3a22964b fix: ali embedding support base64 2025-07-20 12:05:20 +08:00
Xyfacai
dfc826a388 fix(response): tools 需要处理的参数很少 使用 map 2025-07-20 11:21:57 +08:00
feitianbubu
b1cf5d7705 fix: usage cost(any) to support claude and gemini 2025-07-16 16:58:34 +08:00
CaIon
4a9ca4209a refactor: Introduce standardized API error
This commit refactors the application's error handling mechanism by introducing a new standardized error type, `types.NewAPIError`. It also renames common JSON utility functions for better clarity.

Previously, internal error handling was tightly coupled to the `dto.OpenAIError` format. This change decouples the internal logic from the external API representation.

Key changes:
- A new `types.NewAPIError` struct is introduced to serve as a canonical internal representation for all API errors.
- All relay adapters (OpenAI, Claude, Gemini, etc.) are updated to return `*types.NewAPIError`.
- Controllers now convert the internal `NewAPIError` to the client-facing `OpenAIError` format at the API boundary, ensuring backward compatibility.
- Channel auto-disable/enable logic is updated to use the new standardized error type.
- JSON utility functions are renamed to align with Go's standard library conventions (e.g., `UnmarshalJson` -> `Unmarshal`, `EncodeJson` -> `Marshal`).
2025-07-10 15:02:40 +08:00
Calcium-Ion
877529ef6b Merge pull request #1120 from neotf/feat-04
feat: enhance token usage details for upstream OpenRouter
2025-06-22 01:10:49 +08:00
CaIon
93fb5bab6b fix(dto): change Created field type in OpenAITextResponse to any. (close #1131) 2025-06-22 00:59:39 +08:00
neotf
dde8c49a2e feat: enhance cache_create_tokens calculation for OpenRouter 2025-05-29 22:47:02 +08:00
creamlike1024
a3fe88772f feat: 添加 built in tools 计费
- 增加非流的工具调用次数统计
- 添加 web search 和 file search 计费
2025-05-06 21:58:01 +08:00
CaIon
e9812b0fd5 feat: implement OpenAI responses handling and streaming support with built-in tool tracking 2025-05-05 00:40:16 +08:00
CaIon
209265e68c feat: enhance OaiResponsesStreamHandler to handle output text and improve response streaming 2025-05-04 17:09:37 +08:00
creamlike1024
3753e5720a add OaiResponsesStreamHandler 2025-05-03 22:36:27 +08:00
creamlike1024
8ea4c76f2b feat: support /v1/responses API 2025-05-02 13:59:46 +08:00
xyfacai
873ebcf0c7 feat: support /images/edit
(cherry picked from commit 1c0a1238787d490f02dd9269b616580a16604180)
2025-04-26 15:44:56 +08:00
CaIon
d378543819 feat: add gemini thinking suffix support #981 2025-04-18 19:36:18 +08:00
1808837298@qq.com
6e8916207e refactor: Enhance Claude response handling 2025-03-16 19:11:58 +08:00
1808837298@qq.com
62dc82638d feat: Introduce JSON decoding utility functions and update error handling in Claude and OpenAI response structures 2025-03-16 18:34:39 +08:00
CalciumIon
5021000c5d refactor: Simplify OpenAI handler function signature and remove unused TextResponseWithError struct; introduce common_handler for rerank functionality 2025-03-14 17:31:05 +08:00
1808837298@qq.com
78fc3a191c feat: claude relay 2025-03-12 21:31:46 +08:00
1808837298@qq.com
a36d6de8d1 feat: Add prompt cache hit tokens support for DeepSeek channel #406 2025-03-08 16:50:53 +08:00
Sh1n3zZ
aa6c894f56 fix: adapting return format for openrouter think content (#793) 2025-03-06 19:16:26 +08:00
1808837298@qq.com
0646fa1892 fix: gemini&claude tool call format #795 #766 2025-02-26 23:56:10 +08:00
1808837298@qq.com
23de62ec0d fix: claude tool call format #795 #766 2025-02-26 23:40:16 +08:00
1808837298@qq.com
4597816a14 feat: Add thinking-to-content conversion for stream responses 2025-02-23 17:05:57 +08:00
1808837298@qq.com
8101cd3ce3 feat: Add reasoning content support in OpenAI response handling 2025-02-21 18:52:51 +08:00
1808837298@qq.com
93511cfbf9 feat: enhance OpenAI request and response DTOs
- Add `Prefix` and `ReasoningContent` fields to Message struct
- Add getter and setter methods for `Prefix`
- Make `ToolCall.ID` field optional (fix #749)
2025-02-11 19:54:54 +08:00
Yan
49a0db1da8 fix: add index in the tool calls when chat by stream (gemini) 2024-12-28 17:56:31 +08:00
CalciumIon
37d6925ef6 feat: 完善audio计费 2024-11-07 16:12:09 +08:00
CalciumIon
c5633221f0 feat: support gpt-4o-audio-preview 2024-11-04 15:27:12 +08:00