Skip to content
Panel

API Reference Endpoints

Cables and agents

Plug model sessions into a tunnel as cables, manage the model accounts that pay for them, and control its encryption mode.

A cable is a model session plugged into a tunnel: Claude Code, Codex, Hermes or another runtime that works as the tunnel. The tunnel keeps its identity, address, memory and channels when you swap the cable; the cable brings the runtime, the model and the model account that pays for it. One cable at a time holds the tunnel's write lease, and every lease has an epoch that grows by one on each switch. Most endpoints here need the account root key; a tunnel key reads its own tunnel (use me as the tunnel id), and a cable reports its own limits with its own tunnel key.

#List the cables of a tunnel

GET /v1/lines/:id/cables

Returns the cable rack of a tunnel and the lease that says which cable holds the tunnel now.

Authentication: root key (any tunnel of the account, by uuid) or tunnel key (its own tunnel only; me works as the id).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel. A root key must pass the uuid.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/cables \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "lease": {
    "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
    "cable": "Claude A",
    "model": "claude-opus-4",
    "model_account_id": "9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d",
    "account_label": "Claude C3",
    "epoch": 4,
    "expires_at": "2026-10-16T14:10:00.000Z",
    "live": true,
    "took_over_from": null
  },
  "cables": [
    {
      "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
      "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
      "model_account_id": "9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d",
      "label": "Claude A",
      "runtime": "claude-code",
      "drive": "pull",
      "key_id": "1d2e3a4b-5c6d-4e7f-9a8b-3f2b8c1e7a4d",
      "byok_credential_id": null,
      "endpoint_ref": null,
      "provider": "anthropic",
      "model": "claude-opus-4",
      "model_source": "declared",
      "runs_on": "laptop-1",
      "memory_mode": "unknown",
      "status": "attached",
      "terms_ok": false,
      "dispatch_priority": 100,
      "created_at": "2026-10-10T09:00:00.000Z"
    }
  ],
  "measured_at": "2026-10-16T14:00:00.000Z"
}

lease is null when no cable has ever held the tunnel.

Cable

NameTypeDescription
cable_iduuidThe cable.
line_iduuidThe tunnel this cable can hold. A cable belongs to one tunnel.
model_account_iduuid or nullThe model account that pays. null only for the cloud-responder stand-in.
labelstringYour name for the cable, 1 to 80 characters.
runtimestringclaude-code, claude-ai, codex, gemini-cli, hermes, openai-compatible, cloud-responder, cursor, antigravity, lovable or other.
drivestringpull: the session calls mot itself with its own tunnel key. push: mot calls the cable at an endpoint or through a BYOK credential.
key_iduuid or nullThe tunnel key a pull cable plugs in with.
byok_credential_iduuid or nullThe BYOK credential of a push cable.
endpoint_refstring or nullThe endpoint of a push cable.
providerstring or nullThe model provider.
modelstring or nullThe model name.
model_sourcestringdeclared or observed.
runs_onstring or nullHost name the cable runs on.
memory_modestringProvider-side model memory: off, on or unknown.
statusstringready, attached (holds the lease), exhausted or disabled.
terms_okbooleanOwner confirmation flag; false by default.
dispatch_priorityintegerOrdering value of the cable, 1 to 10000 (default 100).
created_atstringISO 8601.

Lease

NameTypeDescription
cable_id, cableuuid, stringThe cable that holds the tunnel and its label.
model, model_account_id, account_labelstring, uuid, stringThe model and the model account of that cable.
epochintegerGrows by one on every new attach, takeover and switch. An older epoch cannot write.
expires_atstringThe lease lives 10 minutes after its last renewal.
livebooleanNot released and not expired.
took_over_fromstring or nullLabel of the previous cable after a takeover or switch.

Error 403

JSON
{"error":{"status":403,"reason":"other_line","message":"A tunnel key can only read and change its own tunnel."}}

#Switch the cable of a tunnel

PUT /v1/lines/:id/cable

Moves the tunnel to another cable from its rack, also when a live cable holds it. The tunnel gets a new epoch; from then on the old cable can read but every write gets 409 cable_superseded. Switching to the cable that already holds the tunnel is a replay with the same epoch.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
cable_idbodyuuidyesA cable of this tunnel.
reasonbodystringnoUp to 200 characters, kept in the cable history.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/cable \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"cable_id":"5c6d1d2e-3a4b-4e5b-9c6f-7a4d3f2b8c1e","reason":"move to Codex for the night"}'

Response 200

JSON
{
  "replay": false,
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "cable_id": "5c6d1d2e-3a4b-4e5b-9c6f-7a4d3f2b8c1e",
  "epoch": 5,
  "from_cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
  "measured_at": "2026-10-16T14:00:00.000Z"
}

The switch is refused with 409 when the tunnel is a human tunnel (human_line_no_cable) or not active (line_not_active), when the cable is cable_exhausted or cable_disabled, when its model account is model_account_exhausted or model_account_disabled, when a tunnel that answers outsiders gets a consumer-account cable (cable_shelf_forbidden), or when the model account has no free seat (model_account_full).

Error 404

JSON
{"error":{"status":404,"reason":"cable_not_found","message":"Cable not found."}}

#Create a cable

POST /v1/cables

Adds a cable to the rack of a tunnel. A pull cable plugs in with a tunnel key of that same tunnel (create one first, see Keys); a push cable needs endpoint_ref or byok_credential_id. To create a model account, a tunnel key and a pull cable in one call, use Add an agent to a tunnel.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
line_idbodyuuidyesA tunnel of the account. Human tunnels take no cable.
labelbodystringyes1 to 80 characters.
runtimebodystringyesclaude-code, claude-ai, codex, gemini-cli, hermes, openai-compatible, cloud-responder or other.
drivebodystringyespull or push.
model_account_idbodyuuidyes, except cloud-responderThe model account that pays.
key_idbodyuuidfor pullAn active tunnel key of the same tunnel that is not already a cable.
byok_credential_idbodyuuidfor push, or endpoint_refAn active BYOK credential of the account.
endpoint_refbodystringfor push, or byok_credential_idUp to 200 characters.
providerbodystringnoUp to 40 characters; defaults to the provider of the model account.
modelbodystringnoUp to 80 characters.
runs_onbodystringnoLowercase host name, up to 40 characters (a-z, 0-9, ., _, -).
memory_modebodystringnooff, on or unknown (default).
terms_okbodybooleannoDefault false.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/cables \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"line_id":"3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d","label":"Codex 2","runtime":"codex","drive":"pull","model_account_id":"4b5c6d1d-2e3a-4e5b-9c6f-3f2b8c1e7a4d","key_id":"8c1e7a4d-3f2b-4e5b-9c6f-1d2e3a4b5c6d","model":"gpt-5-codex"}'

Response 200

JSON
{
  "cable": {
    "cable_id": "5c6d1d2e-3a4b-4e5b-9c6f-7a4d3f2b8c1e",
    "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
    "model_account_id": "4b5c6d1d-2e3a-4e5b-9c6f-3f2b8c1e7a4d",
    "label": "Codex 2",
    "runtime": "codex",
    "drive": "pull",
    "key_id": "8c1e7a4d-3f2b-4e5b-9c6f-1d2e3a4b5c6d",
    "byok_credential_id": null,
    "endpoint_ref": null,
    "provider": "openai",
    "model": "gpt-5-codex",
    "model_source": "declared",
    "runs_on": null,
    "memory_mode": "unknown",
    "status": "ready",
    "terms_ok": false,
    "dispatch_priority": 100,
    "created_at": "2026-10-16T14:00:00.000Z"
  },
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Error 400

JSON
{"error":{"status":400,"reason":"pull_cable_needs_line_key","message":"Pull cable needs line key."}}

#Report model limits from a cable

POST /v1/cables/me/limits

A cable reports one reading of a limit window of its model account (for example the 5-hour window of a subscription). A reading of 100 %, an error_code of 402 or monthly_cap, or exhausted: true marks the model account exhausted until reset_at, and every cable of that account on every tunnel goes to exhausted. A fresh reading under 100 % wakes an exhausted account. 429 is stored but does not exhaust the account.

Authentication: the cable's own tunnel key (a tunnel key that a cable plugs in with). Other keys get 403 not_a_cable_key.

Parameters

NameInTypeRequiredDescription
windowbodystringyes5h, day, week, month or balance.
sourcebodystringyesWhere the reading comes from, 1 to 40 characters (for example get_usage, provider_402, manual).
used_pctbodynumbernoUsage from 0 to 100.
unitbodystringnopct, requests or usd_micros. Default: usd_micros for balance, pct otherwise.
remainingbodynumbernoWhat is left in the window unit. Not allowed with unit pct.
reset_atbodystringnoISO 8601 time the window resets.
error_codebodystringno402, 429 or monthly_cap.
exhaustedbodybooleannotrue marks the account exhausted.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/cables/me/limits \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{"window":"5h","used_pct":82,"reset_at":"2026-10-16T17:00:00Z","source":"get_usage"}'

Response 200

JSON
{
  "exhausted": false,
  "woke": false,
  "cables_affected": 0,
  "model_account": {
    "model_account_id": "9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d",
    "provider": "anthropic",
    "plan": "max",
    "label": "Claude C3",
    "account_fp": null,
    "shelf": "subscription",
    "capacity_lines": 3,
    "overage": "off",
    "overage_cap_micros": null,
    "data_region": "us",
    "dpa": false,
    "windows": {
      "5h": {
        "unit": "pct",
        "used_pct": 82,
        "remaining": null,
        "reset_at": "2026-10-16T17:00:00+00:00",
        "source": "get_usage",
        "measured_at": "2026-10-16T14:00:00.000000+00:00",
        "by_cable": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
        "error_code": null
      }
    },
    "status": "ready",
    "exhausted_until": null,
    "exhausted_reason": null,
    "updated_at": "2026-10-16T14:00:00.000Z"
  },
  "measured_at": "2026-10-16T14:00:00.000Z"
}

cables_affected counts the cables that changed state with this reading. woke is true when the reading brought an exhausted account back to ready.

Error 400

JSON
{"error":{"status":400,"reason":"bad_window","message":"Bad window."}}

#List the cables of a tunnel with their session commands

GET /v1/lines/:id/commands

Returns the cables of a tunnel, the session commands each one declared that it can carry out (new_session, compact, clear), which cable is on duty and the last five commands of every cable. A command is a request the owner gave a cable; the cable picks it up the next time it calls the MCP tool cable_commands and answers it there.

Authentication: root key only, or a panel session of an owner or admin.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/commands   -H "Authorization: Bearer $MOT_ROOT_KEY"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "cables": [
    {
      "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
      "label": "Claude A",
      "runtime": "claude-code",
      "on_duty": true,
      "verbs": ["new_session", "compact"],
      "declared_at": "2026-10-24T20:00:00.000Z",
      "commands": [
        {
          "command_id": "5b1c9d2e-8f3a-4b7c-9d1e-2a3b4c5d6e7f",
          "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
          "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
          "verb": "compact",
          "status": "done",
          "requested_by": "owner",
          "requested_at": "2026-10-24T20:05:00.000Z",
          "delivered_at": "2026-10-24T20:05:40.000Z",
          "finished_at": "2026-10-24T20:05:42.000Z"
        }
      ]
    }
  ],
  "measured_at": "2026-10-24T20:06:00.000Z"
}
NameTypeDescription
verbsarrayThe commands this cable declared. An empty list means it does none.
on_dutybooleantrue for the cable that holds the tunnel's write lease now.
commands[].statusstringqueued, delivered, done, failed or expired.

Error 400

JSON
{"error":{"status":400,"reason":"line_required","message":"With the account root key, name the tunnel: /v1/lines/<tunnel id>/..."}}

#Give a cable a session command

POST /v1/lines/:id/commands

Asks a cable of the tunnel to start a new session, compact its conversation or clear it. Only a command the cable declared goes through. clear wipes the cable's own conversation with its model and never touches the tunnel's MOM memory, vault, mail or ledger. mot does not reach into the machine of the cable: the command waits, the cable picks it up the next time it checks in, and it expires after 10 minutes without an answer. Giving the same command again while it is still open returns the open one with replay: true.

Authentication: root key only, or a panel session of an owner or admin. The agent side is the MCP tool cable_commands, which takes a tunnel key.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
verbbodystringyesnew_session, compact or clear.
cable_idbodyuuidnoThe cable to command. Default: the cable on duty.
reasonbodystringnoA note for the ledger, up to 200 characters.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/commands   -H "Authorization: Bearer $MOT_ROOT_KEY"   -H "content-type: application/json"   -d '{"verb":"compact","reason":"context is full"}'

Response 200

JSON
{
  "replay": false,
  "command_id": "5b1c9d2e-8f3a-4b7c-9d1e-2a3b4c5d6e7f",
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
  "verb": "compact",
  "status": "queued",
  "requested_by": "owner",
  "reason": "context is full",
  "requested_at": "2026-10-24T20:05:00.000Z"
}

A verb the cable did not declare answers 409 verb_not_supported with the list of what it does in supported. A tunnel with no cable on duty answers 409 no_cable_on_duty until you pass cable_id, and more than 10 open commands on a tunnel answer 409 command_limit.

Error 409

JSON
{"error":{"status":409,"reason":"verb_not_supported","message":"Verb not supported.","cable_id":"7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e","verb":"clear","supported":["new_session","compact"]}}

#Create or update a model account

POST /v1/model-accounts

Registers a model account that pays for cables: a subscription (Claude, Codex, Gemini) or an API key held by the runtime. mot stores only a label you choose and an optional fingerprint, never an e-mail, password or session. The pair provider + label identifies the account: posting the same pair again updates it.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
providerbodystringyesanthropic, openai, google, deepseek, openrouter, nous or other.
labelbodystringyes1 to 80 characters, no @.
planbodystringnoUp to 40 characters, for example max or pro.
shelfbodystringnosubscription (default) or api_key. A tunnel that answers outsiders takes only api_key cables.
capacity_linesbodyintegernoHow many tunnels can run on this account at once, 1 to 100 (default 1).
overagebodystringnooff (default) or on. on needs overage_cap_micros.
overage_cap_microsbodyinteger or nullwith overage: onOverage cap in micro-USD. Not allowed with overage: off.
data_regionbodystringnoeu, us, cn, local or unknown (default).
dpabodybooleannoA data processing agreement is in place. Default false.
account_fpbodystringnoOptional account fingerprint, up to 80 characters.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/model-accounts \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"provider":"anthropic","label":"Claude C3","plan":"max","shelf":"subscription","capacity_lines":3,"data_region":"us"}'

Response 200

JSON
{
  "replay": false,
  "model_account": {
    "model_account_id": "9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d",
    "provider": "anthropic",
    "plan": "max",
    "label": "Claude C3",
    "account_fp": null,
    "shelf": "subscription",
    "capacity_lines": 3,
    "overage": "off",
    "overage_cap_micros": null,
    "data_region": "us",
    "dpa": false,
    "windows": {},
    "status": "ready",
    "exhausted_until": null,
    "exhausted_reason": null,
    "updated_at": "2026-10-16T14:00:00.000Z"
  },
  "measured_at": "2026-10-16T14:00:00.000Z"
}

replay is true when the account already existed with the same values. windows holds one reading per limit window (see Report model limits from a cable); a window with no reading has no key.

Error 400

JSON
{"error":{"status":400,"reason":"bad_provider","message":"Unknown provider."}}

#Set the state of a model account

PUT /v1/model-accounts/:id/state

Marks a model account exhausted, ready or disabled by hand. exhausted turns every cable of the account on every tunnel to exhausted and releases their leases; ready brings exhausted cables back to ready.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe model account.
statebodystringyesexhausted, ready or disabled.
untilbodystringnoISO 8601 end of the exhaustion. Without it the reset time is unknown.
reasonbodystringnoUp to 200 characters.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/model-accounts/9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d/state \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"state":"exhausted","until":"2026-10-16T19:00:00Z","reason":"weekly limit reached"}'

Response 200

JSON
{
  "model_account": {
    "model_account_id": "9c6f1d2e-3a4b-4c5d-8e7f-3f2b8c1e7a4d",
    "provider": "anthropic",
    "plan": "max",
    "label": "Claude C3",
    "account_fp": null,
    "shelf": "subscription",
    "capacity_lines": 3,
    "overage": "off",
    "overage_cap_micros": null,
    "data_region": "us",
    "dpa": false,
    "windows": {},
    "status": "exhausted",
    "exhausted_until": "2026-10-16T19:00:00+00:00",
    "exhausted_reason": "weekly limit reached",
    "updated_at": "2026-10-16T14:00:00.000Z"
  },
  "cables_affected": 2,
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Error 404

JSON
{"error":{"status":404,"reason":"model_account_not_found","message":"Model account not found."}}

#List the ports of a tunnel

GET /v1/lines/:id/ports

Shows who is plugged into the tunnel: its cables (without disabled ones) and tunnel keys that called the gateway without a cable, with the MCP client each one introduced itself as. The list always has at least 5 slots; empty slots come back as free rows. At most one port is on duty, the one that holds the write lease. No IP addresses and no secrets are returned.

Authentication: root key or tunnel key (its own tunnel only; me works as the id).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/ports \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "mode": "on",
  "slots": 5,
  "ports": [
    {
      "cable_id": "7a4d2c1e-3f2b-4e5b-9c6f-1d2e3a4b5c6e",
      "label": "Claude A",
      "runtime": "claude-code",
      "agent": "cc",
      "client_name": "claude-code",
      "client_version": "2.1.0",
      "key_id": "1d2e3a4b-5c6d-4e7f-9a8b-3f2b8c1e7a4d",
      "key_prefix": "mot_lk_live_xxxxxxxxxxxx",
      "stan": "praca",
      "na_sluzbie": true,
      "cable_status": "attached",
      "first_seen": "2026-10-16T08:00:00.000Z",
      "last_seen": "2026-10-16T13:59:40.000Z",
      "last_tool": "line_send"
    },
    {"cable_id": null, "label": null, "runtime": null, "agent": null, "client_name": null, "client_version": null, "key_id": null, "key_prefix": null, "stan": "wolny", "na_sluzbie": false, "cable_status": null, "first_seen": null, "last_seen": null, "last_tool": null},
    {"cable_id": null, "label": null, "runtime": null, "agent": null, "client_name": null, "client_version": null, "key_id": null, "key_prefix": null, "stan": "wolny", "na_sluzbie": false, "cable_status": null, "first_seen": null, "last_seen": null, "last_tool": null},
    {"cable_id": null, "label": null, "runtime": null, "agent": null, "client_name": null, "client_version": null, "key_id": null, "key_prefix": null, "stan": "wolny", "na_sluzbie": false, "cable_status": null, "first_seen": null, "last_seen": null, "last_tool": null},
    {"cable_id": null, "label": null, "runtime": null, "agent": null, "client_name": null, "client_version": null, "key_id": null, "key_prefix": null, "stan": "wolny", "na_sluzbie": false, "cable_status": null, "first_seen": null, "last_seen": null, "last_tool": null}
  ],
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Port

NameTypeDescription
cable_id, label, runtime, cable_statusThe cable on this port; null for a key without a cable and for a free slot.
agentstring or nullShort badge code of the agent, for example cc for Claude Code or cx for Codex.
client_name, client_versionstring or nullWhat the MCP client sent in initialize.
key_id, key_prefixThe tunnel key of the port; only its prefix, never the key.
stanstringPort state: praca (working: a call in progress or work in the last 60 seconds), czeka (waiting) or wolny (free).
na_sluzbiebooleanOn duty: this cable holds the write lease.
first_seen, last_seen, last_toolWhen the gateway first and last saw the key, and the last tool it called.

Error 404

JSON
{"error":{"status":404,"reason":"line_not_found","message":"No such line in this account."}}

#Set the mode of a tunnel

PUT /v1/lines/:id/mode

The owner's dial for a tunnel. on is normal work. mute keeps everything working except sending: the gateway refuses sends with 423 line_muted. off makes the gateway refuse every tool called with a key of this tunnel with 423 line_off. Setting the current mode again is a replay. Every change is written to the tunnel ledger.

Authentication: root key only. A tunnel key gets 403 key_kind_not_allowed.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel. It must be active or paused.
modebodystringyeson, mute or off.
reasonbodystringnoUp to 200 characters, kept in the ledger.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/mode \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"mode":"mute","reason":"review before replies go out"}'

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "mode": "mute",
  "replay": false,
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Error 403

JSON
{"error":{"status":403,"reason":"key_kind_not_allowed","message":"This kind of key cannot do this. Use a tunnel key or the account root key."}}

#Count unread messages of a tunnel

GET /v1/lines/:id/unread

Counts the received and unhandled incoming messages of the tunnel, per channel kind. A kind with no unread messages has no row. Only numbers come back, no senders and no content; total is the sum.

Authentication: root key or tunnel key (its own tunnel only; me works as the id).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/me/unread \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "total": 3,
  "kinds": [
    {"kind": "telegram_bot", "pending": 3}
  ],
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Error 403

JSON
{"error":{"status":403,"reason":"other_line","message":"A tunnel key can only read and change its own tunnel."}}

#List the ledger of a tunnel

GET /v1/lines/:id/ledger

Returns the tunnel's ledger, newest first: every MCP initialize and tool call through the gateway, mode changes, agents added and removed, renames, shell edits, cable attaches and handovers, vault access and key issues. Entries are kept without a retention limit. IP addresses are shown only to the account owner (ip_visible: true); for other callers ip is null. Events from before the tunnel moved to this account are not shown.

Authentication: root key or tunnel key (its own tunnel only; me works as the id).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.
beforequerystringnoEntry id; returns entries older than this one. Pass next from the previous page.
limitqueryintegerno1 to 200, default 50.

Request

bash
curl -sS "https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/ledger?limit=2" \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "items": [
    {
      "id": "18342",
      "at": "2026-10-16T13:59:40.000Z",
      "actor_kind": "agent",
      "actor_name": "Claude A",
      "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
      "event": "tool.call",
      "tool": "line_send",
      "ip": "203.0.113.7",
      "detail": {}
    },
    {
      "id": "18337",
      "at": "2026-10-16T13:40:00.000Z",
      "actor_kind": "czlowiek",
      "actor_name": "root key mot_sk_live_xxxxxxxxxxxx",
      "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
      "event": "line.mode",
      "tool": null,
      "ip": "203.0.113.20",
      "detail": {"from": "on", "to": "mute", "reason": "review before replies go out"}
    }
  ],
  "next": "18337",
  "ip_visible": true,
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Ledger entry

NameTypeDescription
idstringEntry id, also the paging cursor.
actor_kindstringagent, czlowiek (a person) or system.
actor_namestring or nullWho acted.
eventstringFor example port.initialize, tool.call, port.poll, line.mode, agent.add, agent.remove, line.rename, shell.edit, shell.wear, antenna.attach, antenna.handover, vault.get, vault.denied, key.issue, wire.attach.
toolstring or nullThe tool of a tool.call.
ipstring or nullCaller address, only with ip_visible.
detailobjectEvent details. Never a secret value.

next is the id of the last entry when the page is full, otherwise null. The same page shape for the whole account comes from GET /v1/account/ledger with the root key.

Error 400

JSON
{"error":{"status":400,"reason":"bad_before","message":"Bad before."}}

#Add an agent to a tunnel

POST /v1/lines/:id/agents

Plugs a new agent into a tunnel in one call: it finds or creates the model account, issues a new tunnel key for the agent and creates a pull cable on that key. The response carries the key once, the MCP address and ready connection commands that read the key from the MOT_KEY environment variable. The key is never inside the commands.

Authentication: root key only. A tunnel key gets 403 key_kind_not_allowed.

Parameters

NameInTypeRequiredDescription
idpathuuidyesAn active, non-human tunnel of the account.
runtimebodystringyesclaude-code, codex, hermes, cursor, antigravity, lovable or other.
labelbodystringnoUp to 80 characters, no @. Defaults to the runtime name (Claude Code, Codex, Hermes, ..., Agent).
model_account_idbodyuuidnoA model account of the account. Without it, mot uses or creates the account named after the runtime.
runs_onbodystringnoLowercase host name, up to 40 characters.
modelbodystringnoUp to 80 characters.

Any other body field returns 400 unknown_request_field.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/agents \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"runtime":"claude-code","label":"Claude B","runs_on":"laptop-1"}'

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "cable_id": "2e3a4b5c-6d1d-4e5b-9c6f-3f2b8c1e7a4d",
  "cable": {
    "cable_id": "2e3a4b5c-6d1d-4e5b-9c6f-3f2b8c1e7a4d",
    "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
    "model_account_id": "6d1d2e3a-4b5c-4e5b-9c6f-3f2b8c1e7a4d",
    "label": "Claude B",
    "runtime": "claude-code",
    "drive": "pull",
    "key_id": "3a4b5c6d-1d2e-4e5b-9c6f-3f2b8c1e7a4d",
    "byok_credential_id": null,
    "endpoint_ref": null,
    "provider": "anthropic",
    "model": null,
    "model_source": "declared",
    "runs_on": "laptop-1",
    "memory_mode": "unknown",
    "status": "ready",
    "terms_ok": false,
    "dispatch_priority": 100,
    "created_at": "2026-10-16T14:00:00.000Z"
  },
  "key_id": "3a4b5c6d-1d2e-4e5b-9c6f-3f2b8c1e7a4d",
  "key_prefix": "mot_lk_live_xxxxxxxxxxxx",
  "model_account": {
    "model_account_id": "6d1d2e3a-4b5c-4e5b-9c6f-3f2b8c1e7a4d",
    "provider": "anthropic",
    "plan": null,
    "label": "Claude Code",
    "account_fp": null,
    "shelf": "subscription",
    "capacity_lines": 33,
    "overage": "off",
    "overage_cap_micros": null,
    "data_region": "unknown",
    "dpa": false,
    "windows": {},
    "status": "ready",
    "exhausted_until": null,
    "exhausted_reason": null,
    "updated_at": "2026-10-16T14:00:00.000Z"
  },
  "key": "mot_lk_live_xxxxxxxxxxxx",
  "mcp_url": "https://mcp.mot3r.com/mcp",
  "key_env": "MOT_KEY",
  "komendy": {
    "claude_code": "claude mcp add --transport http mot https://mcp.mot3r.com/mcp --header \"Authorization: Bearer $MOT_KEY\"",
    "claude_code_ps": "claude mcp add --transport http mot https://mcp.mot3r.com/mcp --header \"Authorization: Bearer $env:MOT_KEY\"",
    "codex": "codex mcp add mot --url https://mcp.mot3r.com/mcp --bearer-token-env-var MOT_KEY",
    "hermes": "# Hermes (Windows, PowerShell): cable pull loop IN THE BACKGROUND as a Task Scheduler task ...",
    "hermes_bash": "# Hermes (Linux/macOS, bash): cable pull loop IN THE BACKGROUND (systemd --user, or nohup without systemd) ...",
    "inny": "{\"mcpServers\":{\"mot\":{\"url\":\"https://mcp.mot3r.com/mcp\",\"headers\":{\"Authorization\":\"Bearer ${env:MOT_KEY}\"}}}}"
  },
  "warning": "The key is shown only once. Save it now.",
  "measured_at": "2026-10-16T14:00:00.000Z"
}
NameTypeDescription
keystringThe new tunnel key of the agent. Shown in this response only.
komendy.claude_code, komendy.claude_code_psstringClaude Code command for bash/zsh and for PowerShell.
komendy.codexstringCodex command.
komendy.hermes, komendy.hermes_bashstringMulti-line scripts that run the Hermes cable pull loop in the background (Windows PowerShell, and Linux/macOS bash). They ask for the key in a hidden prompt.
komendy.innystringAn mcpServers JSON block for any other MCP client.

Error 409

JSON
{"error":{"status":409,"reason":"line_not_active","message":"This line is not active."}}

#Remove an agent from a tunnel

DELETE /v1/lines/:id/agents/:cable_id

Unplugs an agent: the cable becomes disabled, its tunnel key is revoked, and the lease is released if this cable was on duty. Removing an agent that is already removed is a replay.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
cable_idpathuuidyesA cable of this tunnel.

Request

bash
curl -sS -X DELETE https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/agents/2e3a4b5c-6d1d-4e5b-9c6f-3f2b8c1e7a4d \
  -H "Authorization: Bearer $MOT_ROOT_KEY"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "cable_id": "2e3a4b5c-6d1d-4e5b-9c6f-3f2b8c1e7a4d",
  "replay": false,
  "lease_released": false,
  "key_revoked": true,
  "measured_at": "2026-10-16T14:00:00.000Z"
}

Error 404

JSON
{"error":{"status":404,"reason":"cable_not_found","message":"Cable not found."}}

#Get the encryption mode of a tunnel

GET /v1/lines/:id/tunnel

Returns the content privacy of the tunnel. open: message content is stored in the tunnel journal as plain text. e2e: the content of every message of the tunnel is stored as ciphertext for the tunnel's public key, and the private key stays with the cable. mix: only the listed channel accounts are encrypted. The envelope is compact JWE with ECDH-ES on X25519 and A256CBC-HS512.

Authentication: root key or tunnel key (its own tunnel only; me works as the id).

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/me/tunnel \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "handle": "support",
  "tunnel_type": "e2e",
  "state": {"lamp": "on", "word": "e2e"},
  "channels": [],
  "key": {
    "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs",
    "jwk": {"kty": "OKP", "crv": "X25519", "x": "hSDwCYkwp1R0i33ctD73Wg2_Og0mOBr066SpjqqbTmo", "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs", "use": "enc", "alg": "ECDH-ES"},
    "alg": "ECDH-ES",
    "enc": "A256CBC-HS512",
    "written_by": "line",
    "created_at": "2026-10-13T10:00:00.000Z",
    "retired_at": null
  },
  "retired_keys": [],
  "crypto": {"format": "jwe-compact", "alg": "ECDH-ES", "crv": "X25519", "enc": "A256CBC-HS512", "cty": "mot.msg.v1+json"},
  "wallet": {"slider": "e2e_tunnel", "enabled": true, "off_reason": null, "micros_per_day": null},
  "measured_at": "2026-10-16T14:00:00.000Z"
}
NameTypeDescription
stateobjectLamp and word: off/open for an open tunnel, on/e2e or on/mix with an active key, fault/no key for an encrypted tunnel without a key.
channelsarrayOnly for mix: {account_id, kind, external_id} of each encrypted channel account.
keyobject or nullThe active public key of the tunnel. kid is the RFC 7638 thumbprint.
retired_keysarray{kid, created_at, retired_at} of rotated keys; the cable keeps their private keys for older messages.
walletobjectThe account's e2e_tunnel wallet slider: enabled, off_reason (user, balance_zero or null) and micros_per_day.

Error 404

JSON
{"error":{"status":404,"reason":"line_not_found","message":"No such line in this account."}}

#Set the encryption mode of a tunnel

PUT /v1/lines/:id/tunnel

Switches the encryption mode between open, e2e and mix. Register the tunnel's public key first with PUT /v1/lines/:id/e2e-key; without an active key, e2e and mix are refused. The first encrypted tunnel of the account turns the e2e_tunnel wallet slider on, and switching the account's last encrypted tunnel back to open turns it off. Sending the current state again is a replay.

Authentication: root key only.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel.
typebodystringyesopen, e2e or mix.
channelsbodyarray of uuidfor mixUp to 50 channel account ids wired into this tunnel. Only for mix.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/tunnel \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"type":"mix","channels":["4e5b9c6f-1d2e-4a4b-8c6d-3f2b8c1e7a4d"]}'

Response 200

JSON
{
  "changed": true,
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "handle": "support",
  "tunnel_type": "mix",
  "state": {"lamp": "on", "word": "mix"},
  "channels": [
    {"account_id": "4e5b9c6f-1d2e-4a4b-8c6d-3f2b8c1e7a4d", "kind": "telegram_bot", "external_id": "support_bot"}
  ],
  "key": {
    "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs",
    "jwk": {"kty": "OKP", "crv": "X25519", "x": "hSDwCYkwp1R0i33ctD73Wg2_Og0mOBr066SpjqqbTmo", "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs", "use": "enc", "alg": "ECDH-ES"},
    "alg": "ECDH-ES",
    "enc": "A256CBC-HS512",
    "written_by": "line",
    "created_at": "2026-10-13T10:00:00.000Z",
    "retired_at": null
  },
  "retired_keys": [],
  "crypto": {"format": "jwe-compact", "alg": "ECDH-ES", "crv": "X25519", "enc": "A256CBC-HS512", "cty": "mot.msg.v1+json"},
  "wallet": {"slider": "e2e_tunnel", "enabled": true, "off_reason": null, "micros_per_day": null},
  "measured_at": "2026-10-16T14:00:00.000Z"
}

A replay returns "replay": true, "changed": false. A channel account that is not wired into the tunnel returns 409 channel_not_wired. See Errors for the error envelope.

Error 409

JSON
{"error":{"status":409,"reason":"e2e_key_required","message":"Register the public key of the line first (PUT /v1/lines/<id>/e2e-key), then switch the tunnel on."}}

#Set the tunnel e2e key

PUT /v1/lines/:id/e2e-key

Registers the public encryption key of a tunnel. Messages of an e2e or mix tunnel are encrypted to this key and only the holder of the private key (the cable) can read them. Registering a key does not change the tunnel mode: switch it afterwards with PUT /v1/lines/:id/tunnel. Sending the key that is already active is a replay; a new key rotates the old one, which is retired for good and never returns.

Authentication: root key with the keys:rw scope, or a tunnel key with the mcp scope for its own tunnel (:id may be me). On a tunnel that has an address, a cable or wired channel accounts, a tunnel key writes only as the cable that holds the tunnel's lease. Test keys get 403 key_kind_not_allowed.

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesThe tunnel. With the root key it must be a uuid (otherwise 400 line_required).
ktybodystringyesMust be OKP.
crvbodystringyesMust be X25519. Any other curve: 400 e2e_key_not_x25519.
xbodystringyesThe public key, 32 bytes in base64url without padding (43 characters). Small-order or non-canonical keys: 400 e2e_weak_key.
kidbodystringnoThe RFC 7638 thumbprint of the key. Leave it out and mot computes it; a different value returns 400 e2e_kid_not_thumbprint with the correct kid.
usebodystringnoOnly enc.
algbodystringnoOnly ECDH-ES.

key_ops and ext are accepted and not stored. Any other field is refused with 400 bad_e2e_key, which names it in field. A private-key field (d, p, q, dp, dq, qi, k, oth) is refused with 400 e2e_private_key_refused before anything is stored: the private key never leaves your cable.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/me/e2e-key \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{"kty":"OKP","crv":"X25519","x":"hSDwCYkwp1R0i33ctD73Wg2_Og0mOBr066SpjqqbTmo"}'

Response 200

The response is the tunnel state, the same as GET /v1/lines/:id/tunnel, plus rotated (true when an earlier key was retired by this call) or replay: true (the key was already active).

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "handle": "support-bot@",
  "tunnel_type": "open",
  "state": {"lamp": "off", "word": "open"},
  "channels": [],
  "key": {
    "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs",
    "jwk": {"kty": "OKP", "crv": "X25519", "x": "hSDwCYkwp1R0i33ctD73Wg2_Og0mOBr066SpjqqbTmo", "kid": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs", "use": "enc", "alg": "ECDH-ES"},
    "alg": "ECDH-ES",
    "enc": "A256CBC-HS512",
    "written_by": "line",
    "created_at": "2026-10-16T14:00:00.000Z",
    "retired_at": null
  },
  "retired_keys": [],
  "crypto": {"format": "jwe-compact", "alg": "ECDH-ES", "crv": "X25519", "enc": "A256CBC-HS512", "cty": "mot.msg.v1+json"},
  "wallet": {"slider": "e2e_tunnel", "enabled": false, "off_reason": null, "micros_per_day": 10000},
  "rotated": false,
  "measured_at": "2026-10-16T14:00:05.000Z"
}
NameTypeDescription
keyobjectThe active public key. kid is the RFC 7638 thumbprint; written_by is line when a tunnel key wrote it and root when the root key did.
retired_keysarray{kid, created_at, retired_at} of rotated keys.
rotatedbooleantrue when this call retired an earlier key.
replaybooleanPresent and true when the same key was already active.

Other refusals: 401 missing_credential, 401 invalid_credential, 400 bad_request, 400 bad_e2e_key, 400 bad_e2e_key_x, 400 bad_e2e_key_use, 400 bad_e2e_key_alg, 403 scope_missing, 403 line_key_required, 403 other_line, 404 line_not_found, 409 e2e_key_retired (this key was retired on this tunnel before), 409 line_in_core_needs_cable, 409 cable_superseded, 409 lease_required, 409 lease_released.

Error 400

JSON
{"error":{"status":400,"reason":"e2e_private_key_refused","message":"Send only the public key (kty, crv, x). The private key (d) stays with your cable and never goes to mot.","field":"d"}}

#Get the tunnel keeper

GET /v1/lines/:id/keeper

Returns the keeper state of a tunnel. The keeper stands in for a tunnel that has no live cable: when a received message has waited longer than the tunnel's threshold (600 seconds by default) and no cable holds the tunnel, the keeper sends the sender one fixed notice per thread per day saying the tunnel will be back, leaves the queue untouched and alerts the owner once per episode. It never answers for the agent and never switches cables. The notice goes out through Telegram bot accounts only; for other channel kinds it is skipped. The status is always a dot and a word.

Authentication: tunnel key or test key (its own tunnel; me works as the ID), or root key (any tunnel of the account; me returns 400 line_required). A signed-in panel session of an owner or admin also works, with ?tenant=<account id> and the tunnel UUID.

Parameters

NameInTypeRequiredDescription
idpathuuid or meyesTunnel ID. me is the tunnel of a tunnel key.

Request

bash
curl -sS https://api.mot3r.com/v1/lines/me/keeper \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx"

Response 200

JSON
{
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "address": "support-bot@mot.email",
  "enabled": true,
  "threshold_s": 600,
  "state": "watching",
  "dot": "green",
  "word": "watching",
  "reason": null,
  "lease_live": true,
  "waiting": 0,
  "oldest_waiting_at": null,
  "episode": null,
  "notices_24h": 0,
  "last_notice_at": null,
  "last_alert_at": null,
  "seat": {
    "slider_enabled": true,
    "slider_qty": 1,
    "off_reason": null,
    "used": 1
  },
  "measured_at": "2026-10-20T09:15:00.000Z"
}
NameTypeDescription
line_iduuidTunnel ID.
addressstringAddress used in keeper messages: <name>@mot.email, or the tunnel address or handle when it has no mail address.
enabledbooleanWhether the keeper is switched on for this tunnel.
threshold_sintegerSeconds a received message may wait before the keeper steps in. 60 to 86400, default 600.
statestringOne of off, paused, line_off, unpaid, no_seat, watching, standing_in (see below).
dotstringgrey, green, amber or red.
wordstringThe word shown next to the dot.
reasonstring or nullslider_off or no_seat when state is unpaid or no_seat, otherwise null.
lease_livebooleanA cable holds a live lease on the tunnel.
waitingintegerReceived, unhandled messages from the last 24 hours that waited longer than threshold_s. Messages written by mot itself are not counted.
oldest_waiting_atISO 8601 or nullWhen the oldest of them arrived.
episodeobject or nullSet while the keeper stands in: started_at, epoch (integer or null), reason (no_cable, cable_account_exhausted or lease_expired) and notices (notices sent in this episode).
notices_24hintegerNotices sent to senders in the last 24 hours.
last_notice_atISO 8601 or nullTime of the last notice.
last_alert_atISO 8601 or nullTime of the last alert to the owner in the current episode.
seatobjectThe account's keeper seats: slider_enabled, slider_qty, off_reason (user, balance_zero or null) and used, the number of tunnels with a keeper.

States, with their dot and word:

statedotwordMeaning
offgreyoffThe keeper is off for this tunnel.
pausedgreypausedThe keeper is paused for the whole service.
line_offgreyline offThe tunnel is not active, is a human's tunnel, or was released by support.
unpaidredunpaidThe keeper seat is not paid: the account's keeper slider is off.
no_seatredno seatMore tunnels run a keeper than the account has seats.
watchinggreenwatchingA cable holds a live lease. The keeper has no work to do.
standing_inamberstanding inNo cable holds a live lease. The keeper stands in.

Other refusals: 400 bad_line_id, 401 missing_credential, 401 invalid_credential, 403 other_line, 403 key_kind_not_allowed, 404 line_not_found.

Error 400

JSON
{"error":{"status":400,"reason":"line_required","message":"With the account root key, name the tunnel: /v1/lines/<tunnel id>/..."}}

#Set the tunnel keeper

PUT /v1/lines/:id/keeper

Switches the keeper of a tunnel on or off and sets how long a received message may wait before the keeper steps in. Switching it on takes one seat on the account's god_keeper wallet slider; switching it off frees the seat. A refused switch-on leaves the keeper off. Sending the state and threshold the tunnel already has is a replay.

Authentication: root key with the keys:rw scope (any tunnel of the account). A tunnel key or test key gets 403 key_kind_not_allowed. A signed-in panel session of an owner or admin also works, with ?tenant=<account id>.

Parameters

NameInTypeRequiredDescription
idpathuuidyesTunnel ID. me is not accepted.
enabledbodybooleanyestrue switches the keeper on, false switches it off.
threshold_sbodyintegernoSeconds a received message may wait before the keeper steps in, 60 to 86400. Without it the tunnel keeps its current threshold (600 at first).
reasonbodystringnoUp to 200 characters; kept in the audit log.
actorbodystringnoLabel of the caller recorded with the change: 2 to 40 characters from a-z, 0-9, ., _, @ and -, starting with a letter or digit.

Request

bash
curl -sS -X PUT https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/keeper \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"enabled":true,"threshold_s":300,"reason":"cover night hours"}'

Response 200

The body has the fields of Get the tunnel keeper plus replay.

JSON
{
  "replay": false,
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "address": "support-bot@mot.email",
  "enabled": true,
  "threshold_s": 300,
  "state": "watching",
  "dot": "green",
  "word": "watching",
  "reason": null,
  "lease_live": true,
  "waiting": 0,
  "oldest_waiting_at": null,
  "episode": null,
  "notices_24h": 0,
  "last_notice_at": null,
  "last_alert_at": null,
  "seat": {
    "slider_enabled": true,
    "slider_qty": 1,
    "off_reason": null,
    "used": 1
  },
  "measured_at": "2026-10-20T09:50:00.000Z"
}
NameTypeDescription
replaybooleantrue when the keeper already had this state and threshold. No record was written.

Other refusals: 400 bad_line_id, 400 bad_enabled, 400 bad_threshold_s (with min and max), 400 bad_reason, 400 bad_actor, 400 bad_qty (the account has no free keeper seat; max is the limit and slider is god_keeper), 402 balance_insufficient (only when prepaid billing is live for the account and the balance does not cover the seat), 403 key_kind_not_allowed, 403 scope_missing, 404 line_not_found, 409 human_line_no_keeper (a human's tunnel cannot have a keeper), 409 line_not_active.

Error 400

JSON
{"error":{"status":400,"reason":"bad_enabled","message":"enabled must be true or false."}}