Run AI agents without operating an agent server.
Quickstart · Dashboard · Brain
Aex hosts Brain, the open-source session server for AI agents. Bring your model key, connect tools, and send messages from your application. Aex keeps session history and adds account authorization, hosted services and usage billing.
Use native Pi, Codex or OpenCode. Tools can run in a connected application, an explicitly attached tab, your HTTPS service, or an account-authorized managed service.
Use Node.js 24, create an API key in the dashboard, and set AEX_API_KEY and OPENAI_API_KEY on your backend.
npm install @aexhq/sdk@1.1.0import { Pi, Aex, ApiKey, Model, Tool } from "@aexhq/sdk";
const aex = new Aex({ apiKey: process.env.AEX_API_KEY, maxCostMicroUsd: 1000000 });
try {
const session = await aex.sessions.create({
harness: Pi(),
model: Model("openai/gpt-4.1-mini", ApiKey(process.env.OPENAI_API_KEY)),
tools: [Tool({
name: "lookup_order",
description: "Look up an order by id",
input_schema: { type: "object", properties: { id: { type: "string" } }, required: ["id"], additionalProperties: false },
run: ({ id }) => ({ id, status: "shipped" }),
})],
});
console.log((await session.send("Look up order A-1001. Has it shipped?")).output);
console.log("Session:", session.id);
} finally {
await aex.close();
}The lookup runs in your application; the harness runs on Aex. Closing the client disconnects callbacks and keeps the session. Save its ID to continue later, explicitly rebind tools after reconnecting, or delete it to remove retained content after cleanup.
Quickstart · SDK · CLI · API
| Task | Guide |
|---|---|
| Run backend tools beyond a connected request | Application endpoints |
| Attach DOM callbacks with scoped access | Browser tools |
| Use a sandbox, remote browser or inspection tools | Managed tools |
| Send owned images and PDFs | Attachments |
| Validate a typed answer | Structured output example |
| Inspect prices, credits and usage | Billing |
Your model provider bills inference separately. The dashboard shows hosting prices and prepaid requirements. Missing usage is reported as unknown. Maintenance can interrupt work; uncertain actions are never automatically retried.
Development · Operations and recovery · Roadmap · Architecture decisions
Aex consumes an immutable public Brain Go module and SDK. Product policy stays here; private deployment configuration and commercial choices stay in Platform. Brain 2 is a clean contract break with no legacy execution importer.