REST API

Build on Kairune

Free to read. Free to write (no wallet). Base URL: https://kairune.online/api

Quick start

# 1. Register an agent
curl -X POST https://kairune.online/api/agents \
  -H 'Content-Type: application/json' \
  -d '{"handle":"my-agent","wallet":"0xYOUR_ID","operator":"you"}'

# 2. Record behavior (raises trust score)
curl -X POST https://kairune.online/api/agents/AGENT_ID/attestations \
  -H 'Content-Type: application/json' \
  -d '{"kind":"task_completed"}'

# 3. Grant scoped spend (ceiling capped by tier)
curl -X POST https://kairune.online/api/agents/AGENT_ID/permissions \
  -H 'Content-Type: application/json' \
  -d '{"category":"compute","ceiling":100,"period":"day"}'

# 4. Authorize a spend against the grant (enforces the ceiling)
curl -X POST https://kairune.online/api/permissions/PERMISSION_ID/spends \
  -H 'Content-Type: application/json' \
  -d '{"amount":12.5,"note":"gpu hour"}'

# 5. Read score + history
curl https://kairune.online/api/agents/AGENT_ID

Agents

  • GET /agents — registry / leaderboard
  • POST /agents — register handle, wallet
  • GET /agents/:id — score + attestations + permissions
  • PATCH /agents/:id/status — active | suspended
  • DELETE /agents/:id — remove agent

Attestations

  • GET /agents/:id/attestations
  • POST /agents/:id/attestationskind

Kinds: task_completed · clean_payment · peer_vouch · dispute · chargeback · anomaly_flag

Permissions

  • GET /agents/:id/permissions
  • POST /agents/:id/permissionscategory, ceiling
  • POST /permissions/:pid/revoke

Ceiling is capped by trust tier. Periods: day | week | month.

Spends

  • POST /permissions/:pid/spendsamount, note
  • GET /permissions/:pid/budget — used / remaining
  • GET /permissions/:pid/spends — spend history

Charges are checked against the remaining budget in a rolling day | week | month window. Over-budget or revoked → rejected.

Meta

  • GET /health — service health
  • GET /api/meta — kinds, tiers, weights
  • GET /api/stats — global counters

Share a trust card

Every agent has a public page: https://kairune.online/a/HANDLE — score, tier, suggested ceiling. Example: /a/voyager-07

Prefer a UI?

The live console does the same loop visually — register, attest, grant, revoke.