Machine
Machines: an always-on computer for agents that should never sleep.
box = noclick.Machine.from_name("support-box", create_if_missing=True, size="medium", region="eu",
max_monthly_usd=120)
support = noclick.Agent.from_name("support", create_if_missing=True, instructions="...",
harness="claude_code", model_connection="claude", machine=box)
print(box.exec("df -h /").stdout)An agent on a machine runs its harness there instead of in a sandbox per conversation: nothing is reaped when it goes quiet, and there's no per-minute sandbox charge, only the machine's flat monthly price. Each conversation gets its own container on the machine, so threads never see each other's files. Model and tool calls go through NoClick's credential proxy with temporary keys: your real keys are never on the machine. NoClick manages its image and updates, restarts it if it fails (rebuilding it on a new host from its last backup if it must), and attached volumes outlive it.
A Linux server you run can be one too, free (Machine.add_own): run the
command its pairing shows on the server as root, and your agents run there
in containers:
home = noclick.Machine.add_own()
print(home.pairing.command)
# curl -fsSL https://api.noclick.com/machine-agent/v1/machine.sh | sudo sh -s -- --code nc_mach_...class MachineAn always-on computer of a fixed size in one region, billed a flat
monthly price. Agents created with machine= run their harness on it, each
conversation in a container of its own; exec, files and expose reach
the machine itself. status is provisioning, running, restarting,
updating, stopped or failed (status_reason says why), or
awaiting_approval: rented while NoClick reviews your company, nothing made
or charged yet, it starts once that's approved.
kind own is a server you added (Machine.add_own): free, the size
the server is, its shell and files as any machine's, its agents in
containers only (no exec, ports, restart, stop or start), and
offline while it's silent.
- Like every live object, it also has hydrate(), refresh() and raw.
| id | str | |
| name | str | |
| kind | str | None |
|
| size | str | None |
|
| host | str | None | The host it runs on, |
| cpu | int | None | vCPUs (hardware threads). |
| memory_gb | int | None | |
| disk_gb | int | None | Its disk. A larger size on Hetzner keeps the disk it had, so a move back down stays a resize. |
| os | str | None | The server's system, as it reports it ( |
| hostname | str | None | |
| last_seen_at | Any | When it last answered NoClick: on your own machine |
| max_conversations | int | None | Your own machine: the most of its agents' conversations you let work at once ( |
| conversations_at_once | int | None | How many of its agents' conversations work at once. |
| agent_share | float | None | Your own machine: the part of its CPUs and memory its agents use (0.75 by default); the rest stays yours. |
| agent_share_fixed | bool | None | True on a Mac once NoClick's VM is made: a VM keeps its size. |
| docker | bool | Your own machine: whether its agents' containers run Docker (any |
| app_testing | str | None | Your own machine: whether its agents run apps and test databases: |
| agents_enabled | bool | None | Whether agents run on machines on this API yet ( |
| region | str | None | The region it runs in ( |
| status | str | None | |
| status_reason | str | None | Why it's stopped or failed, or why it restarted. |
| monthly_usd | float | None | What it costs a month on its host, in US dollars, running or stopped (0 for your own). |
| max_monthly_usd | float | None | The most you agreed it may cost a month. |
| network | Any | What its own commands may reach: |
| volumes | dict[str, str] | None | The volumes it mounts, by path: |
| agent_count | int | None | How many agents run on it. |
| working_count | int | None | How many of its agents are working now, from its last check-in. |
| agent_states | list[dict[str, Any]] | Each agent on it, |
| spent_usd_this_month | float | None | What it was charged this month (UTC) so far, in US dollars. |
| started_at | Any | When it last booted, while it runs: its uptime. |
| pending | dict[str, Any] | None | While |
| image | str | None | The NoClick-managed image it runs, with its harness versions. |
| restarts | int | None | How many times it restarted after failing, ever. |
| last_restart_at | Any | |
| user_id | str | None | |
| created_at | Any | |
| files | MachineFiles | |
| health | MachineHealth | None | How hard it works, from its last check-in while it runs; |
| ports | list[MachinePort] | The ports it serves. |
| pairing | MachinePairing | None | Your own machine until its server is set up; |
| console_url | str | None | This machine in the developer console (None off the hosted API). |
sizesclassmethodasync
noclick.Machine.sizes(
*, region=None, include_dominated=False, client=None
) -> list[MachineSize]The sizes worth buying now, smallest first: size first, each at its cheapest anywhere, or as
bought in region (noclick.regions()). A size that can't be bought now is left out, as is
one where another that can be bought has at least its vCPUs and memory for no more (judged
across every region, or in region; a larger disk alone doesn't count).
include_dominated=True lists every size, each with available and dominated_by.
NoneFalseThe client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Each size's name (what size= takes), its processors and memory, about how many
conversations can work on it at once, and its cheapest offer now: the region, the
host it would go on and its disk_gb and monthly_usd there. regions lists every
region it can be bought in now, cheapest first, and hosts each host that runs it here.
Stock is read at most a minute before; create checks again.
size = noclick.Machine.sizes()[0]
print(size.name, size.region, size.host, size.monthly_usd) # small eu hetzner 8.39
box = noclick.Machine.create("support-box", size=size.name, region=size.region, host=size.host,
max_monthly_usd=size.monthly_usd)createclassmethodasync
noclick.Machine.create(
name, *, size='small', region=None, volumes=None, network=None, max_monthly_usd,
host=None, allow_existing=False, user=..., client=None
) -> MachineStart an always-on machine called name (unique to its user; a taken
name raises noclick.Conflict with existing_id, or with allow_existing=True
returns the machine already there, as it is: nothing about it changes). size is one of
Machine.sizes(); region (noclick.regions()) is where it runs, for
good, else your account's default region, else us-east. volumes
attaches Volumes (or their ids or names) at absolute paths: each
conversation sees a volume as it was when its turn started and saves its
writes when the turn ends. network is what the machine's own commands may
reach: True (the default: anywhere the machines usage policy allows, so no
mail ports, mining pools or private addresses) or a list of hosts (HTTPS to them,
"*.github.com" for subdomains, and name lookups). It's charged to your
account from the day it first runs, a thirtieth of its monthly price a day
while it exists, running or stopped, and refused (noclick.PriceExceeded,
nothing started) if its size costs more than max_monthly_usd on the host it goes on. It goes
on the cheapest host that runs the size in the region and has stock for it (Hetzner in
eu, DigitalOcean everywhere; Machine.sizes() lists each host's price and disk),
never one costing more than max_monthly_usd: when only a dearer host has stock, that
raises noclick.PriceExceeded naming the host and its price. host names one instead
(only it is tried). A machine stays on its host for its life. An account's
first machine needs its company vetted by NoClick: its owner asks in the
developer console (Resources, Machines), saying what its machines will run,
and until NoClick approves it this raises noclick.ActionRequired, whose
next_step links that page.
'small'NoneNoneNoneNoneFalseWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The machine, provisioning until it's ready (running).
A machine in Europe for a team of agents, with their shared files:
box = noclick.Machine.create(
"support-box", size="medium", region="eu", max_monthly_usd=120,
volumes={"/shared": noclick.Volume.from_name("support-kb", create_if_missing=True)},
)
print(box.status, box.monthly_usd)add_ownclassmethodasync
noclick.Machine.add_own(
*, name=None, max_conversations=None, agent_share=None, docker=None,
app_testing=None, client=None
) -> MachineAdd a Linux server you run (x86-64 or ARM64, with sudo) as a machine your
account's agents run on, in containers: free, its agents' model calls at
cost. Its containers can't reach its network, and on the server itself
NoClick only opens the account owner's shell and files, as its
noclick user. Run pairing.command on it as root within 30
minutes. Without name it takes the server's hostname;
max_conversations caps how many
of its agents' conversations work at once; agent_share is the part of
the server they use (0.1 to 1; 0.75 by default, 1 for a server just for
NoClick; on a Mac, NoClick's VM is made that size); app_testing is whether
its agents run apps and test databases ("ask_first" unless it says: each
agent asks its owner in the chat first; "by_itself"; "never"), each
conversation's container then running its own Docker inside its gVisor sandbox
(no host socket, nothing privileged on the server; a container whose agent's
network is limited runs without it); docker alone chooses "by_itself"
(true) or "never" (false). Called again before a
server pairs, it returns that same machine, with its code while the code is
good and a new one once it expired: add one per server, after the last one
paired. The account's own, never a user's (as_user doesn't apply).
NoneNoneNoneNoneNoneThe client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The machine, provisioning until the server answers, then running
(offline while it's silent: its agents' turns fail then), with its
pairing.
home = noclick.Machine.add_own()
print(home.pairing.command)
# On the server: curl -fsSL https://api.noclick.com/machine-agent/v1/machine.sh | sudo sh -s -- \
# --code nc_mach_...agents_enabled_hereclassmethodasync
noclick.Machine.agents_enabled_here(*, client=None) -> boolWhether agents run on machines on this API yet. Until they do, an agent
isn't put on a machine and your own server isn't added
(noclick.NotAvailable), and each machine reads agents_enabled False.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)True once agents run on machines here.
if noclick.Machine.agents_enabled_here():
home = noclick.Machine.add_own()from_nameclassmethod
noclick.Machine.from_name(
name, *, create_if_missing=False, size=None, region=None, volumes=None,
network=None, max_monthly_usd=None, host=None, user=..., client=None
) -> MachineA lazy reference to the machine called name in the current (or given)
user. Given fields, it gets the machine and sets the size, volumes, network and
max_monthly_usd you pass, on every run (a new size restarts it, judged against the
max_monthly_usd set with it). Fields you leave out are never changed. Its region and
host are fixed: an existing machine in another raises noclick.Conflict naming it.
create_if_missing=True starts it with the fields create takes when there's none
(max_monthly_usd is required then); without it, a missing machine raises
noclick.NotFound.
FalseNoneNoneNoneNoneNoneNoneWho the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A machine that loads (or is started, or has your fields set) the first time it's used. Nothing is sent yet.
box = noclick.Machine.from_name("support-box", create_if_missing=True, size="medium", max_monthly_usd=120)
print(box.status)from_idclassmethod
noclick.Machine.from_id(machine_id, *, client=None, user=...) -> MachineA lazy reference to a machine by id.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
A machine that loads the first time you read a field. Nothing is sent yet.
box = noclick.Machine.from_id("3b9e2c71-4f0d-4a68-9c15-7e2a8d1f6b40")
print(box.exec("uptime").stdout)getclassmethodasync
noclick.Machine.get(machine_id, *, user=..., client=None) -> MachineLoad a machine by id now; an unknown id raises noclick.NotFound.
Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The machine, loaded.
box = noclick.Machine.get("3b9e2c71-4f0d-4a68-9c15-7e2a8d1f6b40")
print(box.name, box.status, box.agent_count)listclassmethodasync
noclick.Machine.list(
*, kind=None, limit=None, user_filter=None, user=..., client=None
) -> list[Machine]The current user's machines (the account's own outside as_user, or those user_filter covers);
kind (noclick or own) narrows them.
NoneReturn at most this many.
None)Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)Every matching machine, newest first, fetched page by page.
for box in noclick.Machine.list(user_filter=noclick.ALL_USERS):
print(box.name, box.region, box.status, box.monthly_usd)
print([box.name for box in noclick.Machine.list(kind="own") if box.status == "offline"])list_pageclassmethodasync
noclick.Machine.list_page(
*, kind=None, cursor=None, limit=None, user_filter=None, user=..., client=None
) -> PageOne page of machines; pass next_cursor back as cursor.
NoneThe next_cursor of the page before; omit it for the first page.
None)Return at most this many.
None)Which users a read covers: noclick.ALL_USERS, noclick.NO_USER, a User, or your id for one. It filters without acting as that user.
None)Who the call acts for. Defaults to the user set by noclick.as_user (none: the account itself).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)A page whose data holds the machines and whose next_cursor is None on the last page.
page = noclick.Machine.list_page(limit=50)
print([box.name for box in page.data], page.next_cursor)execasync
machine.exec(command, *, background=False, timeout_s=None) -> ExecResult | OperationRun a shell command on the machine itself (not in a conversation's
container) and wait for it: timeout_s is 60 by default, at most 90.
background=True runs it as an operation, up to an hour.
FalseNoneWhat the command printed and how it exited, or with background=True an Operation
whose wait() gives that result.
box = noclick.Machine.from_name("support-box")
print(box.exec("df -h /").stdout)
backup = box.exec("tar czf /shared/backup.tgz /home/noclick", background=True, timeout_s=1800)
print(backup.wait().exit_code)exposeasync
machine.expose(port, *, public=False) -> MachinePortServe port at an HTTPS URL on NoClick's domain: a dashboard or a webhook
receiver your agents run. A private port asks for an API key with the
machines scope, which the app never sees; public=True answers anyone.
FalseThe port's url.
box = noclick.Machine.from_name("support-box")
dashboard = box.expose(8080)
print(dashboard.url)close_portasync
machine.close_port(port) -> NoneStop serving port; its URL stops answering.
noclick.Machine.from_name("support-box").close_port(8080)agentsasync
machine.agents() -> list[Any]The agents that run on it.
Each Agent, loaded.
box = noclick.Machine.from_name("support-box")
print([agent.name for agent in box.agents()])updateasync
machine.update(
*, name=..., size=..., volumes=..., network=..., max_monthly_usd=...,
max_conversations=..., agent_share=..., docker=..., app_testing=...
) -> MachineRename it, change its size, volumes, network or price ceiling. New volumes and
network apply without a restart (each conversation's from its next turn). A larger
size restarts it once running turns finish (updating); the new price applies
from the next day. A smaller size moves a running machine to a new host, since no
host shrinks a disk in place: its user's home is copied over and each conversation
loads its files from where they're saved, a longer restart (what's on its disk
must fit the smaller one; a move that fails leaves it on its old host).
Your own machine takes max_conversations (None: what its server takes)
agent_share (None: 0.75), app_testing and docker (as in add_own) instead of a
size or a price; its server takes them within seconds, each conversation's
container at its next start.
This machine, updated.
box = noclick.Machine.from_name("support-box")
box.update(size="large", max_monthly_usd=240)new_pairing_codeasync
machine.new_pairing_code() -> MachineYour own machine, until its server is set up: a new one-time code (and command) in place of the last one, which stops working.
This machine, with the new pairing.
home = noclick.Machine.get("7c1d9a20-2b6f-4e0a-9d51-3f8e6a4b2c10")
print(home.new_pairing_code().pairing.command)restartasync
machine.restart() -> OperationRestart it now, without waiting for running turns (they fail as interrupted).
Its disk and volumes are kept; a machine.restarted event follows.
box = noclick.Machine.from_name("support-box")
print(box.restart().wait().status) # runningstopasync
machine.stop() -> MachineStop it: its agents take no turns (a message raises noclick.NotAvailable)
until start(). It's still charged, since it stays yours.
This machine, stopped.
noclick.Machine.from_name("support-box").stop()startasync
machine.start() -> MachineStart a stopped machine. One stopped because the balance couldn't pay it
is charged what it owes first (noclick.PaymentRequired while it can't).
This machine, provisioning until it's running.
noclick.Machine.from_name("support-box").start()shellasync
machine.shell() -> MachineShellOpen a shell (bash -l) on this machine, as its user, in its home: for the account's owner, with
its secret key or signed in, while it's running. Your own machine's too (on a Mac, in NoClick's VM
there). noclick machines ssh <name> opens one in your own terminal.
The websocket's url and its single-use token (good for two minutes): hand them to a browser
terminal (xterm.js) from your server.
box = noclick.Machine.from_name("support-box")
opened = box.shell()
send_to_browser(opened.url, opened.token)deleteasync
machine.delete() -> NoneDelete it, with its disk; attached volumes stay. The agents on it go back to their own cloud sandboxes first, each from its next turn. The charge stops that day. Your own machine is removed from NoClick, which uninstalls itself from the server when it next answers.
box = noclick.Machine.from_name("support-box")
moving = box.agents() # what goes back to sandboxes
box.delete()MachineSizeinvite-only beta
class MachineSizeOne of Machine.sizes(): its processors and memory, and how it's bought now. region, host,
disk_gb and monthly_usd are its cheapest offer anywhere (or, asked about a region, there); regions
lists every region it can be bought in now, cheapest first, and hosts each host that runs it. Stock is read at
most a minute before; create checks again, so pass region, host and monthly_usd (as
max_monthly_usd) to buy exactly this.
| name | str | What |
| cpu | int | vCPUs (hardware threads), as hosts sell them. |
| memory_gb | int | |
| disk_gb | int | The machine's own disk on |
| monthly_usd | float | Its price per month in US dollars on |
| working_conversations | int | About how many coding-agent conversations can work on it at the same moment. |
| available | bool | Whether it can be bought now (only |
| region | str | None | Where it's cheapest now (the account's default region first at one price), or the region asked about; |
| host | str | None | The host a new one would go on there now; |
| dominated_by | str | None | A size that can be bought now with at least its vCPUs and memory for no more (only listed with |
| regions | list[MachineSizeRegion] | Each region it can be bought in now, cheapest first: the host, disk and price there. |
| hosts | list[MachineHost] | Each host that runs it, cheapest first: its regions, disk and price there. |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
MachineSizeRegioninvite-only beta
class MachineSizeRegionA region a size can be bought in now (MachineSize.regions, cheapest first): the host a new one would go
on there, and its disk and flat monthly price there.
| region | str | The region ( |
| host | str | The host a new one would go on there now, |
| disk_gb | int | Its disk on that host. |
| monthly_usd | float | Its price per month in US dollars on that host: what |
| dominated_by | str | None | A size that can be bought there now with at least its vCPUs and memory for no more, which makes this one no buy there (only listed with |
MachineHostinvite-only beta
class MachineHostA size on one host (MachineSize.hosts): where it runs, its disk there and its flat monthly price there.
| host | str | What |
| regions | list[str] | The regions it runs in on this host ( |
| disk_gb | int | |
| monthly_usd | float | Its price per month in US dollars on this host, whatever it runs and whether it's busy. |
MachinePortinvite-only beta
class MachinePortA port a machine serves. url reaches it over HTTPS; a private port asks
for an API key with the machines scope (Authorization: Bearer), a public
one answers anyone.
| port | int | |
| url | str | |
| public | bool | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
MachinePairinginvite-only beta
class MachinePairingYour own machine until its server is set up: the one-time code and the
command that carries it, which NoClick only shows as it makes them (a
machine read again has both None), when the code stops working, and the
server being set up with it once its installer started.
| code | str | None | |
| command | str | None | What to run on the server as root (a Linux server's, or a Linux distro's in WSL on Windows). |
| expires_at | Any | 30 minutes after the code was made; |
| installing_on | str | None | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
| refused | MachineRefusal | None | The last server turned away with the code, and why (None since the code was made, or once one pairs). |
| commands | dict[str, str] | None | The command for each system: |
MachineRefusalinvite-only beta
class MachineRefusalA server turned away with your own machine's code, newest first: by NoClick (its system, or the code expired) or by the installer itself. Cleared by a new code or a server that pairs.
| system | str | None | |
| arch | str | None | |
| hostname | str | None | |
| message | str | What the server's terminal printed, whole. |
| next_step | str | None | What to do, where NoClick knows it. |
| at | Any | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
MachineFilesinvite-only beta
class MachineFilesmachine.files: read and write files on the machine's own disk.
writeasync
machine.files.write(path, data) -> NoneWrite data (bytes, or text as UTF-8) to path (relative paths are under /home/).
box = noclick.Machine.from_name("support-box")
box.files.write("/etc/noclick/notes.md", "Restart the worker after deploys.")readasync
machine.files.read(path) -> bytesRead the file at path; a missing file raises noclick.NotFound.
The file's bytes, exactly as stored.
box = noclick.Machine.from_name("support-box")
print(box.files.read("/var/log/worker.log").decode()[-2000:])listasync
machine.files.list(path='/home/noclick') -> list[MachineFileEntry]The files and folders in the folder at path (relative paths are under /home/, the
machine user's home), by name.
'/home/noclick'Each entry's path, type (file or directory), size and updated_at.
box = noclick.Machine.from_name("support-box")
for entry in box.files.list("logs"):
print(entry.type, entry.path, entry.size)MachineFileEntryinvite-only beta
class MachineFileEntryA file or folder on a machine's disk (machine.files.list).
| path | str | |
| type | str |
|
| size | int | None | A file's bytes ( |
| updated_at | Any |
MachineHealthinvite-only beta
class MachineHealthHow hard a running machine works, from its last check-in (machine.last_seen_at).
| cpus | int | None | Its vCPUs (your own: the server's). |
| load_1m | float | Its one-minute load average, and that as a part of its vCPUs kept busy (at most 100). |
| cpu_percent | int | None | |
| memory_used_gb | float | Memory in use and in all (your own: the whole server's; its agents use |
| memory_total_gb | float | |
| disk_used_gb | float | |
| disk_total_gb | float |
MachineShellinvite-only beta
class MachineShellA shell on a machine NoClick runs (machine.shell()): url is a websocket, opened once with token
within two minutes. Its first message is {"type": "auth", "token": ..., "cols": ..., "rows": ...}; then binary
messages carry what you type and what it prints, a text {"type": "resize", "cols", "rows"} sizes it, and it
sends {"type": "ready"} once and {"type": "state", "state": "exited", "reason"} as it closes (code 4410):
bash exited, idle_limit_s passed with nothing typed, or the socket closed.
| machine_id | str | |
| url | str | |
| token | str | |
| token_expires_at | Any | |
| idle_limit_s | int |