diff --git a/modules/api_plugins_anthropic/api_plugins_anthropic.module b/modules/api_plugins_anthropic/api_plugins_anthropic.module
index b93c149..ae7047c 100644
--- a/modules/api_plugins_anthropic/api_plugins_anthropic.module
+++ b/modules/api_plugins_anthropic/api_plugins_anthropic.module
@@ -1,5 +1,8 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\api_plugins_anthropic\Hook\ApiPluginsAnthropicHooks;
+
 /**
  * @file
  * Contains hooks for the API Plugins Anthropic module.
@@ -8,29 +11,15 @@
 /**
  * Implements hook_api_plugins_api_key_info().
  */
+#[LegacyHook]
 function api_plugins_anthropic_api_plugins_api_key_info(): array {
-  return [
-    'anthropic' => [
-      'label' => t('Anthropic API Key'),
-      'description' => t('Select the key to use for Anthropic API authentication. Get your API key from <a href="@url" target="_blank">Claude Console</a>.', [
-        '@url' => 'https://docs.claude.com/en/api/admin-api/apikeys/get-api-key',
-      ]),
-      'config_key' => 'api_keys.anthropic_key',
-      'weight' => 0,
-    ],
-  ];
+  return \Drupal::service(ApiPluginsAnthropicHooks::class)->apiPluginsApiKeyInfo();
 }
 
 /**
  * Implements hook_api_plugins_authentication_info().
  */
+#[LegacyHook]
 function api_plugins_anthropic_api_plugins_authentication_info(): array {
-  return [
-    'anthropic' => [
-      'config_key' => 'api_keys.anthropic_key',
-      'env_var' => 'ANTHROPIC_API_KEY',
-      'auth_type' => 'bearer',
-      'header_name' => 'Authorization',
-    ],
-  ];
+  return \Drupal::service(ApiPluginsAnthropicHooks::class)->apiPluginsAuthenticationInfo();
 }
diff --git a/modules/api_plugins_anthropic/api_plugins_anthropic.services.yml b/modules/api_plugins_anthropic/api_plugins_anthropic.services.yml
new file mode 100644
index 0000000..fa01373
--- /dev/null
+++ b/modules/api_plugins_anthropic/api_plugins_anthropic.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\api_plugins_anthropic\Hook\ApiPluginsAnthropicHooks:
+    class: Drupal\api_plugins_anthropic\Hook\ApiPluginsAnthropicHooks
+    autowire: true
diff --git a/modules/api_plugins_anthropic/src/Hook/ApiPluginsAnthropicHooks.php b/modules/api_plugins_anthropic/src/Hook/ApiPluginsAnthropicHooks.php
new file mode 100644
index 0000000..571abce
--- /dev/null
+++ b/modules/api_plugins_anthropic/src/Hook/ApiPluginsAnthropicHooks.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\api_plugins_anthropic\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for api_plugins_anthropic.
+ */
+class ApiPluginsAnthropicHooks
+{
+    use StringTranslationTrait;
+    /**
+     * @file
+     * Contains hooks for the API Plugins Anthropic module.
+     */
+    /**
+     * Implements hook_api_plugins_api_key_info().
+     */
+    #[Hook('api_plugins_api_key_info')]
+    public function apiPluginsApiKeyInfo(): array
+    {
+        return [
+            'anthropic' => [
+                'label' => $this->t('Anthropic API Key'),
+                'description' => $this->t('Select the key to use for Anthropic API authentication. Get your API key from <a href="@url" target="_blank">Claude Console</a>.', [
+                    '@url' => 'https://docs.claude.com/en/api/admin-api/apikeys/get-api-key',
+                ]),
+                'config_key' => 'api_keys.anthropic_key',
+                'weight' => 0,
+            ],
+        ];
+    }
+    /**
+     * Implements hook_api_plugins_authentication_info().
+     */
+    #[Hook('api_plugins_authentication_info')]
+    public static function apiPluginsAuthenticationInfo(): array
+    {
+        return [
+            'anthropic' => [
+                'config_key' => 'api_keys.anthropic_key',
+                'env_var' => 'ANTHROPIC_API_KEY',
+                'auth_type' => 'bearer',
+                'header_name' => 'Authorization',
+            ],
+        ];
+    }
+}
diff --git a/modules/api_plugins_mcp/api_plugins_mcp.module b/modules/api_plugins_mcp/api_plugins_mcp.module
index b9b6bf1..18a27c4 100644
--- a/modules/api_plugins_mcp/api_plugins_mcp.module
+++ b/modules/api_plugins_mcp/api_plugins_mcp.module
@@ -1,5 +1,8 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\api_plugins_mcp\Hook\ApiPluginsMcpHooks;
+
 /**
  * @file
  * Contains hooks for the API Plugins MCP module.
@@ -8,29 +11,15 @@
 /**
  * Implements hook_api_plugins_api_key_info().
  */
+#[LegacyHook]
 function api_plugins_mcp_api_plugins_api_key_info(): array {
-  return [
-    'apify' => [
-      'label' => t('Apify API Token'),
-      'description' => t('Select the key to use for Apify MCP Server authentication. Get your API token from <a href="@url" target="_blank">Apify Console</a>.', [
-        '@url' => 'https://console.apify.com/account/integrations',
-      ]),
-      'config_key' => 'api_keys.apify_key',
-      'weight' => 20,
-    ],
-  ];
+  return \Drupal::service(ApiPluginsMcpHooks::class)->apiPluginsApiKeyInfo();
 }
 
 /**
  * Implements hook_api_plugins_authentication_info().
  */
+#[LegacyHook]
 function api_plugins_mcp_api_plugins_authentication_info(): array {
-  return [
-    'apify' => [
-      'config_key' => 'api_keys.apify_key',
-      'env_var' => 'APIFY_API_TOKEN',
-      'auth_type' => 'bearer',
-      'header_name' => 'Authorization',
-    ],
-  ];
+  return \Drupal::service(ApiPluginsMcpHooks::class)->apiPluginsAuthenticationInfo();
 }
diff --git a/modules/api_plugins_mcp/api_plugins_mcp.services.yml b/modules/api_plugins_mcp/api_plugins_mcp.services.yml
new file mode 100644
index 0000000..2ff6315
--- /dev/null
+++ b/modules/api_plugins_mcp/api_plugins_mcp.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\api_plugins_mcp\Hook\ApiPluginsMcpHooks:
+    class: Drupal\api_plugins_mcp\Hook\ApiPluginsMcpHooks
+    autowire: true
diff --git a/modules/api_plugins_mcp/src/Hook/ApiPluginsMcpHooks.php b/modules/api_plugins_mcp/src/Hook/ApiPluginsMcpHooks.php
new file mode 100644
index 0000000..47c6e5c
--- /dev/null
+++ b/modules/api_plugins_mcp/src/Hook/ApiPluginsMcpHooks.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\api_plugins_mcp\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for api_plugins_mcp.
+ */
+class ApiPluginsMcpHooks
+{
+    use StringTranslationTrait;
+    /**
+     * @file
+     * Contains hooks for the API Plugins MCP module.
+     */
+    /**
+     * Implements hook_api_plugins_api_key_info().
+     */
+    #[Hook('api_plugins_api_key_info')]
+    public function apiPluginsApiKeyInfo(): array
+    {
+        return [
+            'apify' => [
+                'label' => $this->t('Apify API Token'),
+                'description' => $this->t('Select the key to use for Apify MCP Server authentication. Get your API token from <a href="@url" target="_blank">Apify Console</a>.', [
+                    '@url' => 'https://console.apify.com/account/integrations',
+                ]),
+                'config_key' => 'api_keys.apify_key',
+                'weight' => 20,
+            ],
+        ];
+    }
+    /**
+     * Implements hook_api_plugins_authentication_info().
+     */
+    #[Hook('api_plugins_authentication_info')]
+    public static function apiPluginsAuthenticationInfo(): array
+    {
+        return [
+            'apify' => [
+                'config_key' => 'api_keys.apify_key',
+                'env_var' => 'APIFY_API_TOKEN',
+                'auth_type' => 'bearer',
+                'header_name' => 'Authorization',
+            ],
+        ];
+    }
+}
diff --git a/modules/api_plugins_openai/api_plugins_openai.module b/modules/api_plugins_openai/api_plugins_openai.module
index 124271c..08d91fa 100644
--- a/modules/api_plugins_openai/api_plugins_openai.module
+++ b/modules/api_plugins_openai/api_plugins_openai.module
@@ -1,5 +1,8 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\api_plugins_openai\Hook\ApiPluginsOpenaiHooks;
+
 /**
  * @file
  * Contains hooks for the API Plugins OpenAI module.
@@ -8,29 +11,15 @@
 /**
  * Implements hook_api_plugins_api_key_info().
  */
+#[LegacyHook]
 function api_plugins_openai_api_plugins_api_key_info(): array {
-  return [
-    'openai' => [
-      'label' => t('OpenAI API Key'),
-      'description' => t('Select the key to use for OpenAI API authentication. Get your API key from <a href="@url" target="_blank">OpenAI Platform</a>.', [
-        '@url' => 'https://platform.openai.com/api-keys',
-      ]),
-      'config_key' => 'api_keys.openai_key',
-      'weight' => 0,
-    ],
-  ];
+  return \Drupal::service(ApiPluginsOpenaiHooks::class)->apiPluginsApiKeyInfo();
 }
 
 /**
  * Implements hook_api_plugins_authentication_info().
  */
+#[LegacyHook]
 function api_plugins_openai_api_plugins_authentication_info(): array {
-  return [
-    'openai' => [
-      'config_key' => 'api_keys.openai_key',
-      'env_var' => 'OPENAI_API_KEY',
-      'auth_type' => 'bearer',
-      'header_name' => 'Authorization',
-    ],
-  ];
+  return \Drupal::service(ApiPluginsOpenaiHooks::class)->apiPluginsAuthenticationInfo();
 }
diff --git a/modules/api_plugins_openai/api_plugins_openai.services.yml b/modules/api_plugins_openai/api_plugins_openai.services.yml
new file mode 100644
index 0000000..0021dad
--- /dev/null
+++ b/modules/api_plugins_openai/api_plugins_openai.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\api_plugins_openai\Hook\ApiPluginsOpenaiHooks:
+    class: Drupal\api_plugins_openai\Hook\ApiPluginsOpenaiHooks
+    autowire: true
diff --git a/modules/api_plugins_openai/src/Hook/ApiPluginsOpenaiHooks.php b/modules/api_plugins_openai/src/Hook/ApiPluginsOpenaiHooks.php
new file mode 100644
index 0000000..2aa6ee2
--- /dev/null
+++ b/modules/api_plugins_openai/src/Hook/ApiPluginsOpenaiHooks.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\api_plugins_openai\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for api_plugins_openai.
+ */
+class ApiPluginsOpenaiHooks
+{
+    use StringTranslationTrait;
+    /**
+     * @file
+     * Contains hooks for the API Plugins OpenAI module.
+     */
+    /**
+     * Implements hook_api_plugins_api_key_info().
+     */
+    #[Hook('api_plugins_api_key_info')]
+    public function apiPluginsApiKeyInfo(): array
+    {
+        return [
+            'openai' => [
+                'label' => $this->t('OpenAI API Key'),
+                'description' => $this->t('Select the key to use for OpenAI API authentication. Get your API key from <a href="@url" target="_blank">OpenAI Platform</a>.', [
+                    '@url' => 'https://platform.openai.com/api-keys',
+                ]),
+                'config_key' => 'api_keys.openai_key',
+                'weight' => 0,
+            ],
+        ];
+    }
+    /**
+     * Implements hook_api_plugins_authentication_info().
+     */
+    #[Hook('api_plugins_authentication_info')]
+    public static function apiPluginsAuthenticationInfo(): array
+    {
+        return [
+            'openai' => [
+                'config_key' => 'api_keys.openai_key',
+                'env_var' => 'OPENAI_API_KEY',
+                'auth_type' => 'bearer',
+                'header_name' => 'Authorization',
+            ],
+        ];
+    }
+}
