Agent quickstart

Get an agent connected in minutes

Two paths to agent access — pick the one that fits your setup, then use the runtime immediately.

Quickstart

Choose your path

Human-created tenant

Create a tenant, then mint agent access

  • 1. Sign up or log in and create a tenant from /account.
  • 2. In /account, create a direct agent key or a one-time enrollment token.
  • 3. Use the mtak_... key with X-Tenant-ID and X-Tenant-Token headers.

Agent-created tenant

Wallet challenge, session, then signup

  • 1. POST /v2/billing/agent/challenge with your wallet address.
  • 2. Sign the SIWE message, then POST /v2/billing/agent/session.
  • 3. POST /v2/agents/signup with Authorization: Bearer ags_... and your tenant ID.
  • 4. Use the returned agent key or keep the ags_... session for wallet-safe routes.

Full contract

Create, enroll, and optionally link a human

  • 1. GET /.well-known/motecloud-billing.json to discover prices and auth endpoints.
  • 2. POST /v2/billing/agent/challenge with your wallet address.
  • 3. Sign the returned SIWE-style message and POST /v2/billing/agent/session.
  • 4. For a brand new tenant, POST /v2/agents/signup with Authorization: Bearer ags_... and your desired tenant_id. The response returns a one-time tenant agent key. Existing tenants are rejected.
  • 5. If a human created the tenant first, have them mint a one-time enrollment token in /account, then POST /v2/agents/enroll with Authorization: Bearer ags_... and that enrollment token to receive an agent key.
  • 6. If an autonomous agent wants to add a human owner later, POST /v2/agents/owner-bootstrap with Authorization: Bearer ags_... and owner_email. That only works for the wallet that already controls the tenant.
  • 7. Use the returned mtak_... key with X-Tenant-ID and X-Tenant-Token, or keep using the short-lived ags_... session on the wallet-safe runtime routes.

Example

Signup, then query with the returned agent key

curl -sS /v2/billing/agent/challenge \
  -H 'content-type: application/json' \
  -d '{"wallet_address":"0xabc123abc123abc123abc123abc123abc123abc1"}'

# sign the returned message, then exchange it for a wallet session
curl -sS -X POST /v2/billing/agent/session \
  -H 'content-type: application/json' \
  -d '{"challenge_id":"agc_...","signature":"0x..."}'

curl -sS -X POST /v2/agents/signup \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer ags_...' \
  -d '{"tenant_id":"agent-alpha","owner_email":"[email protected]","metadata":{"label":"alpha"}}'

curl -sS -X POST /v2/query \
  -H 'content-type: application/json' \
  -H 'X-Tenant-ID: agent-alpha' \
  -H 'X-Tenant-Token: mtak_...' \
  -d '{"tenant_id":"agent-alpha","query_text":"what do I know so far?"}'

Unsupported routes

What still requires operator auth

  • Admin and observability routes remain JWT-admin only.
  • Tenant mutations outside the agent-safe subset still require operator-managed auth.
  • Swagger and OpenAPI are not part of the public production surface.