Skip to content

FAQ

Frequently asked questions about Lunar Stream integration.

General

What credentials do I need to get started?

You need two things from Lunar Stream admin:

  • API Key: ls_proj_v1_xxx... for authentication
  • Project ID: UUID for identifying your project

What is the API base URL?

https://api.lunarstream.kozow.com/api/v1

What authentication method should I use?

Use API Key authentication for all API calls. Include it in the ls-api-key header.

Streaming

How do I get the RTMP URL for broadcasting?

Create a livestream via API, then use the response:

RTMP Server: {rmtpServer}
Stream Key: {streamKeyWithParams}

Full URL: {rmtpServer}/{streamKeyWithParams}

How long does a push token last?

Default is 1 hour. You can specify custom duration (in seconds) when creating a stream or generating a new token:

json
{
  "expiresIn": 7200
}

Can I extend a push token?

No, but you can generate a new one using /livestream/generate-push-token.

What video formats are supported?

Input (RTMP):

  • Video: H.264
  • Audio: AAC
  • Container: FLV

Output (HLS):

  • Video: H.264
  • Audio: AAC
  • Container: MPEG-TS segments
SettingRecommended
Video CodecH.264
Video Bitrate2500-6000 Kbps
Audio CodecAAC
Audio Bitrate128-320 Kbps
Keyframe Interval2 seconds
Resolution1920x1080 or 1280x720
Frame Rate30 or 60 fps

Playback

How do I get the HLS URL for viewers?

From the livestream response, use hlsSources[0].url or any URL from hlsPaths.

Why are there multiple HLS URLs?

Lunar Stream provides multiple CDN endpoints for redundancy:

  • Origin server
  • BunnyCDN
  • Gcore CDN

Implement failover to switch CDNs if one fails.

Can viewers watch without authentication?

Yes, the public API /livestreams/stream-info/{streamKey} and HLS URLs don't require authentication.

API

What's the rate limit?

Endpoint TypeLimit
Livestream CRUD100 req/min
Public APIs1000 req/min

How do I handle pagination?

Use page and limit query parameters:

bash
GET /livestream?projectId=xxx&page=1&limit=10

Response includes pagination metadata:

json
{
  "meta": {
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 50,
      "totalPages": 5
    }
  }
}

Can I delete a livestream while it's live?

Yes, but the stream will be immediately terminated.

Security

Should I expose my API Key to the frontend?

No. API Key should only be used server-side. For client apps:

  1. Your backend calls Lunar Stream API
  2. Your backend returns only necessary data to frontend
  3. Frontend uses public APIs (no auth) for stream info

How do I secure my streams?

  1. Use push tokens for RTMP authentication
  2. Keep API Key server-side only
  3. Implement your own viewer authentication
  4. Use HTTPS for all communications

Released under the MIT License.