@@ -566,14 +566,19 @@ func (c *coordinator) buildAgentModels(ctx context.Context, isSubAgent bool) (Mo
569−func (c *coordinator) buildAnthropicProvider(baseURL, apiKey string, headers map[string]string) (fantasy.Provider, error) {
569+func (c *coordinator) buildAnthropicProvider(baseURL, apiKey string, headers map[string]string, providerID string) (fantasy.Provider, error) {
570 var opts []anthropic.Option
570 var opts []anthropic.Option
572− if strings.HasPrefix(apiKey, "Bearer ") {
573+ case strings.HasPrefix(apiKey, "Bearer "):
573 // NOTE: Prevent the SDK from picking up the API key from env.
574 // NOTE: Prevent the SDK from picking up the API key from env.
574 os.Setenv("ANTHROPIC_API_KEY", "")
575 os.Setenv("ANTHROPIC_API_KEY", "")
575 headers["Authorization"] = apiKey
576 headers["Authorization"] = apiKey
577+ case providerID == string(catwalk.InferenceProviderMiniMax):
578+ // NOTE: Prevent the SDK from picking up the API key from env.
579+ os.Setenv("ANTHROPIC_API_KEY", "")
580+ headers["Authorization"] = "Bearer " + apiKey
576− } else if apiKey != "" {
581+ case apiKey != "":
577 // X-Api-Key header
582 // X-Api-Key header
578 opts = append(opts, anthropic.WithAPIKey(apiKey))
583 opts = append(opts, anthropic.WithAPIKey(apiKey))
@@ -793,7 +798,7 @@ func (c *coordinator) buildProvider(providerCfg config.ProviderConfig, model con
793 case openai.Name:
798 case openai.Name:
794 return c.buildOpenaiProvider(baseURL, apiKey, headers)
799 return c.buildOpenaiProvider(baseURL, apiKey, headers)
795 case anthropic.Name:
800 case anthropic.Name:
796− return c.buildAnthropicProvider(baseURL, apiKey, headers)
801+ return c.buildAnthropicProvider(baseURL, apiKey, headers, providerCfg.ID)
797 case openrouter.Name:
802 case openrouter.Name:
798 return c.buildOpenrouterProvider(baseURL, apiKey, headers)
803 return c.buildOpenrouterProvider(baseURL, apiKey, headers)
799 case vercel.Name:
804 case vercel.Name: