Skip to content

Self-improving AI Employees for everyone

feat(credentials): Wave 11.E — declarative provider credentials

trohitg5d2139c59390
diff --git a/server/credentials/apify.py b/server/credentials/apify.py
new file mode 100644
index 00000000..c31c5204
--- /dev/null
+++ b/server/credentials/apify.py
@@ -0,0 +1,15 @@
+"""Apify API-token credential (Wave 11.E)."""
+
+from __future__ import annotations
+
+from services.plugin.credential import ApiKeyCredential
+
+
+class ApifyCredential(ApiKeyCredential):
+ id = "apify"
+ display_name = "Apify"
+ category = "Scrapers"
+ icon = "asset:apify"
+ key_name = "Authorization"
+ key_location = "bearer"
+ docs_url = "https://docs.apify.com/api/v2"
diff --git a/server/credentials/google.py b/server/credentials/google.py
new file mode 100644
index 00000000..78600393
--- /dev/null
+++ b/server/credentials/google.py
@@ -0,0 +1,61 @@
+"""Google Workspace credential (Wave 11.E).
+
+One declarative credential shared by all six Google plugins — gmail,
+calendar, drive, sheets, tasks, contacts. The plugins don't use the
+:class:`Connection` facade (they need ``google.oauth2.credentials.Credentials``
+to hand to ``googleapiclient.discovery.build``), so :meth:`build_credentials`
+returns that object instead of an httpx request.
+
+OAuth flow (authorization_url / token_url / scopes) is owned by
+:mod:`services.google_oauth`; this class is the plugin-facing interface
++ Credentials-modal metadata.
+"""
+
+from __future__ import annotations
+
+from typing import Any, ClassVar, Dict
+
+from services.plugin.credential import OAuth2Credential
+
+
+class GoogleCredential(OAuth2Credential):
+ id = "google"
+ display_name = "Google Workspace"
+ category = "Productivity"
+ icon = "asset:google"
+ authorization_url = "https://accounts.google.com/o/oauth2/auth"
+ token_url = "https://oauth2.googleapis.com/token"
+ client_id_api_key = "google_client_id"
+ client_secret_api_key = "google_client_secret"
+ docs_url = "https://developers.google.com/workspace"
+
+ # Scope union across all 6 Google plugins. Single source of truth:
+ # :data:`services.google_oauth.GOOGLE_WORKSPACE_SCOPES`, exposed lazily
+ # to avoid import-cycle risk during credential auto-discovery.
+ scopes: ClassVar[tuple] = ()
+
+ @classmethod
+ def get_scopes(cls) -> tuple:
+ """Return the live scope list (lazy import)."""
+ if not cls.scopes:
+ from services.google_oauth import GOOGLE_WORKSPACE_SCOPES
+ cls.scopes = tuple(GOOGLE_WORKSPACE_SCOPES)
+ return cls.scopes
+
+ @classmethod
+ async def build_credentials(
+ cls,
+ parameters: Dict[str, Any],
+ context: Dict[str, Any],
+ ):
+ """Return a ``google.oauth2.credentials.Credentials`` object.
+
+ Thin wrapper over :func:`services.handlers.google_auth.get_google_credentials`
+ — the existing helper already handles owner-vs-customer token
+ sources + proactive refresh. Keeping the implementation there
+ (plus this indirection) means the plugin file's import surface
+ stays flat and there's a single place to evolve the refresh
+ policy.
+ """
+ from services.handlers.google_auth import get_google_credentials
+ return await get_google_credentials(parameters, context)
diff --git a/server/credentials/google_maps.py b/server/credentials/google_maps.py
new file mode 100644
index 00000000..8ac07952
--- /dev/null
+++ b/server/credentials/google_maps.py
@@ -0,0 +1,19 @@
+"""Google Maps API-key credential (Wave 11.E).
+
+Separate from :class:`GoogleCredential` because Maps uses a static API
+key (billing-tied to a GCP project) whereas Workspace uses OAuth.
+"""
+
+from __future__ import annotations
+
+from services.plugin.credential import ApiKeyCredential
+
+
+class GoogleMapsCredential(ApiKeyCredential):
+ id = "google_maps"
+ display_name = "Google Maps"
+ category = "Location"
+ icon = "asset:google_maps"
+ key_name = "key"
+ key_location = "query"
+ docs_url = "https://developers.google.com/maps/documentation"
diff --git a/server/credentials/llm.py b/server/credentials/llm.py
new file mode 100644
index 00000000..032de3b7
--- /dev/null
+++ b/server/credentials/llm.py
@@ -0,0 +1,95 @@
+"""LLM provider API-key credentials (Wave 11.E).
+
+One :class:`ApiKeyCredential` per provider. Chat-model and agent
+plugins reference them via ``credentials = (OpenAICredential,)`` etc.
+At execution time the plugin's LangChain / native SDK client pulls the
+key directly from :mod:`services.auth`; this class is the
+Credentials-modal + discovery manifest, not the runtime client.
+"""
+
+from __future__ import annotations
+
+from services.plugin.credential import ApiKeyCredential
+
+
+class _LLMApiKey(ApiKeyCredential):
+ """Shared defaults. Subclasses only set id / display_name / icon."""
+
+ category = "AI"
+ key_name = "Authorization"
+ key_location = "bearer"
+
+
+class OpenAICredential(_LLMApiKey):
+ id = "openai"
+ display_name = "OpenAI"
+ icon = "asset:openai"
+ docs_url = "https://platform.openai.com/api-keys"
+
+
+class AnthropicCredential(_LLMApiKey):
+ id = "anthropic"
+ display_name = "Anthropic"
+ icon = "asset:anthropic"
+ docs_url = "https://console.anthropic.com/settings/keys"
+ # Anthropic uses ``x-api-key`` not Bearer.
+ key_name = "x-api-key"
+ key_location = "header"
+
+
+class GeminiCredential(_LLMApiKey):
+ id = "gemini"
+ display_name = "Google Gemini"
+ icon = "asset:gemini"
+ docs_url = "https://ai.google.dev/gemini-api/docs/api-key"
+ key_name = "key"
+ key_location = "query"
+
+
+class OpenRouterCredential(_LLMApiKey):
+ id = "openrouter"
+ display_name = "OpenRouter"
+ icon = "asset:openrouter"
+ docs_url = "https://openrouter.ai/keys"
+
+
+class GroqCredential(_LLMApiKey):
+ id = "groq"
+ display_name = "Groq"
+ icon = "asset:groq"
+ docs_url = "https://console.groq.com/keys"
+
+
+class CerebrasCredential(_LLMApiKey):
+ id = "cerebras"
+ display_name = "Cerebras"
+ icon = "asset:cerebras"
+ docs_url = "https://cloud.cerebras.ai/"
+
+
+class DeepSeekCredential(_LLMApiKey):
+ id = "deepseek"
+ display_name = "DeepSeek"
+ icon = "asset:deepseek"
+ docs_url = "https://platform.deepseek.com/api_keys"
+
+
+class KimiCredential(_LLMApiKey):
+ id = "kimi"
+ display_name = "Kimi (Moonshot)"
+ icon = "asset:kimi"
+ docs_url = "https://platform.moonshot.cn"
+
+
+class MistralCredential(_LLMApiKey):
+ id = "mistral"
+ display_name = "Mistral AI"
+ icon = "asset:mistral"
+ docs_url = "https://console.mistral.ai/api-keys/"
+
+
+class XaiCredential(_LLMApiKey):
+ id = "xai"
+ display_name = "xAI (Grok)"
+ icon = "asset:xai"
+ docs_url = "https://console.x.ai"
diff --git a/server/credentials/telegram.py b/server/credentials/telegram.py
new file mode 100644
index 00000000..584e613f
--- /dev/null
+++ b/server/credentials/telegram.py
@@ -0,0 +1,16 @@
+"""Telegram bot-token credential (Wave 11.E)."""
+
+from __future__ import annotations
+
+from services.plugin.credential import ApiKeyCredential
+
+
+class TelegramCredential(ApiKeyCredential):
+ id = "telegram_bot_token"
+ display_name = "Telegram Bot"
+ category = "Social"
+ icon = "asset:telegram"
+ key_name = "" # not used — python-telegram-bot takes the token directly
+ key_location = "header"
+ extra_fields = ("telegram_owner_chat_id",)
+ docs_url = "https://core.telegram.org/bots"
diff --git a/server/credentials/twitter.py b/server/credentials/twitter.py
new file mode 100644
index 00000000..231d2c36
--- /dev/null
+++ b/server/credentials/twitter.py
@@ -0,0 +1,32 @@
+"""Twitter / X credential (Wave 11.E).
+
+OAuth 2.0 with PKCE. The refresh flow is non-trivial (custom code exchange
+in :mod:`services.twitter_oauth`), so :meth:`build_client` returns an
+authenticated XDK ``Client`` — that's what the four twitter plugins
+actually hand to the XDK API methods. Use :func:`nodes.twitter._base.call_with_retry`
+on top; it transparently refreshes on 401/403 via this class.
+"""
+
+from __future__ import annotations
+
+from typing import Any, Dict
+
+from services.plugin.credential import OAuth2Credential
+
+
+class TwitterCredential(OAuth2Credential):
+ id = "twitter"
+ display_name = "Twitter / X"
+ category = "Social"
+ icon = "asset:x"
+ authorization_url = "https://twitter.com/i/oauth2/authorize"
+ token_url = "https://api.twitter.com/2/oauth2/token"
+ client_id_api_key = "twitter_client_id"
+ client_secret_api_key = "twitter_client_secret"
+ scopes = (
+ "tweet.read", "tweet.write", "users.read",
+ "follows.read", "follows.write",
+ "like.read", "like.write",
+ "offline.access",
+ )
+ docs_url = "https://developer.x.com/en/docs/authentication/oauth-2-0"
diff --git a/server/nodes/google/_base.py b/server/nodes/google/_base.py
index 8e23312d..fa67b494 100644
--- a/server/nodes/google/_base.py
+++ b/server/nodes/google/_base.py
@@ -17,7 +17,7 @@ from typing import Any, Dict
from googleapiclient.discovery import build
from core.logging import get_logger
-from services.handlers.google_auth import get_google_credentials
+from credentials.google import GoogleCredential
from services.pricing import get_pricing_service
logger = get_logger(__name__)
@@ -35,10 +35,10 @@ async def build_google_service(
api_name: Google API short name (``gmail`` / ``calendar`` / ``drive`` /
``sheets`` / ``tasks`` / ``people``).
api_version: API version (e.g. ``v1``, ``v3``).
- parameters: Node parameters (forwarded to ``get_google_credentials``).
+ parameters: Node parameters (forwarded to ``GoogleCredential.build_credentials``).
context: Execution context (forwarded).
"""
- creds = await get_google_credentials(parameters, context)
+ creds = await GoogleCredential.build_credentials(parameters, context)
loop = asyncio.get_event_loop()
return await loop.run_in_executor(
None, lambda: build(api_name, api_version, credentials=creds),
diff --git a/server/nodes/google/calendar.py b/server/nodes/google/calendar.py
index 0431462d..704e66f8 100644
--- a/server/nodes/google/calendar.py
+++ b/server/nodes/google/calendar.py
@@ -9,6 +9,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
@@ -85,6 +87,7 @@ class CalendarNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/google/contacts.py b/server/nodes/google/contacts.py
index bab28158..b1900321 100644
--- a/server/nodes/google/contacts.py
+++ b/server/nodes/google/contacts.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
@@ -93,6 +95,7 @@ class ContactsNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/google/drive.py b/server/nodes/google/drive.py
index b793c84e..ac66b1e3 100644
--- a/server/nodes/google/drive.py
+++ b/server/nodes/google/drive.py
@@ -12,6 +12,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
@@ -82,6 +84,7 @@ class DriveNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/google/gmail.py b/server/nodes/google/gmail.py
index cb9c442c..b5fb9107 100644
--- a/server/nodes/google/gmail.py
+++ b/server/nodes/google/gmail.py
@@ -11,6 +11,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
from ._gmail import fetch_email_details, format_message
@@ -94,7 +96,7 @@ class GmailNode(ActionNode):
{"name": "output-main", "kind": "output", "position": "right",
"label": "Output", "role": "main"},
)
- credentials = ()
+ credentials = (GoogleCredential,)
annotations = {"destructive": False, "readonly": False, "open_world": True}
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/google/gmail_receive.py b/server/nodes/google/gmail_receive.py
index 3cf18cf3..791bd516 100644
--- a/server/nodes/google/gmail_receive.py
+++ b/server/nodes/google/gmail_receive.py
@@ -12,6 +12,8 @@ from pydantic import BaseModel, ConfigDict, Field
from core.logging import get_logger
from services.plugin import NodeContext, Operation, TaskQueue, TriggerNode
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, track_google_usage
from ._gmail import fetch_email_details, mark_email_as_read, poll_gmail_ids
@@ -62,6 +64,7 @@ class GmailReceiveNode(TriggerNode):
{"name": "output-main", "kind": "output", "position": "right",
"label": "Output", "role": "main"},
)
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.TRIGGERS_POLL
mode = "polling"
default_poll_interval = 60
diff --git a/server/nodes/google/sheets.py b/server/nodes/google/sheets.py
index b2305f52..a21f95f1 100644
--- a/server/nodes/google/sheets.py
+++ b/server/nodes/google/sheets.py
@@ -12,6 +12,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
@@ -68,6 +70,7 @@ class SheetsNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/google/tasks.py b/server/nodes/google/tasks.py
index 6f8c35b3..7d2366bd 100644
--- a/server/nodes/google/tasks.py
+++ b/server/nodes/google/tasks.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google import GoogleCredential
+
from ._base import build_google_service, run_sync, track_google_usage
@@ -67,6 +69,7 @@ class TasksNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (GoogleCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/location/gmaps_create.py b/server/nodes/location/gmaps_create.py
index 0b2b0630..482596b1 100644
--- a/server/nodes/location/gmaps_create.py
+++ b/server/nodes/location/gmaps_create.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google_maps import GoogleMapsCredential
+
class GmapsCreateParams(BaseModel):
center_lat: float = Field(default=0.0, alias="centerLat")
@@ -44,6 +46,7 @@ class GmapsCreateNode(ActionNode):
)
ui_hints = {"showLocationPanel": True}
annotations = {"destructive": False, "readonly": True, "open_world": False}
+ credentials = (GoogleMapsCredential,)
task_queue = TaskQueue.DEFAULT
Params = GmapsCreateParams
diff --git a/server/nodes/location/gmaps_locations.py b/server/nodes/location/gmaps_locations.py
index 971e3825..84b29879 100644
--- a/server/nodes/location/gmaps_locations.py
+++ b/server/nodes/location/gmaps_locations.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google_maps import GoogleMapsCredential
+
class GmapsLocationsParams(BaseModel):
address: str = Field(..., min_length=1)
@@ -41,6 +43,7 @@ class GmapsLocationsNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": True, "open_world": True}
+ credentials = (GoogleMapsCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/location/gmaps_nearby_places.py b/server/nodes/location/gmaps_nearby_places.py
index beac6bd5..b641a05c 100644
--- a/server/nodes/location/gmaps_nearby_places.py
+++ b/server/nodes/location/gmaps_nearby_places.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.google_maps import GoogleMapsCredential
+
class GmapsNearbyPlacesParams(BaseModel):
latitude: float = Field(..., ge=-90.0, le=90.0)
@@ -42,6 +44,7 @@ class GmapsNearbyPlacesNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": True, "open_world": True}
+ credentials = (GoogleMapsCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/model/anthropic_chat_model.py b/server/nodes/model/anthropic_chat_model.py
index 96953b75..1a357118 100644
--- a/server/nodes/model/anthropic_chat_model.py
+++ b/server/nodes/model/anthropic_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import AnthropicCredential
+
class AnthropicChatModelParams(ChatModelParams):
top_k: Optional[int] = Field(default=40, alias="topK", ge=1, le=100)
@@ -23,4 +25,5 @@ class AnthropicChatModelNode(ChatModelBase):
group = ("model",)
description = "Anthropic Claude models for conversation and analysis"
+ credentials = (AnthropicCredential,)
Params = AnthropicChatModelParams
diff --git a/server/nodes/model/cerebras_chat_model.py b/server/nodes/model/cerebras_chat_model.py
index 4617d2d0..d0144c17 100644
--- a/server/nodes/model/cerebras_chat_model.py
+++ b/server/nodes/model/cerebras_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import CerebrasCredential
+
class CerebrasChatModelParams(ChatModelParams):
thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
@@ -22,4 +24,5 @@ class CerebrasChatModelNode(ChatModelBase):
group = ("model",)
description = "Cerebras ultra-fast inference on custom AI hardware"
+ credentials = (CerebrasCredential,)
Params = CerebrasChatModelParams
diff --git a/server/nodes/model/deepseek_chat_model.py b/server/nodes/model/deepseek_chat_model.py
index 2aeb309f..9778367a 100644
--- a/server/nodes/model/deepseek_chat_model.py
+++ b/server/nodes/model/deepseek_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import DeepSeekCredential
+
class DeepseekChatModelParams(ChatModelParams):
frequency_penalty: Optional[float] = Field(
@@ -23,4 +25,5 @@ class DeepseekChatModelNode(ChatModelBase):
group = ("model",)
description = "DeepSeek V3 models (deepseek-chat, deepseek-reasoner with always-on CoT)"
+ credentials = (DeepSeekCredential,)
Params = DeepseekChatModelParams
diff --git a/server/nodes/model/gemini_chat_model.py b/server/nodes/model/gemini_chat_model.py
index 8219723e..3b89d84b 100644
--- a/server/nodes/model/gemini_chat_model.py
+++ b/server/nodes/model/gemini_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import GeminiCredential
+
class GeminiChatModelParams(ChatModelParams):
top_k: Optional[int] = Field(default=40, alias="topK", ge=1, le=100)
@@ -26,4 +28,5 @@ class GeminiChatModelNode(ChatModelBase):
group = ("model",)
description = "Google Gemini models for multimodal AI capabilities"
+ credentials = (GeminiCredential,)
Params = GeminiChatModelParams
diff --git a/server/nodes/model/groq_chat_model.py b/server/nodes/model/groq_chat_model.py
index 1bde3fdb..e15378b6 100644
--- a/server/nodes/model/groq_chat_model.py
+++ b/server/nodes/model/groq_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import GroqCredential
+
class GroqChatModelParams(ChatModelParams):
thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")
@@ -22,4 +24,5 @@ class GroqChatModelNode(ChatModelBase):
group = ("model",)
description = "Groq ultra-fast LLM inference (Llama, Qwen3, GPT-OSS)"
+ credentials = (GroqCredential,)
Params = GroqChatModelParams
diff --git a/server/nodes/model/kimi_chat_model.py b/server/nodes/model/kimi_chat_model.py
index d8386cc4..0f787846 100644
--- a/server/nodes/model/kimi_chat_model.py
+++ b/server/nodes/model/kimi_chat_model.py
@@ -1,5 +1,7 @@
from ._base import ChatModelBase
+from credentials.llm import KimiCredential
+
class KimiChatModelNode(ChatModelBase):
type = "kimiChatModel"
@@ -9,3 +11,4 @@ class KimiChatModelNode(ChatModelBase):
color = "#bd93f9"
group = ("model",)
description = "Kimi K2 models by Moonshot AI with 256K context (thinking on by default)"
+ credentials = (KimiCredential,)
diff --git a/server/nodes/model/mistral_chat_model.py b/server/nodes/model/mistral_chat_model.py
index a9b06d27..6ecda745 100644
--- a/server/nodes/model/mistral_chat_model.py
+++ b/server/nodes/model/mistral_chat_model.py
@@ -1,5 +1,7 @@
from ._base import ChatModelBase
+from credentials.llm import MistralCredential
+
class MistralChatModelNode(ChatModelBase):
type = "mistralChatModel"
@@ -9,3 +11,4 @@ class MistralChatModelNode(ChatModelBase):
color = "#ffb86c"
group = ("model",)
description = "Mistral AI models for reasoning, coding, and multilingual tasks"
+ credentials = (MistralCredential,)
diff --git a/server/nodes/model/openai_chat_model.py b/server/nodes/model/openai_chat_model.py
index 395c1218..90d23daa 100644
--- a/server/nodes/model/openai_chat_model.py
+++ b/server/nodes/model/openai_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import OpenAICredential
+
class OpenAIChatModelParams(ChatModelParams):
frequency_penalty: Optional[float] = Field(
@@ -33,4 +35,5 @@ class OpenAIChatModelNode(ChatModelBase):
group = ("model",)
description = "OpenAI GPT models for chat completion and generation"
+ credentials = (OpenAICredential,)
Params = OpenAIChatModelParams
diff --git a/server/nodes/model/openrouter_chat_model.py b/server/nodes/model/openrouter_chat_model.py
index 8958c966..fa820104 100644
--- a/server/nodes/model/openrouter_chat_model.py
+++ b/server/nodes/model/openrouter_chat_model.py
@@ -4,6 +4,8 @@ from pydantic import Field
from ._base import ChatModelBase, ChatModelParams
+from credentials.llm import OpenRouterCredential
+
class OpenRouterChatModelParams(ChatModelParams):
frequency_penalty: Optional[float] = Field(
@@ -23,4 +25,5 @@ class OpenRouterChatModelNode(ChatModelBase):
group = ("model",)
description = "OpenRouter unified API - access OpenAI, Claude, Gemini, Llama, and more"
+ credentials = (OpenRouterCredential,)
Params = OpenRouterChatModelParams
diff --git a/server/nodes/scraper/apify_actor.py b/server/nodes/scraper/apify_actor.py
index f29eef07..58c9f60f 100644
--- a/server/nodes/scraper/apify_actor.py
+++ b/server/nodes/scraper/apify_actor.py
@@ -15,12 +15,14 @@ from pydantic import BaseModel, ConfigDict, Field
from core.logging import get_logger
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.apify import ApifyCredential
+
logger = get_logger(__name__)
async def _get_apify_client():
- from apify_client import ApifyClientAsync # lazy — optional dep
"""Return an authenticated Apify client, or None if no token saved."""
+ from apify_client import ApifyClientAsync # lazy — optional dep
from core.container import container
auth_service = container.auth_service()
api_token = await auth_service.get_api_key("apify", "default")
@@ -146,6 +148,7 @@ class ApifyActorNode(ActionNode):
{"name": "output-main", "kind": "output", "position": "right", "label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": True, "open_world": True}
+ credentials = (ApifyCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/telegram/telegram_receive.py b/server/nodes/telegram/telegram_receive.py
index 97ed847e..b07d27a0 100644
--- a/server/nodes/telegram/telegram_receive.py
+++ b/server/nodes/telegram/telegram_receive.py
@@ -14,6 +14,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import NodeContext, Operation, TaskQueue, TriggerNode
+from credentials.telegram import TelegramCredential
+
class TelegramReceiveParams(BaseModel):
content_type_filter: Literal[
@@ -76,6 +78,7 @@ class TelegramReceiveNode(TriggerNode):
{"name": "output-main", "kind": "output", "position": "right",
"label": "Output", "role": "main"},
)
+ credentials = (TelegramCredential,)
task_queue = TaskQueue.TRIGGERS_EVENT
mode = "event"
event_type = "telegram_message_received"
diff --git a/server/nodes/telegram/telegram_send.py b/server/nodes/telegram/telegram_send.py
index 24536287..5967972d 100644
--- a/server/nodes/telegram/telegram_send.py
+++ b/server/nodes/telegram/telegram_send.py
@@ -14,6 +14,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.telegram import TelegramCredential
+
class TelegramSendParams(BaseModel):
recipient_type: Literal["self", "chat_id"] = Field(
@@ -91,6 +93,7 @@ class TelegramSendNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (TelegramCredential,)
task_queue = TaskQueue.MESSAGING
usable_as_tool = True
diff --git a/server/nodes/twitter/twitter_receive.py b/server/nodes/twitter/twitter_receive.py
index 2a3f4367..ee33b34f 100644
--- a/server/nodes/twitter/twitter_receive.py
+++ b/server/nodes/twitter/twitter_receive.py
@@ -8,6 +8,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import NodeContext, Operation, TaskQueue, TriggerNode
+from credentials.twitter import TwitterCredential
+
class TwitterReceiveParams(BaseModel):
trigger_type: Literal["mentions", "search", "timeline"] = Field(
@@ -43,6 +45,7 @@ class TwitterReceiveNode(TriggerNode):
{"name": "output-main", "kind": "output", "position": "right",
"label": "Output", "role": "main"},
)
+ credentials = (TwitterCredential,)
task_queue = TaskQueue.TRIGGERS_POLL
mode = "polling"
default_poll_interval = 60
diff --git a/server/nodes/twitter/twitter_search.py b/server/nodes/twitter/twitter_search.py
index d25590e2..50c41e82 100644
--- a/server/nodes/twitter/twitter_search.py
+++ b/server/nodes/twitter/twitter_search.py
@@ -9,6 +9,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.twitter import TwitterCredential
+
from ._base import (
call_with_retry, format_tweet, includes_lookups,
sync_search_recent, track_twitter_usage,
@@ -55,6 +57,7 @@ class TwitterSearchNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": True, "open_world": True}
+ credentials = (TwitterCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True
diff --git a/server/nodes/twitter/twitter_send.py b/server/nodes/twitter/twitter_send.py
index 1846ce5b..6e979bd9 100644
--- a/server/nodes/twitter/twitter_send.py
+++ b/server/nodes/twitter/twitter_send.py
@@ -9,6 +9,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.twitter import TwitterCredential
+
from ._base import (
call_with_retry, format_response, get_my_user_id, track_twitter_usage,
)
@@ -103,6 +105,7 @@ class TwitterSendNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": False, "open_world": True}
+ credentials = (TwitterCredential,)
task_queue = TaskQueue.MESSAGING
usable_as_tool = True
diff --git a/server/nodes/twitter/twitter_user.py b/server/nodes/twitter/twitter_user.py
index bb0d1655..d55c11bd 100644
--- a/server/nodes/twitter/twitter_user.py
+++ b/server/nodes/twitter/twitter_user.py
@@ -9,6 +9,8 @@ from pydantic import BaseModel, ConfigDict, Field
from services.plugin import ActionNode, NodeContext, Operation, TaskQueue
+from credentials.twitter import TwitterCredential
+
from ._base import call_with_retry, format_user, get_my_user_id, track_twitter_usage
@@ -111,6 +113,7 @@ class TwitterUserNode(ActionNode):
"label": "Output", "role": "main"},
)
annotations = {"destructive": False, "readonly": True, "open_world": True}
+ credentials = (TwitterCredential,)
task_queue = TaskQueue.REST_API
usable_as_tool = True