MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / isAnthropicModelsRequest

Function isAnthropicModelsRequest

internal/api/server.go:984–989  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

982// Anthropic format. Anthropic API clients send the Anthropic-Version header; Claude
983// Code additionally uses a claude-cli User-Agent.
984func 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.

Callers 2

unifiedModelsHandlerMethod · 0.85
handleHomeModelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected