MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / ResolveAPIKeyEnv

Function ResolveAPIKeyEnv

internal/providers/providers.go:108–113  ·  view source on GitHub ↗

ResolveAPIKeyEnv returns the environment-variable name that holds this endpoint's API key. When the endpoint sets APIKeyEnv explicitly that name is used; otherwise a stable name is derived from the endpoint name — e.g. the endpoint "omnillm" yields "OMNILLM_API_KEY". Tools that authenticate via an e

(e Endpoint, endpointName string)

Source from the content-addressed store, hash-verified

106// endpoint "omnillm" yields "OMNILLM_API_KEY". Tools that authenticate via an
107// env var reference (codex's env_key) use this name.
108func ResolveAPIKeyEnv(e Endpoint, endpointName string) string {
109 if name := strings.TrimSpace(e.APIKeyEnv); name != "" {
110 return name
111 }
112 return deriveAPIKeyEnvName(endpointName)
113}
114
115// deriveAPIKeyEnvName builds a valid env-var name from an endpoint name by
116// upper-casing it, replacing any character that is not a letter or digit with

Callers 3

ResolveLaunchEnvFunction · 0.92
expandPlaceholdersFunction · 0.92
expandConfigPlaceholdersFunction · 0.92

Calls 1

deriveAPIKeyEnvNameFunction · 0.85

Tested by

no test coverage detected