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 scheme. Each integration declares which schemes it supports; the credentials you pass in config differ per scheme.

SchemeHow you connectWhat you pass
OAUTH2Browser redirect flow (Studio UI or redirect_url)No credentials in config — you authorize in the browser
OAUTH1Browser redirect flow (Studio UI or redirect_url)No credentials in config — you authorize in the browser
API_KEYSDKconfig={"api_key": "..."}
BEARER_TOKENSDKconfig={"token": "..."}
BASICSDKconfig={"username": "...", "password": "..."}
NO_AUTHSDKNo credentials — connect with no config
note

The exact credential field names a given integration expects (and which schemes it allows) are defined by the integration itself. The keys below are the common defaults; open the integration in Discover → Integrations in Studio to confirm the required fields for yours.

OAuth (OAUTH2 / OAUTH1)

OAuth integrations (Google, Slack OAuth, Microsoft, etc.) require a browser authorization step — there is no secret to paste into config.

Option A — Studio UI:

  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 flow completes, fetch the connected tool by its ID with aix.Tool.get("<tool-id>").

Option B — from the SDK: connecting an OAuth integration returns a tool carrying a redirect_url. Visit it to authorize, then use the tool.

gmail_tool = aix.Tool(
name="Gmail Tool",
description="Reads and sends email.",
integration="composio/gmail",
)
gmail_tool.save()

print("Visit to authorize:", gmail_tool.redirect_url)
Show output

API key (API_KEY)

For API-key integrations, pass the key in config — no UI required:

import time

airtable_tool = aix.Tool(
name=f"Airtable Tool ({int(time.time())})",
description="Reads and writes Airtable bases.",
integration="composio/airtable",
config={"api_key": "YOUR_AIRTABLE_API_KEY"},
)
airtable_tool.save()

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

Bearer token (BEARER_TOKEN)

For bearer-token integrations, pass the token in config:

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

Basic auth (BASIC)

For username/password integrations, pass both in config:

import time

basic_tool = aix.Tool(
name=f"Service Tool ({int(time.time())})",
description="Connects to a service that uses basic auth.",
integration="composio/your-service",
config={"username": "YOUR_USERNAME", "password": "YOUR_PASSWORD"},
)
basic_tool.save()

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

No auth (NO_AUTH)

Some integrations need no credentials at all — connect without a config:

import time

public_tool = aix.Tool(
name=f"Public Tool ({int(time.time())})",
description="Connects to a service that requires no authentication.",
integration="composio/your-public-service",
)
public_tool.save()

print("Tool ID:", public_tool.id)
print("Status:", public_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.