Skip to main content
Version: v2.0

Commercial Integrations

Integrations connect external services — Slack, Gmail, Airtable, LinkedIn, and more — to your agents. Once connected, agents can execute real-world actions via natural language prompts.

Setup

pip install aixplain
from aixplain import Aixplain

aix = Aixplain(api_key="YOUR_API_KEY")

Discover integrations

integrations = aix.Integration.search()["results"]
for integration in integrations[:5]:
print(integration)
Show output

Authentication

How you connect an integration depends on its authentication type.

OAuth (UI required)

For OAuth-based integrations (Google, Slack OAuth, Microsoft, etc.):

  1. Go to Discover → Integrations in Studio.
  2. Search for and select your integration.
  3. Click the card and complete the OAuth flow.
  4. Once authenticated, the card updates to show your linked account.

After the OAuth flow completes, the integration is available to use in the SDK.

API key / bearer token (SDK)

For API key or bearer token integrations, create and configure the tool directly in the SDK — no UI required:

import time

slack_tool = aix.Tool(
name=f"Slack Tool ({int(time.time())})",
description="Sends messages to Slack channels.",
integration="composio/slack",
config={"token": "YOUR_SLACK_TOKEN"},
)
slack_tool.save()

print("Tool ID:", slack_tool.id)
print("Status:", slack_tool.status)
Show output
note

Always call save() before running a tool. Calling run() on an unsaved tool will raise an error.

List available actions

Inspect what actions an integration or tool exposes:

# From an integration
integration = aix.Integration.get("composio/linkedin")
integration.list_actions()

# From a saved tool
slack_tool.list_actions()
Show output

Scope allowed actions

Limit a tool to only the actions your agent actually needs. This prevents irrelevant calls and reduces hallucinations:

slack_tool.allowed_actions = ["SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"]

Run a tool action

Explicit action

response = slack_tool.run(
{"text": "Hello!", "channel": "integrations-test"},
action="SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL",
)
print(response)
Show output

Implicit action (single allowed action)

If allowed_actions contains exactly one entry, you can omit the action parameter:

slack_tool.allowed_actions = ["SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL"]

response = slack_tool.run({"text": "Hello!", "channel": "integrations-test"})
print(response)
Show output

If multiple actions are allowed and you omit action, the call will raise an error.

Use integrations in agents

agent = aix.Agent(
name="Slack Notifier",
description="Sends notifications to Slack.",
instructions="Send messages to Slack channels when asked.",
tools=[slack_tool],
)
agent.save()

response = agent.run("Notify #integrations-test that today's meeting is cancelled.")
print(response.data.output)
Show output

Security

Composio-backed integrations store all credentials within Composio's infrastructure. The platform maintains SOC 2 Type II and ISO compliance, with encryption enforced at rest and in transit.

Next steps