Skip to main content

aiXplain SDK adds AI functions to software.

Project description

aixplain

aixplain SDK

License Marketplace size Discord

Build, deploy, and run autonomous AI agents — governed by default, in a few lines of Python.

aixplain is the operating system for autonomous AI: multi-agent orchestration with runtime governance on every action, across cloud, on-prem, edge, and local. The full lifecycle — build → evaluate → deploy → monitor → evolve — on one runtime, instead of stitching tools together.

On your termsyour data in your perimeter, your cost free on local models and tools, pay as you go in the cloud, your independence across any model or infrastructure, no lock-in.

Build any agent — knowledge (RAG), data, custom-logic, integration, and team — via SDK, API, CLI, or MCP, on a marketplace of 900+ models, tools, and integrations.

Why aixplain

Less to build, less to operate:

  • Deploy with one callagent.save() promotes an agent to a persistent, versioned endpoint; no Dockerfiles, queues, or autoscaling to manage.
  • No integration glue — reach 900+ models, tools, and integrations through one key; skip per-provider SDKs, auth, and rate-limit handling.
  • Guardrails you don't have to build — allow-lists, per-asset permissions, rate and usage limits, and access control enforced at runtime.
  • Self-debugging — step-level traces of every plan, tool call, and outcome.
  • Run it anywhere — the same definition runs in the cloud, on-prem, at the edge, or locally.
  • Works with your coding agent — native MCP support for MCP-compatible IDEs and coding agents.

How it works

The portable runtime behind aixplain agents: orchestration, governed asset serving, and observability across cloud, on-prem, edge, and local. See the documentation for the full architecture.

aixplain Agentic OS architecture — governed execution loop (Planner, Orchestrator, Inspector, Bodyguard) over the infrastructure services, deployable on cloud, on-prem, edge, and local


Quick start

This README documents SDK v2, the default API. SDK v1 (the legacy factory API) keeps working until August 1, 2026, after which v2 is the only supported surface.

pip install aixplain

Get your API key from your aixplain account, then expose it to the SDK:

export AIXPLAIN_API_KEY=<your-key>

Create and run your first agent

from aixplain import Aixplain

aix = Aixplain()  # reads AIXPLAIN_API_KEY from the environment

search_tool = aix.Tool.get("tavily/tavily-web-search/tavily")
search_tool.allowed_actions = ["search"]

agent = aix.Agent(
    name="Research agent",
    description="Answers questions with concise web-grounded findings.",
    instructions="Use the search tool when needed and cite key findings.",
    tools=[search_tool],
)
agent.save()

result = agent.run(
    query="Who is the CEO of OpenAI? Answer in one sentence.",
)
print(result.data.output)

Runs return typed objects — read outputs with result.data.output, not dict indexing.

Build a multi-agent team

from aixplain import Aixplain
from aixplain.v2 import EditorConfig, EvaluatorConfig, EvaluatorType, Inspector, InspectorAction, InspectorActionConfig, InspectorSeverity, InspectorTarget

aix = Aixplain()  # reads AIXPLAIN_API_KEY from the environment
search_tool = aix.Tool.get("tavily/tavily-web-search/tavily")
search_tool.allowed_actions = ["search"]

def never_edit(text: str) -> bool:
    return False

def passthrough(text: str) -> str:
    return text

noop_inspector = Inspector(
    name="noop-output-inspector",
    severity=InspectorSeverity.LOW,
    targets=[InspectorTarget.OUTPUT],
    action=InspectorActionConfig(type=InspectorAction.EDIT),
    evaluator=EvaluatorConfig(
        type=EvaluatorType.FUNCTION,
        function=never_edit,
    ),
    editor=EditorConfig(
        type=EvaluatorType.FUNCTION,
        function=passthrough,
    ),
)

researcher = aix.Agent(
    name="Researcher",
    instructions="Find and summarize reliable sources.",
    tools=[search_tool],
)

team_agent = aix.Agent(
    name="Research team",
    instructions="Research the topic and return exactly 5 concise bullet points.",
    subagents=[researcher],
    inspectors=[noop_inspector],
)
team_agent.save(save_subcomponents=True)

response = team_agent.run(
    query="Compare OpenAI and Anthropic in exactly 5 concise bullet points.",
)
print(response.data.output)

Execution order:

Human prompt: "Compare OpenAI and Anthropic in exactly 5 concise bullet points."

Team agent
├── Planner: breaks the goal into research and synthesis steps
├── Orchestrator: routes work to the right subagent
├── Researcher subagent
│   └── Tavily search tool: finds and summarizes reliable sources
├── Inspector: validates the output against a runtime policy
└── Orchestrator: composes and returns the final answer

SDK v1 (legacy): available until August 1, 2026 — see the SDK v1 docs.


Marketplace

The aixplain Marketplace is a catalog of 900+ models, tools, and integrations. Every asset is reachable through the same three outlets — SDK, API, and MCP — with a single API key 🔑.

For MCP-compatible clients and IDEs, assets (for example Opus 4.6, Kimi, Qwen, Airtable, Slack) are served through aixplain-hosted MCP endpoints. See the MCP servers docs.

{
  "ms1": {
    "url": "https://models-mcp.aixplain.com/mcp/<AIXPLAIN_ASSET_ID>",
    "headers": {
      "Authorization": "Bearer <AIXPLAIN_APIKEY>",
      "Accept": "application/json, text/event-stream"
    }
  }
}

Data handling and deployment

  • Your data stays yours — never used to train foundation models; agent memory is opt-in. SOC 2 Type II; TLS 1.2+ in transit, encrypted at rest.
  • Governed at runtime — Inspector and Bodyguard enforce allow-lists, per-asset permissions, rate and usage limits, and access control on every execution.
  • Deploy anywhere — cloud, on-prem, edge, or local; air-gapped and VPC available on-prem or local.

Learn more at aixplain Security and aixplain pricing.


Pricing

Start free, then scale with usage-based pricing.

  • Pay as you go — prepaid usage with no surprise overage bills.
  • Subscription plans — reduce effective consumption-based rates.
  • Custom enterprise pricing — available for advanced scale and deployment needs.

Learn more at aixplain pricing.


Community & support


License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aixplain-0.2.45rc1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aixplain-0.2.45rc1-py3-none-any.whl (836.8 kB view details)

Uploaded Python 3

File details

Details for the file aixplain-0.2.45rc1.tar.gz.

File metadata

  • Download URL: aixplain-0.2.45rc1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for aixplain-0.2.45rc1.tar.gz
Algorithm Hash digest
SHA256 3f519de90f5f1355f4ff595943d55ed823bf652f1f9da37393f202168aa8485d
MD5 adabc8be463534b588fb5e96ab7aa4e5
BLAKE2b-256 74c4700c4384dbfa6211958778c2730cc75ec55bb35a58357b96f3d4b25f856f

See more details on using hashes here.

File details

Details for the file aixplain-0.2.45rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for aixplain-0.2.45rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7906513a433c0b9cba7b6fd9f2f7b99e567dac2f1bb7f3c83bf32c41b256b61
MD5 722d4e23016ca0c0a0ed57309b28c10c
BLAKE2b-256 fa81eaf56fee9b135eb32c9fcd083e793c9b29a22c4223ad680c76567f40803f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page