@@ -546,15 +546,12 @@ func (c *ProviderConfig) TestConnection(resolver VariableResolver) error {
546 if err != nil {
546 if err != nil {
547 return fmt.Errorf("failed to create request for provider %s: %w", c.ID, err)
547 return fmt.Errorf("failed to create request for provider %s: %w", c.ID, err)
549− if c.ID == string(catwalk.InferenceProviderZAI) {
549+ if c.ID == string(catwalk.InferenceProviderZAI) && b.StatusCode == http.StatusUnauthorized {
550− if b.StatusCode == http.StatusUnauthorized {
551− // for z.ai just check if the http response is not 401
550+ // for z.ai just check if the http response is not 401
552− return fmt.Errorf("failed to connect to provider %s: %s", c.ID, b.Status)
551+ return fmt.Errorf("failed to connect to provider %s: %s", c.ID, b.Status)
555− if b.StatusCode != http.StatusOK {
553+ if b.StatusCode != http.StatusOK {
556− return fmt.Errorf("failed to connect to provider %s: %s", c.ID, b.Status)
554+ return fmt.Errorf("failed to connect to provider %s: %s", c.ID, b.Status)
559 _ = b.Body.Close()
556 _ = b.Body.Close()
560 return nil
557 return nil