isAnthropicModelsRequest reports whether a /v1/models request should be served in Anthropic format. Anthropic API clients send the Anthropic-Version header; Claude Code additionally uses a claude-cli User-Agent.
(c *gin.Context)
| 982 | // Anthropic format. Anthropic API clients send the Anthropic-Version header; Claude |
| 983 | // Code additionally uses a claude-cli User-Agent. |
| 984 | func isAnthropicModelsRequest(c *gin.Context) bool { |
| 985 | if c.GetHeader("Anthropic-Version") != "" { |
| 986 | return true |
| 987 | } |
| 988 | return strings.HasPrefix(c.GetHeader("User-Agent"), "claude-cli") |
| 989 | } |
| 990 | |
| 991 | // unifiedModelsHandler creates a unified handler for the /v1/models endpoint |
| 992 | // that routes to different handlers based on the request. |
no outgoing calls
no test coverage detected