Help and API
Install an agent, start a task and read the result. This page is public; the console behind it needs the admin token.
Overview
NL runs an instruction on a real Windows desktop. A small tray agent takes screenshots, moves the mouse and types. It dials out to this server, so the machine needs no inbound port, VPN or public IP.
Each company is a client (tenant). Agents, jobs, runs, secrets and API keys belong to one client. The admin console can switch between clients; API keys are limited to their own client.
Install the agent
- In the console, open Clients, add the client and copy its install command.
- On the Windows machine, signed in as the user the agent should drive, run it in a normal PowerShell window (not elevated):
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Set-ExecutionPolicy Bypass -Scope Process -Force irm "https://nl.example.com/install/agent/windows.ps1?code=XXXX-XXXX-XXXX" | iex - The installer downloads
nl-agent.exe, checks its SHA-256, writesagent.json, adds a Start up shortcut and starts the tray agent. Re-run it to upgrade;agent.jsonis kept. - Agents shows the machine as online within about a minute.
Unattended machine
For an agent that must work without a person: enable Windows auto-login, disable sleep and screen lock, and keep the session unlocked. A locked or sleeping desktop cannot be driven. The console's Clients page reproduces the exact commands.
Browser IP (optional)
By default the machine's browser uses the machine's own internet connection. If browser traffic must leave through the client's own network (their IP), install the relay module on the client's PC and point Chrome at it:
- Console → Integrations → create a client API key (
nlk_…). - On the client's PC run
nl-egress -cloud https://nl.example.com -token nlk_…. - On the agent machine run
nl-egress -mode agent -token <agent token>; set Chrome policy tosocks5://127.0.0.1:1080. - Console → Agents shows the chain Internet → NL-Egress → NL-Agent as green.
No relay: desktop and office tasks work, browser tasks that require a specific public IP do not.
Router (Teltonika / OpenWrt)
On a Teltonika RUTX11 (ARMv7) or another OpenWrt router, the router itself can be the egress — its WAN/SIM IP becomes the exit address, with no PC left on:
wget -qO- https://nl.example.com/install/egress/router.sh | sh -s -- <client key>
The installer detects the architecture, verifies the SHA-256, installs a procd service and starts it. It needs about 12 MB free on /overlay (RUTX11 has plenty). Check /etc/init.d/nl-egress status and logread | tail -20. A mobile SIM may be behind CGNAT: the reported public IP can change after a reconnect, so do not rely on it for IP allowlists. Each router is its own module; a client can run several and give each agent a chain.
Multiple modules and chains
A client can run several modules — PCs and routers. Each has a token (egm_…) and is dedicated to one agent or shared with a capacity. In the console, open Egress, add a module, and run its install command on that machine. Use Edit to switch a module between shared and dedicated later; a dedicated module is bound to one agent, a shared one has a capacity. Changing the mode reconnects the module so the new setting applies.
Each agent has an ordered chain: primary first, then backups. Leave it empty for auto (its dedicated module, else the least-loaded shared one). If nothing in the chain is available, the run fails with egress_unavailable rather than silently using a different IP. The run records which module carried it.
API quickstart
Create a key under Integrations. Send it as a bearer token. Every call is scoped to that client.
# list this client's agents and whether they are online
curl -H "Authorization: Bearer nlk_…" \
https://nl.example.com/v1/agents
# one agent
curl -H "Authorization: Bearer nlk_…" \
https://nl.example.com/v1/agents/agt_…
# start a task on that agent (retry-safe)
curl -X POST -H "Authorization: Bearer nlk_…" \
-H "Idempotency-Key: slack-C9-P17-1712345678" \
-H "Content-Type: application/json" \
-d '{
"goal": "Open the portal and read the balance",
"external_id": "ticket-4711",
"extract_schema": {"type":"object","properties":{"balance":{"type":"string"}}},
"webhook": {"url": "https://your-app.example/nl-hook", "token": "YOUR_TOKEN"}
}' \
https://nl.example.com/v1/agents/agt_…/runs
# status (includes queue position or live phase)
curl -H "Authorization: Bearer nlk_…" \
https://nl.example.com/v1/runs/run_…
# the queue, in dispatch order
curl -H "Authorization: Bearer nlk_…" \
"https://nl.example.com/v1/runs?status=queued"
# transcript: model thoughts, tool calls, results, extracts
curl -H "Authorization: Bearer nlk_…" \
"https://nl.example.com/v1/runs/run_…/events?since=0&limit=200"
# stop a run (idempotent; a running run stops at its next action)
curl -X POST -H "Authorization: Bearer nlk_…" \
https://nl.example.com/v1/runs/run_…/cancel
Task body
| Field | Meaning |
|---|---|
goal | The instruction, in plain language. Required. |
extract_schema | JSON schema for the data the run should return in data. |
inputs | Non-secret values referenced as {{name}} in the goal. |
secrets | Values referenced as {{name}}; never sent to the model. |
priority | Higher runs first in the client's queue. |
webhook | {url, token} to receive the result. Public HTTPS only. |
model | Optional model override, if the client is allowed to choose. |
external_id | Your own id for the request. Echoed in status and the webhook. |
Run status
| Status | Meaning |
|---|---|
| queued | Waiting for a free agent. |
| running | Executing on the desktop. |
| needs_human | Paused: a sign-in, CAPTCHA or decision only a person can make. The console's Needs you page shows the screen and a note box. |
| completed | Finished. Read text, data and error. |
| error | Failed; error says why. |
| cancelled / max_turns | Stopped by a person or by the turn limit. |
Transcript and control
GET /v1/runs/{id}/events returns the work log: thought (text and reasoning), command (tool and input), result, extract, screen and status changes. Page with since and limit (max 1000). Secret values never appear; typing records the placeholder.
A queued or running run can be stopped with POST /v1/runs/{id}/cancel. Queued runs are removed immediately; a running run stops at the next action boundary, releases the desktop and is reset. Cancelling an already cancelled run is not an error.
When a run is needs_human, continue it with POST /v1/runs/{id}/resume and {"note": "the sign-in code is 123456"}. The model gets the note and a fresh screenshot. A run that is not waiting returns 409.
Retry-safe submit: send an Idempotency-Key header (or an external_id) with a task. A duplicate submit returns the existing run with 200 instead of starting a second one, which matters when a chat platform retries a message.
Status and the queue list carry position (1 = next) while queued, and phase, turn and tool while running.
Results and webhooks
A run's data matches your schema. text is a short human summary. Every finished run can also be delivered to your webhook:
POST https://your-app.example/nl-hook
Authorization: Bearer YOUR_TOKEN
X-Agent-Run-Id: run_…
{"id":"run_…","status":"completed","goal":"…",
"text":"Balance is 1,240.50 AUD",
"data":{"balance":"1240.50"},
"started_at":"…","finished_at":"…","error":null,
"artifacts":{"dir":"runs/run_…","screenshots":["000.jpg"],"events":"events.jsonl"}}
Delivery retries after 1, 4 and 16 seconds. A run can override the job's endpoint with its own webhook. Private, loopback and Tailscale addresses are refused.
Secrets
Store passwords and keys in Secrets and reference them in a goal as {{secret:name}}. The model sees only the placeholder; the value is decrypted at the moment it is typed. Values are never returned by the API, the console or the webhook.
goal: "Open https://erp.example.com and sign in as mw with {{secret:erp_password}}"
The agent types the value into the page, so it appears in later screenshots unless the field masks it. Prefer password fields.
Troubleshooting
| Symptom | Likely cause / fix |
|---|---|
| Agent offline | Machine asleep, locked or restarted without auto-login; the agent reconnects by itself when the session is back. |
Browser shows ERR_PROXY_CONNECTION_FAILED | Chrome is set to socks5://127.0.0.1:1080 but the egress agent on the machine is not running. Restart it; on a dedicated VM the desktop reset keeps it alive. |
Run fails immediately with model http 429 | The model provider is throttling. NL retries 3 times (3 s, 8 s, 15 s); if it persists, switch the model for that deployment. |
Wrong or invented values in data | The model skipped the source screen. Prefer goals that read a specific page, and check the transcript in the console. |
| No data but status completed | Structured runs now re-check twice before accepting an empty answer; if it still happens, treat the result as suspect and inspect the run. |
Access and tenancy
- Admin (
ADMIN_TOKEN) signs in to the console and sees every client. - Client API keys (
nlk_…) reach only/v1/*and only their own client's agents, jobs, runs and secret names. - There are no user accounts or client logins today; a company is a data boundary, not a login.
- Keys are all-or-nothing: treat them like passwords and rotate them if leaked.
Per-agent URL
Every agent has a public UUID and one base URL. Configure a bot with that URL and an agent-bound key, and nothing else:
https://nl.example.com/a/6f1c2a90-8d3e-4f7a-9b2e-5c1d0a7e4b31
GET /a/{uuid} agent status
POST /a/{uuid}/runs assign a task
GET /a/{uuid}/runs this agent's queue
GET /a/{uuid}/runs/{id} status + progress
GET /a/{uuid}/runs/{id}/events transcript
POST /a/{uuid}/runs/{id}/cancel stop
POST /a/{uuid}/runs/{id}/resume continue a paused run
The URL is an address; the key is the credential. In the console, open Agents and press Create agent key (or call POST /api/apikeys with agent_id). The key is shown once.
curl -H "Authorization: Bearer nlk_…" \
https://nl.example.com/a/6f1c…/runs
curl -X POST -H "Authorization: Bearer nlk_…" \
-H "Idempotency-Key: ticket-4711" \
-H "Content-Type: application/json" \
-d '{"goal":"Open the portal and read the balance"}' \
https://nl.example.com/a/6f1c…/runs
A client-wide key is rejected under /a/ (403), and an agent key used on another agent's URL returns 404. The admin token may read any agent for support. Rotate the key without changing the URL; the public UUID can be rotated only by support.