Files
CLIProxyAPI/sdk/api/handlers/handlers_plugin_executor_usage.go
Luis Pater d31b15916d feat(executor): support token usage parsing for plugin executors
- Add `ParsePluginExecutorResponseUsage` to extract token usage from non-streaming plugin responses across Claude, Gemini, Interactions, Antigravity, and OpenAI/Codex protocols.
- Add `ObservePluginExecutorStreamUsage` to observe and aggregate token usage across streaming chunks.

Closes: #5340
2026-08-30 14:51:08 +08:00

15 lines
497 B
Go

package handlers
import (
"github.com/router-for-me/CLIProxyAPI/v7/internal/runtime/executor/helps"
"github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/usage"
)
func parsePluginExecutorResponseUsage(protocol string, payload []byte) usage.Detail {
return helps.ParsePluginExecutorResponseUsage(protocol, payload)
}
func observePluginExecutorStreamUsage(protocol string, payload []byte, buffer *helps.StreamUsageBuffer) {
helps.ObservePluginExecutorStreamUsage(protocol, payload, buffer)
}