api.agents

Overview

Create an agent, reopen one, list the account's sessions, and reach the two libraries. Three methods and two accessors.

3 methods2 librariescreate() makes no request
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

MemberDoesCosts
create(options)Builds an agent. No request.nothing
get(id, options)Reopens a session.nothing until it runs
list({ limit })The account's sessions, newest first.nothing
skillsThe skill library — account and this computer.nothing
subagentsThe subagent library.nothing
const pc = await api.storage.get();

const agent = api.agents.create({
  runtime: "local",
  machine: pc,
  model: "gemini-3.5-flash",
  mode: "ask",
  memory: true,
  onPermission: async ({ category }) => (category === "exec" ? "deny" : "once"),
});

const result = await agent.run({ message: "Summarise what changed this week." });
pc = api.storage.get()

agent = api.agents.create(
    runtime="local",
    machine=pc,
    model="gemini-3.5-flash",
    mode="ask",
    memory=True,
    on_permission=lambda request: "deny" if request["category"] == "exec" else "once",
)

result = agent.run(message="Summarise what changed this week.")

Two engines behind one method

create()BuildsThe loop runs
runtime: "local"LocalAgentIn your process
no runtimeAgentOn the platform
Reach for the local engine whenever you have a process

It has the larger tool set, the permission callback, checkpoints, sessions, skills and subagents. The server-side one exists for the case where nothing of yours is running — which is what a workflow step is.

Creating costs nothing

create() validates its options and builds an object. No request is made, no session is written, no credit is spent — the first run() is what starts anything.

The validation is strict and immediate, so a mistyped option fails where you wrote it rather than mid-task.

The options, by subject