Overview

Optional “Save to my Allternit account” stores a user’s own OpenAI or ElevenLabs key, encrypted, so their other signed-in devices can use it. The same routes relay the device-to-device QR handoff. The key is end-to-end encrypted between the two devices. It reaches the server only in that sealed form, and the server cannot read it. For the user flow see Talk to your bots. For storage and protocol details see Voice in the app.

Base URL

Authentication

Signed-in session only. Platform API keys are refused with 403. Responses carry Cache-Control: no-store.

Endpoints

Sealed relay

After the user confirms the 6-digit codes, the sender encrypts the key and PUTs it to /sealed. The receiver polls GET /sealed and takes it once.
  • nonce is exactly 16 base64url characters. ciphertext is 23 to 2048 base64url characters. Both must be unpadded base64url that decodes; anything else is 400 with a fixed message that never repeats the body.
  • GET /sealed returns 204 with an empty body while the sender hasn’t sealed yet.
  • The take is one-time. A single statement reads the row and marks it delivered, so a second GET returns 409 and never the key again.
  • A successful PUT extends expires_at to at least 30 seconds from now, so the receiver has time to fetch.
  • Responses carry Cache-Control: no-store.
  • The sender’s public key is never sent to the server; it travels only in QR1. The server holds the ciphertext but cannot derive the shared key, and the 6-digit check is what stops a relay from substituting its own key.
Keys are sealed with AES-256-GCM using ALLTERNIT_CREDENTIALS_KEY (migration 128_voice_keys.sql, table user_voice_keys). Handoff rows live in voice_key_handoffs; migration 135_voice_handoff_sealed.sql adds sealed_nonce, sealed_ciphertext and delivered_at.