Skip to main content
Anam uses a two-tier authentication system: API keys for server-side requests and session tokens for client connections.

Tier 1: API Key

Your API key authenticates server-side requests to the Anam API.
Never expose your API key on the client side. It should only exist in your server environment.

Getting Your API Key

See the API key page for details on how to get your API key from the Anam Lab.

Tier 2: Session Tokens

Session tokens are temporary credentials (valid for 1 hour) that allow client applications to connect to Anam’s streaming infrastructure without exposing your API key.

How Session Tokens Work

1

Token Request

Your server requests a session token from Anam using your API key and persona configuration
2

Token Generation

Anam generates a temporary token tied to your specific persona configuration
3

Client Connection

Your client uses the session token with the Anam SDK to establish a direct WebRTC connection
4

Real-time Communication

Once connected, the client can send messages and receive video/audio streams directly

Creating Session Tokens

Below is a basic Express server that exposes an endpoint for creating session tokens.

Using the Session Token (Client-Side)

After your server creates a session token, your client fetches it and uses the Anam SDK to start streaming:

Dynamic Persona Configuration

Instead of using the same persona for all users, you can customize based on context:

User-based Personalization

Context-aware Sessions

Environment Setup

Store your API key securely:

Next Steps

Last modified on June 26, 2026