Introduction
The Ailoy SDK is a library for building AI agents in Python, Node.js and Rust. It gives you one API for every model provider, a tool system that covers your own functions, MCP servers and a web browser, and a Linux sandbox where the agent can run code. You write the agent in a few lines; Ailoy runs the loop of calling the model, running the tools it asks for and sending back the results.
Why use the Ailoy SDK?
- One API for every model. Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, EXAONE, or a model on your own server. Change the model by changing one string, such as
"anthropic/claude-haiku-5-5"to"openai/gpt-6-luna". - No API key needed to start. Claude, GPT and Gemini run through the CLI you’re already logged in to (Claude Code, Codex or Gemini CLI).
- A computer for the agent. Pass a virtx sandbox, and the agent gets a shell and file tools inside a microVM, isolated from your machine.
- The same SDK in three languages. The classes, methods and behavior match across Python, Node.js and Rust.
Building blocks
| Block | What it does | Reference |
|---|---|---|
AgentBuilder |
Configures an agent: model, instruction, tools, sandbox, skills, memory and options. | AgentBuilder |
Agent |
Runs turns and keeps the conversation history. | Agent |
| Model providers | Choose how each org’s models run: CLI, API, Bedrock, OpenRouter or your own server. LangModel calls a model directly. |
Models |
| Tools | Registers your functions and MCP servers as tools. | Tools |
| Built-in tools | The shell, file, web, memory and browser tools Ailoy includes. | Built-in tools |
| Types | The data shapes: messages, outputs, tool descriptions, specs. | Types |
Install
pip install ailoy-pyRequires Python 3.11 or later.
npm install @brekkylab/ailoyRequires Node.js 22 or later.
cargo add ailoy virtx futures anyhow tokio --features tokio/macros,tokio/rt-multi-threadRequires Rust 1.95 or later.
Then set up a model, as Installation shows, and build your first agent with the Quick start. Language setup covers what differs between Python, Node.js and Rust in a project of your own.
How this reference is organized
Each page covers one class or area. Each entry has the signature in all three languages, a table of parameters with their types and defaults, what it returns, and the errors it can raise.
Names follow each language’s conventions:
| Python | Node.js | Rust | |
|---|---|---|---|
| Methods and functions | snake_case (run_stream) |
camelCase (runStream) |
snake_case (run_stream) |
| Options | Keyword arguments (max_images=20) |
An options object ({ maxImages: 20 }) |
Struct fields or builder methods |
| Messages, specs, tool descriptions | dict |
Plain object | Typed structs |
| Async | await, async for |
await, for await |
.await, Stream |
Messages, specs and tool descriptions are JSON data, so their keys are snake_case in every language, including Node.js (finish_reason, mime_type, base_url). Where Rust works differently, such as building messages with methods instead of dicts, the Rust tab shows how.
Sandboxes come from the virtx package (virtx, @brekkylab/virtx or the virtx crate), documented in virtx’s reference.
Versions
This reference covers Ailoy 0.3. Version 0.3 isn’t compatible with 0.2 or earlier, and there’s no migration path. The Changelog lists the changes in each release, breaking changes first.
Use these docs with AI coding assistants
- SKILL.md: step-by-step instructions for building with Ailoy.
- llms.txt: a short summary of Ailoy.
- llms-full.txt: every page of these docs in one file.