Skip to content
aixplainPublic

About

aiXplain enables python programmers to add AI functions to their software.

Topics

Resources

Stars

59 stars

Watchers

3 watching

Forks

Latest commit

 

History

909 Commits

Folders and files

Repository files navigation

aixplain

aixplain Agents SDK

License Discord

The fastest way to turn an AI agent into an API.
Describe it in Python, call .save(), and it is live. You pay only when someone uses it.

Quickstart · Docs · API reference · Koder

Quickstart

pip install aixplain

Get an API key at app.aixplain.com, then deploy an agent:

from aixplain import Aixplain

aix = Aixplain(api_key="YOUR_API_KEY")

agent = aix.Agent(
    name="Research agent",
    tools=[aix.Tool.get("tavily/tavily-web-search/tavily")],
).save()

result = agent.run("What are the top AI papers this week?")
print(result.data.output)

The agent is now an API. Call it from any language with agent.id:

curl -X POST "https://platform-api.aixplain.com/v2/agents/YOUR_AGENT_ID/run" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "What are the top AI papers this week?"}'

The response holds a URL to poll for the answer. See the REST API guide.

What you get

  • Any model. 1,000+ models, tools and integrations, one API key.
  • Any tool. Web search, Slack, Gmail, MCP servers or your own Python.
  • In control. Budgets cap cost, time and steps. Inspectors check every step.
  • See everything. Every run's steps, cost and status, in code and in the dashboard.

Deploy

.save() is the deployment. There is no server, container or queue to manage, and the agent keeps its endpoint as you update it.

  • Cloud is the default: aixplain hosts and scales the agent for you.
  • On-prem runs the same agent on your own infrastructure, including air-gapped.
  • Local runs it on your own machine.

See deployment.

Control

Set limits on the agent and every run respects them:

agent.budget.max_cost = 0.10            # credits per run
agent.budget.max_duration_seconds = 60
agent.budget.max_iterations = 10
agent.save()

result = agent.run("Summarize this week's AI news in three bullets.")
print(result.status, result.used_credits, len(result.data.steps))
  • Budgets cap cost, time and steps per run.
  • Inspectors check inputs, intermediate steps and final answers, with your own rules or an LLM judge. See inspectors.
  • Every run returns its steps, cost and status, and shows up in the dashboard.

Let Koder build it

Koder builds and deploys aixplain agents for you. Describe the agent; Koder writes, tests and deploys it with the agent builder skill, and you review every change.

Using Claude Code? Install the aixplain plugin from this repo:

/plugin marketplace add aixplain/aiXplain
/plugin install aixplain@aixplain

It bundles the agent builder skill and marketplace search. See the plugin guide, or use the agent builder skill on its own.

Learn more

Community and support

License

Apache License 2.0. See LICENSE.

About

aiXplain enables python programmers to add AI functions to their software.

Topics

Resources

Stars

59 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages