Skip to content
Panel

API Reference Endpoints

Keys and tokens

List the keys of an account, mint tunnel keys, and exchange a key for a short-lived signed token.

Keys authenticate every call to the API and the MCP gateway. Keys are created, rotated and revoked in the panel at mot3r.com/panel; the endpoints below list them, mint a tunnel key for a cable, and exchange a key for a short-lived EdDSA token that any service can verify against the public key set. Listing and minting need the account root key; a token can be issued from the root key or a tunnel key. Key kinds and the Bearer header are described in Authentication.

#List keys

GET /v1/keys

Returns every key of the account, newest first, revoked keys last. The key itself never comes back, only its prefix.

Authentication: root key only. A tunnel, test, observation or account agent key gets 403 key_kind_not_allowed.

Parameters

This endpoint takes no parameters.

Request

bash
curl -sS https://api.mot3r.com/v1/keys \
  -H "Authorization: Bearer $MOT_ROOT_KEY"

Response 200

JSON
{
  "rows": [
    {
      "id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
      "name": "line key a1b2c3",
      "prefix": "mot_lk_live_a1b2c3",
      "kind": "line",
      "line": "support",
      "line_id": "7c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "scopes": ["mcp", "billing:r", "events:r"],
      "spend_cap_daily_micros": null,
      "rpm_limit": null,
      "created_at": "2026-10-14T09:12:03.411Z",
      "last_used_at": "2026-10-16T08:40:51.002Z",
      "last_client": "claude-code",
      "last_country": "DE",
      "expires_at": null,
      "revoked_at": null,
      "spend_30d_micros": 1840000,
      "calls_today": null
    }
  ],
  "test_calls_limit": 300,
  "measured_at": "2026-10-16T15:40:00.000Z"
}
NameTypeDescription
prefixstringFirst characters of the key, enough to recognise it.
kindstringroot, line, test, observe or agent_account.
linestring or nullHandle of the tunnel the key is bound to.
scopesstring[]Scopes granted to the key.
spend_cap_daily_microsinteger or nullDaily spend cap of the key in micro-USD.
rpm_limitinteger or nullRequests per minute allowed for the key.
spend_30d_microsintegerSpend charged to the key over the last 30 days, in micro-USD.
calls_todayinteger or nullCalls made today. Set for test keys only.
test_calls_limitintegerDaily call limit that applies to test keys.

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."}}

#Mint a tunnel key

POST /v1/lines/:id/keys

Creates a new tunnel key for a cable on the given tunnel. The full key is returned once, in key; store it immediately. The key is generated by the server; sending key_hash or prefix in the body is rejected.

Authentication: root key with the keys:rw scope.

Parameters

NameInTypeRequiredDescription
idpathuuidyesThe tunnel that the key is bound to. The tunnel must be active.
namebodystringnoUp to 80 characters. Unique among the active tunnel keys of this tunnel. Defaults to line key <last 6 characters of the prefix>.
scopesbodystring[]noScopes for the key. Defaults to ["mcp", "billing:r", "events:r"].
reasonbodystringnoUp to 200 characters, recorded in the account audit log.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/lines/3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d/keys \
  -H "Authorization: Bearer $MOT_ROOT_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"laptop cable","reason":"new cable on the laptop"}'

Response 200

JSON
{
  "replay": false,
  "key_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "line_id": "3f2b8c1e-7a4d-4e5b-9c6f-1d2e3a4b5c6d",
  "kind": "line",
  "name": "laptop cable",
  "prefix": "mot_lk_live_a1b2c3",
  "scopes": ["mcp", "billing:r", "events:r"],
  "key": "mot_lk_live_xxxxxxxxxxxx",
  "warning": "The key is shown only once. Save it now.",
  "measured_at": "2026-10-16T15:40:00.000Z"
}

Error 409

JSON
{"error":{"status":409,"reason":"key_name_taken","message":"Key name taken.","name":"laptop cable"}}

#Issue a token

POST /v1/token

Exchanges a key for a signed JWT (EdDSA, Ed25519) that lives at most 600 seconds. The token is accepted as a Bearer credential in place of the key until it expires or the key is revoked. A token cannot issue another token.

Authentication: root key or tunnel key. Test and observation keys get 403 key_kind_cannot_issue_tokens.

Parameters

NameInTypeRequiredDescription
scopesbodystring[]noScopes for the token. Must be a subset of the key's scopes. Defaults to all scopes of the key.
ttl_sbodyintegernoLifetime in seconds, 1 to 600. Defaults to 600.

Request

bash
curl -sS -X POST https://api.mot3r.com/v1/token \
  -H "Authorization: Bearer mot_lk_live_xxxxxxxxxxxx" \
  -H "content-type: application/json" \
  -d '{"scopes":["mcp"],"ttl_s":300}'

Response 200

JSON
{
  "token": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.xxxxxxxxxxxx.xxxxxxxxxxxx",
  "token_type": "Bearer",
  "expires_in": 300,
  "expires_at": "2026-10-16T15:45:00.000Z",
  "scopes": ["mcp"],
  "kid": "k1-20260929",
  "measured_at": "2026-10-16T15:40:00.000Z"
}

The token header carries alg: EdDSA and the kid of the signing key. The payload carries acc (account id), key (id of the issuing key), line (tunnel id, or null for the root key), scp (scopes), gen (key generation), jti, iat and exp.

Error 403

JSON
{"error":{"status":403,"reason":"scope_not_subset","message":"A token can only carry scopes that its key has."}}

#Get the token signing keys

GET /.well-known/jwks.json

Returns the public keys that sign tokens, as a JSON Web Key Set. Match the token's kid header against kid here to verify the signature. During a key rotation the set holds more than one key.

Authentication: none.

Parameters

This endpoint takes no parameters.

Request

bash
curl -sS https://api.mot3r.com/.well-known/jwks.json

Response 200

JSON
{
  "keys": [
    {
      "crv": "Ed25519",
      "x": "5QiIblFnmira90IrwqNNycwHcS_A32W7V-2r2N6OG-s",
      "kty": "OKP",
      "kid": "k1-20260929",
      "alg": "EdDSA",
      "use": "sig"
    }
  ],
  "measured_at": "2026-10-16T15:38:59.576Z"
}