diff --git a/internal/auth/kimi/kimi.go b/internal/auth/kimi/kimi.go index 8c9b864ee..1795ea3ec 100644 --- a/internal/auth/kimi/kimi.go +++ b/internal/auth/kimi/kimi.go @@ -15,6 +15,7 @@ import ( "time" "github.com/google/uuid" + "github.com/router-for-me/CLIProxyAPI/v7/internal/buildinfo" "github.com/router-for-me/CLIProxyAPI/v7/internal/config" "github.com/router-for-me/CLIProxyAPI/v7/internal/util" log "github.com/sirupsen/logrus" @@ -168,8 +169,8 @@ func getHostname() string { // commonHeaders returns headers required for Kimi API requests. func (c *DeviceFlowClient) commonHeaders() map[string]string { return map[string]string{ - "X-Msh-Platform": "cli-proxy-api", - "X-Msh-Version": "1.0.0", + "X-Msh-Platform": "CLIProxyAPI", + "X-Msh-Version": buildinfo.Version, "X-Msh-Device-Name": getHostname(), "X-Msh-Device-Model": getDeviceModel(), "X-Msh-Device-Id": c.deviceID, diff --git a/internal/runtime/executor/kimi_executor.go b/internal/runtime/executor/kimi_executor.go index f0fb21707..3d7b13e2d 100644 --- a/internal/runtime/executor/kimi_executor.go +++ b/internal/runtime/executor/kimi_executor.go @@ -14,6 +14,7 @@ import ( "time" kimiauth "github.com/router-for-me/CLIProxyAPI/v7/internal/auth/kimi" + "github.com/router-for-me/CLIProxyAPI/v7/internal/buildinfo" "github.com/router-for-me/CLIProxyAPI/v7/internal/config" "github.com/router-for-me/CLIProxyAPI/v7/internal/runtime/executor/helps" "github.com/router-for-me/CLIProxyAPI/v7/internal/thinking" @@ -616,14 +617,14 @@ func (e *KimiExecutor) Refresh(ctx context.Context, auth *cliproxyauth.Auth) (*c } // applyKimiHeaders sets required headers for Kimi API requests. -// Headers match kimi-cli client for compatibility. +// Headers identify CLIProxyAPI with the current build version. func applyKimiHeaders(r *http.Request, token string, stream bool) { r.Header.Set("Content-Type", "application/json") r.Header.Set("Authorization", "Bearer "+token) - // Match kimi-cli headers exactly - r.Header.Set("User-Agent", "KimiCLI/1.10.6") - r.Header.Set("X-Msh-Platform", "kimi_cli") - r.Header.Set("X-Msh-Version", "1.10.6") + // Identify requests with the current CLIProxyAPI version. + r.Header.Set("User-Agent", "CLIProxyAPI/"+buildinfo.Version) + r.Header.Set("X-Msh-Platform", "CLIProxyAPI") + r.Header.Set("X-Msh-Version", buildinfo.Version) r.Header.Set("X-Msh-Device-Name", getKimiHostname()) r.Header.Set("X-Msh-Device-Model", getKimiDeviceModel()) r.Header.Set("X-Msh-Device-Id", getKimiDeviceID())