cpuosBeta

cpuOS · agent infrastructure

cpuOS quickstart: connect a worker and run a job

Connect your Docker worker, submit a bounded Python or Node job, inspect the result and use the REST jobs API.

Create a workspace and connect a worker

Create an account, or sign in with your gpuOS account: the two products share one account and its workspaces. Then open the dashboard. Create a workspace and add a node from its Nodes page. Copy the connection command shown there. Node tokens authorize one worker and are separate from workspace API keys.

Use a machine allocated to the pilot with Node 24, Docker and permission to use its Docker daemon. Linux also requires flock from util-linux. The worker pulls the Python 3.13 and Node 24 slim images, reports its heartbeat, polls for work over HTTPS and executes one job at a time. Docker images need host network access for the first pull.

Manual worker connection in Bash, paste the token at the prompt
curl --fail --output cpuos-agent.mjs https://cpuos.si/cpuos-agent.mjsread -r -s -p "cpuOS node token: " CPUOS_NODE_TOKENprintf "\n"CPUOS_URL=https://cpuos.si CPUOS_NODE_TOKEN="$CPUOS_NODE_TOKEN" node cpuos-agent.mjsunset CPUOS_NODE_TOKEN

The worker controls Docker on this machine. Treat the node token as a secret, keep it out of submitted code and allocate the worker to trusted team tasks. Wait for the dashboard to show the node online and ready before submitting.

Keep a Linux worker running

The managed installer creates a systemd service that starts on boot and restarts after a process failure. It requires Linux, a running systemd manager, Node 24 installed system-wide, flock (util-linux), and rootful Docker with a docker-group-owned socket. Download and inspect the installer before running it with sudo.

Install the service, paste the token at the masked prompt
curl -fsSLo install-cpuos.sh https://cpuos.si/install-cpuos.sh# Inspect install-cpuos.sh before continuing.read -r -s -p "cpuOS node token: " CPUOS_NODE_TOKENprintf "\n"export CPUOS_NODE_TOKENsudo --preserve-env=CPUOS_NODE_TOKEN bash ./install-cpuos.sh --url https://cpuos.siunset CPUOS_NODE_TOKEN

The service uses a dedicated non-login cpuos-worker account with Docker access. Docker access grants root-level control of the machine. Credentials are stored in a root-owned 0600 file at /etc/cpuos/worker.env. The installer verifies the worker download against its release checksum and does not print the token.

Inspect status and logs, or update while preserving credentials
sudo systemctl status cpuos-workersudo journalctl -u cpuos-worker -n 50 --no-pager# Download and inspect the current installer before updating:sudo bash ./install-cpuos.sh --update

Updates restart the worker and can interrupt an active job. Inspect job state afterward. A revoked token stops the service without a restart loop. To reconnect, create a new node and use the installer with --reconnect and its new token. Keep one worker process per node token across all machines. Local duplicate processes are rejected; a restarted worker removes only interrupted containers carrying its own node identity. A lost execution is rerun only for a job submitted with maxAttempts above 1.

Run a small job from the dashboard

Open Jobs, choose Python and submit print(sum([12, 18, 25])). Start with 1 CPU, 256 MiB and a 30-second deadline. Follow the job through queued and running to a terminal result. A completed job should report exit code 0 and stdout 55.

Python and Node use their standard libraries. Job networking is disabled. There is no package-installation contract, file-transfer API, browser, exposed port or persistent interpreter. See the runtime catalog for current jobs and clearly labelled planning references.

stdout and stderr are returned when the worker finishes, not streamed live. Inspect the exit code, duration, error and truncation flag before returning output to a user or model.

Submit from your application

Create an API key in the workspace Keys page. Store it on your application server and use it as a bearer credential. There is no cpuOS SDK package to install; use curl, fetch or your language's HTTP client.

Generate once per intended job, keep the value for response retries
CPUOS_JOB_REQUEST=$(node -e 'console.log(require("node:crypto").randomUUID())')
POST a Python job
curl --fail-with-body https://cpuos.si/v1/jobs \  -H "Authorization: Bearer $CPUOS_API_KEY" \  -H "Idempotency-Key: $CPUOS_JOB_REQUEST" \  -H "Content-Type: application/json" \  -d '{"template":"python","code":"print(sum([12,18,25]))","vcpu":1,"memoryMb":256,"timeoutSeconds":30}'

Scroll horizontally to see every column.

Method and routeResponse
POST /v1/jobs202, the accepted or existing job with its id and current status.
GET /v1/jobs{data: [...]} for the authenticated workspace.
GET /v1/jobs/:idThe current job, including terminal stdout/stderr, exitCode and durationMs when available, and a contentPurged flag.
DELETE /v1/jobs/:idCancellation of queued work or a cancellation request for running work. The worker stops a running container when it observes the request.

The request accepts name (optional), template (python or node), code, vcpu (1 or 2), memoryMb (128–2048), timeoutSeconds (1–120), maxAttempts (1–5, default 1) and callbackUrl (optional, see completion callbacks). Poll the returned id with the same key until status is completed, failed or cancelled, or let the callback tell you. Errors use {error: {message, code}}.

maxAttempts above 1 turns on automatic retries. When an attempt fails (non-zero exit, timeout, engine error or a worker that stopped renewing its lease) and attempts are left, cpuOS queues a new job with the same request, attempt one higher and retryOfJobId set to the failed job. It waits 10 seconds after a first failure, doubled each time up to 5 minutes, less up to 20 % at random (runAfter), and no worker claims it before then. A cancelled job is never retried, a job that waited ten minutes in the queue is not either, and no retry is queued while the workspace already has 50 queued jobs. Each job reports attempt, maxAttempts, retryOfJobId, nextAttemptJobId (its automatic retry, once queued) and runAfter.

With maxAttempts above 1, the same code can run several times, including after a lost worker whose execution may have gone on, or finished, without reporting. Only use it for code that is safe to run again: idempotent writes, or effects your application can deduplicate.

Code, stdout and stderr are deleted when the job's deadline passes: the time it ended plus the workspace's retention period (7 days by default). A deleted job still returns its status, exit code and duration, with empty code, stdout and stderr and contentPurged: true. With retention set to none, read the result once and keep what you need: reading a finished job schedules its deletion at the next sweep, which runs every 5 minutes, and content that is never read is deleted one hour after the job ends.

Set CPUOS_JOB_REQUEST to a fresh UUID for each intended job. Reuse that value and the same request body after a timeout or interrupted response. The optional Idempotency-Key header accepts 1–128 visible ASCII characters. Within the workspace, repeated submissions return the original job in its current state, including after completion or worker disconnection. Reusing a key for a different job returns 409. A new intended execution needs a new key.

Handle failure and cancellation

  • Check a deliberate syntax error and confirm failed status, stderr and nonzero exit code.
  • Set a short deadline for a sleep and confirm timeout is reported.
  • Cancel a queued job, then request cancellation of a running job and verify the worker stops it.
  • Disconnect the worker and confirm that offline state and lost attempts are visible.
  • Use Retry only after inspecting the prior attempt. A retry is a new job and code may run again.

Store the job id before polling. If a submission response is interrupted, resend the identical request with its original Idempotency-Key. Without a key, inspect existing jobs before resubmitting. Idempotency prevents duplicate admission; it does not repeat a failed or lost execution. Only maxAttempts does that, as new jobs. Run again creates a new attempt after you inspect the prior result.

Receive a signed completion callback

Set callbackUrl when you submit a job, and cpuOS POSTs a job.finished event to it once the job has ended for good: completed, cancelled, or failed with no automatic retry left. A failed attempt that is retried sends nothing; the retry carries the URL. The URL must use https, at most 2048 characters, without credentials, on a public address: loopback, private, link-local, shared (CGNAT), multicast and unspecified addresses are refused when you submit, and again when cpuOS resolves the host to send. Redirects are not followed.

The event body
{  "type": "job.finished",  "id": "Ab3dEf6hIj9kLm2nOp5q:1",  "createdAt": "2026-10-27T10:00:02.000Z",  "data": {    "id": "Ab3dEf6hIj9kLm2nOp5q",    "name": "Sales summary",    "status": "completed",    "attempt": 1,    "maxAttempts": 1,    "retryOfJobId": null,    "exitCode": 0,    "durationMs": 1532,    "error": null,    "outputTruncated": false,    "startedAt": "2026-10-27T10:00:00.400Z",    "finishedAt": "2026-10-27T10:00:02.000Z"  }}

The body never holds code, stdout or stderr: fetch GET /v1/jobs/:id with your API key for those, within the workspace's retention. Each request carries content-type: application/json, user-agent: cpuOS-Webhooks/1, cpuos-event-id (the event id, the same on every try, to drop duplicates) and cpuos-signature: t=<unix seconds>,v1=<hex>. Answer with any 2xx within 10 seconds. Anything else is tried again after 30 s, 2 min, 10 min, 30 min, 1 h, 3 h and 6 h, eight tries in all; the job shows callbackStatus (pending, delivered or failed) and the last error.

v1 is the HMAC-SHA256, in hex, of the timestamp, a dot and the raw request body, keyed with the workspace's signing secret (the whole whsec_… string). An admin or owner reveals and rotates it in workspace Settings, under Job callbacks; rotating replaces it at once, and signatures made with the old secret stop verifying. Verify every callback before trusting it: compute the HMAC over the bytes you received, before any JSON parsing, compare in constant time, and reject a timestamp more than 5 minutes away from your clock.

Verify a callback in Node.js
import { createHmac, timingSafeEqual } from "node:crypto"// rawBody: the request body exactly as received (string or Buffer).export function verifyCpuosSignature(rawBody, header, secret) {  const parts = Object.fromEntries(    String(header ?? "").split(",").map((part) => part.split("=", 2))  )  const timestamp = Number(parts.t)  if (!Number.isInteger(timestamp) || !parts.v1) return false  if (Math.abs(Date.now() / 1000 - timestamp) > 300) return false  const expected = createHmac("sha256", secret)    .update(`${timestamp}.${rawBody}`)    .digest()  const received = Buffer.from(parts.v1, "hex")  return (    received.length === expected.length &&    timingSafeEqual(received, expected)  )}// Express: app.post("/hooks/cpuos", express.raw({ type: "application/json" }), (req, res) => {//   if (!verifyCpuosSignature(req.body, req.get("cpuos-signature"), process.env.CPUOS_WEBHOOK_SECRET))//     return res.sendStatus(400)//   const event = JSON.parse(req.body)//   res.sendStatus(204)// })
Verify a callback in Python
import hashlibimport hmacimport timedef verify_cpuos_signature(raw_body: bytes, header: str, secret: str) -> bool:    parts = dict(item.split("=", 1) for item in (header or "").split(",") if "=" in item)    try:        timestamp = int(parts["t"])    except (KeyError, ValueError):        return False    if abs(time.time() - timestamp) > 300:        return False    signed = f"{timestamp}.".encode() + raw_body    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()    return hmac.compare_digest(expected, parts.get("v1", ""))

Understand where code and output go

Jobs run on your worker. The hosted EU control plane receives and stores code, status and output in your workspace. The worker's location is your choice. This workflow is not air-gapped and does not guarantee that every component is in the EU.

Code and output are kept until the job's deadline: 7 days after the job ends by default, or 24 hours or 30 days if a workspace admin chooses so in the settings. With none, the deadline is one hour after the job ends, and reading the result schedules its deletion at the next sweep. Shortening the period brings forward the deadline of content already stored; lengthening it applies only to jobs that end afterwards. Status, exit code, duration and usage are kept either way. Daily database backups can keep deleted content for up to 30 days; they are not used to give it back.

Containers use a non-root user, a read-only root filesystem, dropped capabilities, a process limit, CPU/memory limits, temporary scratch space and no job network. They still share the host kernel. The pilot is for trusted team tasks on purpose-allocated hardware, not hostile multi-tenant execution.

There is no paid checkout, usage charging, SSO or availability SLA in this pilot. The cost calculator estimates what your own workers cost for a workload, at the prices you enter. The free plan caps a workspace at 5 running jobs, enforced when a worker claims a job, so further jobs wait queued. No paid cpuOS plan is sold.

Prepare your agent workspace

Create an account to organize sandbox records, execution profiles and API credentials.

gpuOS · where models think

Need the model too? Run it on gpuOS

gpuOS serves open models on your own GPUs behind one OpenAI-compatible API. Your application can submit authorized actions to cpuOS jobs.