Overview
LiveKit tokens provide secure, time-limited access to livestream rooms. The Pump.fun API provides separate endpoints for generating host tokens (with broadcasting permissions) and participant tokens (view-only access).Get Host Token
Generate a LiveKit access token for the stream host with full broadcasting capabilities.Endpoint
Query Parameters
The token mint address for the livestream
The wallet address of the stream creator/host
Example Request
Response
Returns a LiveKit access token that can be used to connect to the stream as a host with broadcasting permissions.Host tokens grant full permissions including video/audio publishing, screen sharing, and room management.
Get Participant Token
Generate a LiveKit access token for stream participants/viewers.Endpoint
Query Parameters
The token mint address for the livestream
Whether the participant should be hidden from the participant list. Set to
true for anonymous viewing or false for visible participants.Example Request
Response
Returns a LiveKit access token that can be used to connect to the stream as a participant with view-only permissions.Participant tokens provide view-only access by default. Users can watch the stream and participate in chat but cannot broadcast audio/video.
Authentication
Both endpoints require JWT authentication via theAuthorization: Bearer <token> header.
Token Security
Best Practices
- Generate tokens on-demand: Request new tokens when users join rather than pre-generating them
- Use appropriate permissions: Use host tokens only for authorized broadcasters
- Implement token refresh: Handle token expiration by requesting new tokens when needed
- Secure transmission: Always use HTTPS when transmitting tokens
Token Types Comparison
| Feature | Host Token | Participant Token |
|---|---|---|
| Video Publishing | Yes | No |
| Audio Publishing | Yes | No |
| Screen Sharing | Yes | No |
| View Stream | Yes | Yes |
| Chat Access | Yes | Yes |
| Visibility Control | Always visible | Configurable via hidden parameter |
Common Use Cases
Token Launch Stream
- Creator obtains a host token to broadcast their token launch
- Viewers obtain participant tokens to watch and engage
- Use
hidden=truefor anonymous viewer counts - Use
hidden=falsefor visible community members
Interactive Sessions
- Primary host uses host token for main broadcast
- Featured guests can be promoted with appropriate permissions
- Audience uses participant tokens for viewing
Response Codes
- 200 OK: Token generated successfully
- 401 Unauthorized: Invalid or missing authentication token
- 404 Not Found: Livestream with specified mint address not found
- 400 Bad Request: Invalid query parameters
Related Endpoints
Create Livestream
Create a new livestream before generating tokens
Manage Stream
Control stream availability and access