Skip to main content
Ed25519 session tokens are the production standard for AI agents. The agent’s private key never leaves its process — instead, it signs a server-issued nonce to prove ownership, and receives a short-lived sess_* token that works everywhere.

Why Ed25519 sessions

Flow

1. Provision a key pair

When you create the agent, set generate_keypair: true and Sly will return the private key once:
Response:
Save the private key immediately. Sly never stores it — we only keep the public key to verify signatures. If lost, you must rotate the key via the emergency API-key-authenticated path.
Or provision a key later on an existing agent:

2. Request a challenge

This endpoint is public — no auth required. The agent calls it when it needs to authenticate.
Challenges are single-use and expire in 60 seconds.

3. Sign the challenge

4. Authenticate

Also public — the signature proves you hold the private key.
Use the session token exactly like any other bearer token:
The sess_* token works on every authenticated endpoint — transfers, streams, A2A, x402, AP2, everything.

5. Rotate a key

Agents can self-rotate without needing an API key holder. Sign the message rotate:<agentId> with the current private key:
Atomic effect:
  1. Old key marked rotated
  2. All active sessions under the old key are revoked
  3. New Ed25519 key pair generated
  4. New private key returned (shown once)

6. Revoke a key (kill-switch)

Instantly revokes the auth key and all active sessions. The agent cannot authenticate until a new key is provisioned. Unlike freezing a wallet (which blocks spending but leaves auth working), key revocation blocks all API access.

Persistent SSE connection

Once authenticated with sess_*, the agent can open a push channel for real-time events:
Events pushed to the agent:
  • task_assigned — new A2A task
  • transfer_completed — transfer finalized
  • approval_requested — spending requires manager approval
  • stream_alert — managed stream needs attention
  • key_rotated — auth key was rotated, session about to revoke
  • heartbeat — 30-second keepalive
Supports Last-Event-ID for reconnect — missed events are replayed from a 100-event / 5-minute buffer. See persistent SSE for details.

Complete example (Node.js)

The SDK wraps this into one call:

Endpoint reference