api.agents.create() without runtime builds this one. You give it model sessions, storages and tool declarations; it streams steps back while the platform performs them.
const writer = await api.models.create({ model: "gemini-3.5-flash" });
const agent = api.agents.create({
model: { main: writer },
storages: [database],
tools: { search: api.tools.search, query_storage: api.tools.queryStorage },
maxSteps: 8,
budget: 200,
});
const result = await agent.run({
inputs: [{ type: "text", content: "Which customers churned last month?" }],
onStep: (step) => console.log(step.tool, step.summary),
});writer = api.models.create(model="gemini-3.5-flash")
agent = api.agents.create(
model={"main": writer},
storages=[database],
tools={"search": api.tools.search, "query_storage": api.tools.query_storage},
max_steps=8,
budget=200,
)
result = agent.run(
inputs=[{"type": "text", "content": "Which customers churned last month?"}],
on_step=lambda step: print(step.get("tool"), step.get("summary")),
)modelobjectrequiredA model session, or a named set: { main, image, video, voice, music }.
storagesarray[]ConnectedStorage objects this run may read.
toolsobject{}api.tools declarations, keyed by the name the model sees.
outputsarraynullWhat the run should produce.
maxStepsinteger8Steps.
budgetinteger|nullnullCredits.
Against the local engine
| Local | Server-side | |
|---|---|---|
| The loop runs | in your process | on the platform |
| Tools | 35, on your machine | api.tools declarations |
| Permission | your callback, per call | none — the tool set is the boundary |
| Sessions, checkpoints, skills | yes | no |
| Steps by default | 100 | 8 |
| Needs your process alive | yes | no |
This one has no permission callback, so the only boundary is which tools you declared and which storages you passed. That is a reasonable design for an unattended step; it is a poor one for an interactive agent.
It can still reach your machine
The four document-writing declarations and the document readers are performed through the package, on the machine that holds the key: the run asks, your process does the work, the answer goes back. So it works only while your process is listening.
It keeps its own history
Each run() appends the exchange to agent.history, and the next one sends it. Pass history explicitly to override, or [] to start fresh.