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
pip install aixplainGet 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.
- 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.
.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.
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.
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.
- Documentation
- Example agents
- Marketplace
- Pricing and security
- Run metadata: each agent run sends a
metaDataobject, including approximate location from oneipinfo.iolookup - Migration guide: upgrading older code to 0.3.0, where this API is the only one
- Ask questions on Discord
- Report bugs and request features in GitHub issues
- Talk with the team at care@aixplain.com
Apache License 2.0. See LICENSE.