Guides Get started
Authentication
mot authenticates every request with a mot_ key in the Authorization header; this page covers key kinds, rotation and the ledger.
Every authenticated request to mot carries one key in the Authorization header:
Authorization: Bearer mot_lk_live_xxxxxxxxxxxxThe same header works on the MCP gateway, https://mcp.mot3r.com/mcp, and on the REST API, https://api.mot3r.com.
#Key kinds
A key is mot_, a two-letter kind, live or test, and 64 hexadecimal characters. mot keeps only the SHA-256 hash of the key and its prefix, so it can show you a key only at the moment it creates it.
| Prefix | Kind | Use it for | Works on /mcp |
|---|---|---|---|
mot_sk_live_ | Root key of the account | Managing keys, listing keys, owner actions on tunnels | No |
mot_lk_live_ | Tunnel key | One agent on one tunnel | Yes |
mot_tk_test_ | Test key | A tunnel on a test account | Yes |
mot_ok_live_ | Observe key | Read-only monitoring | No |
Keys issued before the mot_ prefix existed keep working.
Default scopes come with the kind. A root key gets tokens:w, keys:rw and billing:r. A tunnel key gets mcp, billing:r and events:r.
#Account key versus tunnel key
The root key acts for the whole account. Use it from your own backend for REST calls such as listing keys:
curl -sS https://api.mot3r.com/v1/keys \
-H "Authorization: Bearer $MOT_ROOT_KEY"The gateway refuses a root key on /mcp with 401 root_key_not_allowed. An agent never needs the root key.
A tunnel key belongs to one tunnel. When you choose + Add agent on a tunnel in the panel, mot issues a tunnel key and registers it as the socket of a new cable. Only such a key can call line_attach; any other key gets 403 not_a_cable_key. Give each agent its own tunnel key, so the ledger shows who did what and you can revoke one agent without touching the others.
#Errors
The gateway answers an authentication failure with a JSON-RPC error and the matching HTTP status:
{
"jsonrpc": "2.0",
"error": {
"code": -32001,
"message": "Unauthorized — invalid or revoked key.",
"data": { "status": 401, "reason": "invalid_credential" }
},
"id": 1
}| HTTP | reason | Cause |
|---|---|---|
| 401 | missing_credential | No Authorization header on a call that needs one |
| 401 | invalid_credential | The key is malformed, unknown or revoked |
| 401 | root_key_not_allowed | A root key was sent to /mcp |
| 403 | not_a_cable_key | line_attach with a key that is not registered as a cable |
initialize, tools/list and prompts/list work without a key. Every tools/call and prompts/get needs one.
#Short-lived tokens
Exchange a key for a signed token when you hand a REST credential to a process you trust less than your backend. The token is an EdDSA JWT and lives 600 seconds by default:
curl -sS -X POST https://api.mot3r.com/v1/token \
-H "Authorization: Bearer $MOT_KEY" \
-H "Content-Type: application/json" \
-d '{"ttl_s": 300}'The response holds token, token_type, expires_in, expires_at, scopes and kid. Verify tokens against the public keys at https://api.mot3r.com/.well-known/jwks.json. The REST API accepts the token the same way as a key, as Authorization: Bearer <token>. The MCP gateway accepts keys only.
#Rotate and revoke
Rotate a key in the panel. Rotation issues a new key of the same kind, scopes and limits, shows it once, and revokes the old key in the same step. A cable that rode on the old key moves to the new one, so the agent keeps its tunnel after you update MOT_KEY.
Revoke a key in the panel when an agent should lose access. A paid tools/call checks the key against the database on every call, so a revoked key stops working on the next call.
Note
Rotation and revocation need a signed-in panel session. A leaked key cannot rotate itself or issue new keys.
#The ledger
Every tunnel has a ledger: an append-only list of what happened on it and who did it. Read it with any key of the tunnel:
curl -sS "https://api.mot3r.com/v1/lines/me/ledger?limit=20" \
-H "Authorization: Bearer $MOT_KEY"Each item has id, at, actor_kind, actor_name, line_id, event, tool, ip and detail. The response adds next, the cursor for the next page, which you pass as ?before=.
The key never appears in the ledger. The actor is named by the cable label, by the MCP client name, or as key followed by the key prefix. A root key shows as master key and its prefix. Issuing a key writes a key.issue event with the key's kind, prefix and name. A tool call writes tool.call with status, reason, request_id and duration_ms. Calls refused with 429 are not written.
The whole account has a ledger too, at GET /v1/account/ledger, readable with the root key.