Unify token usage pass-through on OpenAI translate pipeline

This commit is contained in:
CJACK.
2026-04-07 10:16:23 +08:00
parent 5bcea3d727
commit 668b9c26bd
8 changed files with 134 additions and 38 deletions

View File

@@ -384,6 +384,7 @@ Business auth required. Returns OpenAI-compatible embeddings shape.
## Claude-Compatible API
Besides `/anthropic/v1/*`, DS2API also supports shortcut paths: `/v1/messages`, `/messages`, `/v1/messages/count_tokens`, `/messages/count_tokens`.
Implementation-wise this path is unified on the OpenAI Chat Completions parse-and-translate pipeline to avoid maintaining divergent parsing chains.
### `GET /anthropic/v1/models`
@@ -518,6 +519,7 @@ Supported paths:
- `/v1/models/{model}:streamGenerateContent` (compat path)
Authentication is the same as other business routes (`Authorization: Bearer <token>` or `x-api-key`).
Implementation-wise this path is unified on the OpenAI Chat Completions parse-and-translate pipeline to avoid maintaining divergent parsing chains.
### `POST /v1beta/models/{model}:generateContent`