Developer quickstart

Call the aphanite API

Create an API key in the aphanite app, export it, and make your first request. The API resolves public directory data and routes already-sealed envelopes — it never sees message plaintext.

Base URL: https://api.aphanite.io. Same host serves these docs and the live /api/v1/* endpoints.
01

Create and export an API key

In the aphanite app, open Settings → API Settings, unlock Developer API access, then create a key. The secret is shown once — store it safely.

Export it in your shell:

bash
export APHANITE_API_KEY="sk_live_…"
02

Verify the key, then resolve a recipient

GET /api/v1/me confirms your Bearer header works. Then look up a public @handle and fetch the device keys you encrypt to.

bash
curl https://api.aphanite.io/api/v1/me \
  -H "Authorization: Bearer $APHANITE_API_KEY"

curl https://api.aphanite.io/api/v1/handles/alice \
  -H "Authorization: Bearer $APHANITE_API_KEY"

curl https://api.aphanite.io/api/v1/keys/0xabc… \
  -H "Authorization: Bearer $APHANITE_API_KEY"
03

Try it in the browser

Paste a key and call the live API on this origin. Keys stay in sessionStorage only.

Try it — resolve a handle

GET /api/v1/handles/:handle
04

Submit a sealed envelope

Seal ciphertext on your device (X25519 + AES-256-GCM), then POST the opaque fields. See Envelopes for the full schema and batching.

bash
curl https://api.aphanite.io/api/v1/envelopes \
  -H "Authorization: Bearer $APHANITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toAddress": "0x…",
    "ciphertext": "…",
    "ephemeralPublicKey": "…",
    "nonce": "…",
    "asRequest": true
  }'
There is no SDK yet. Use HTTPS + Bearer auth. Never log API secrets or attempt to POST plaintext message bodies — the server will only accept sealed envelope fields.