> ## Documentation Index
> Fetch the complete documentation index at: https://lingopal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart Guide

This guide will help you get started with the Lingopal Stream on Demand API. It covers authentication and the most common API operations with example cURL commands.

## 1. Authentication

All endpoints require an API key. Include your API key in the `x-api-key` header:

```http theme={null}
x-api-key: YOUR_API_KEY
```

## 2. Select Your API Endpoint

You can use either of the following base URLs:

```
Staging URL: https://streaming.lingopal-dev.com    
Production URL: https://streaming.lingopal.ai
```

> **Note:** When viewing an endpoint in the documentation UI, you will also have the option to select the base URL from a dropdown.

***

## 3. Launch a Stream

You can launch three types of streams: **SRT**, **RTMP**, and **HLS**. Each type has different required parameters and options.

### SRT Stream

**What it does:** Starts a new SRT live stream with the provided parameters.

**Required parameters:**

* Ingest URL (the URL where the original stream is coming from)
* Source Language
* Destination Language

**Optional parameters:**

* Vocals Track (default: 0)
* Background Track (default: 0)
* Add Prompt (description of the stream)
* Enable CEA-608 Captions
* Enable CEA-708 Captions
* Enable Voice Cloning
* Enable Lip Sync

**Expected result:** Returns a stream identifier or confirmation that the SRT stream has started.

```bash theme={null}
curl -X POST "BASE_URL/v1/streams/start" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ingest_url": "your-ingest-url",
    "src_language": "en",
    "dst_language": ["es"],
    "vocals_track": "0",
    "background_track": 0,
    "enable_captions_608": false,
    "enable_captions_708": false,
    "use_contextual_translation": false,
    "LIPSYNC": true,
    "channel_uuid": "your-channel-uuid",
    "is_hls_stream": false
  }'
```

***

### RTMP Stream

**What it does:** Starts a new RTMP live stream. RTMP streaming requires a two-step process.

#### Step 1: Create RTMP Channel

First, use the Create RTMP Channel endpoint to obtain the `channel_id` and `rtmp_url`.

```bash theme={null}
curl -X POST "BASE_URL/v1/rtmp_channel" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "output_rtmp_url": "rtmp://your-rtmp-server/live",
    "output_stream_key": "your-stream-key"
  }'
```

**Expected result:** Returns a `channel_id` and `rtmp_url`.

#### Step 2: Launch the Stream

After configuring your streaming software, use the Launch Stream endpoint. Set `ingest_url` to an empty string and provide the `channel_id` you received from the previous step.

**Required parameters:**

* ingest\_url: (not required for RTMP, leave empty)
* channel\_uuid: (the channel\_id returned from Step 1)
* src\_language: Source Language
* dst\_language: Destination Language

**Special notes:**

* For RTMP streams, **Voice Cloning** and **Lip Sync** are always enabled (true).

**Expected result:** Returns a stream identifier or confirmation that the RTMP stream has started.

```bash theme={null}
curl -X POST "BASE_URL/v1/streams/start" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ingest_url": "",
    "channel_uuid": "your-channel-id",
    "src_language": "en",
    "dst_language": ["es"],
    "LIPSYNC": true,
    "voice_cloning": true,
    "is_hls_stream": false
  }'
```

***

### HLS Stream

**What it does:** Starts a new HLS live stream using an HLS stream URL.

**Required parameters:**

* HLS Stream URL
* Source Language
* Destination Language

**Optional parameters:**

* Add Prompt

**Special notes:**

* For HLS streams, **Lip Sync** and **Voice Cloning** are enabled by default.

**Expected result:** Returns a stream identifier or confirmation that the HLS stream has started.

```bash theme={null}
curl -X POST "BASE_URL/v1/streams/start" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ingest_url": "https://example.com/stream.m3u8",
    "src_language": "en",
    "dst_language": ["es"],
    "LIPSYNC": true,
    "voice_cloning": true,
    "is_hls_stream": true
  }'
```

***

## 4. List Streams

**What it does:** Retrieves a paginated list of all streams, optionally filtered by state.

**Expected result:** Returns a list of stream objects or identifiers, including their current state and metadata.

```bash theme={null}
curl -X GET "BASE_URL/v1/streams?page=1&page_size=10" \
  -H "x-api-key: YOUR_API_KEY"
```

***

## 5. Get Stream Info

**What it does:** Fetches detailed information about a specific stream using its stream ID.

**Expected result:** Returns metadata and status information for the specified stream.

```bash theme={null}
curl -X GET "BASE_URL/v1/streams/your-stream-id" \
  -H "x-api-key: YOUR_API_KEY"
```

***

## 6. Stop a Stream

**What it does:** Stops a running stream by its stream ID.

**Expected result:** Returns confirmation that the stream has been stopped.

```bash theme={null}
curl -X POST "BASE_URL/v1/streams/your-stream-id/stop" \
  -H "x-api-key: YOUR_API_KEY"
```

***

## 7. Schedule a Stream

**What it does:** Schedules a stream to start at a specific time with the provided parameters.

**Expected result:** Returns a confirmation or identifier for the scheduled stream.

```bash theme={null}
curl -X POST "BASE_URL/v1/scheduled_streams" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "ingest_url": "rtmp://example.com/live",
    "vocals_track": "0",
    "background_track": 0,
    "mix": "-9,-6",
    "enable_captions_708": false,
    "enable_captions_608": false,
    "dst_language": ["en"],
    "src_language": "en",
    "start_wowza": false,
    "use_contextual_translation": false,
    "lipsync": true,
    "channel_uuid": "your-channel-uuid",
    "is_hls_stream": false,
    "scheduled_time": "2025-08-25 23:15:00",
    "timezone": "America/New_York"
  }'
```

***

## 8. Get Transcripts for a Stream

**What it does:** Retrieves paginated transcripts (captions) for a given stream.

**Expected result:** Returns a list of transcript segments, including timestamps and speaker information.

```bash theme={null}
curl -X GET "BASE_URL/v1/transcripts/your-stream-id?page=1&per_page=50&order=desc" \
  -H "x-api-key: YOUR_API_KEY"
```

***

## 9. Update a Transcript Segment

**What it does:** Updates the text content of a specific transcript segment for a stream.

**Expected result:** Returns the updated transcript segment object with the new content.

```bash theme={null}
curl -X PUT "BASE_URL/v1/transcripts/your-stream-id/segment-id" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Updated transcript text."
  }'
```

***

## 10. Use RTMP Channel Endpoints

### Create RTMP Channel

**What it does:** Creates a new RTMP channel for streaming.

**Expected result:** Returns details or confirmation of the created RTMP channel.

```bash theme={null}
curl -X POST "BASE_URL/v1/rtmp_channel" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "output_rtmp_url": "rtmp://example.com/live",
    "output_stream_key": "your-stream-key"
  }'
```

### Get RTMP Channel Info

**What it does:** Retrieves information about a specific RTMP channel by its channel ID.

**Expected result:** Returns metadata and status for the specified RTMP channel.

```bash theme={null}
curl -X GET "BASE_URL/v1/rtmp_channel/your-channel-id" \
  -H "x-api-key: YOUR_API_KEY"
```

***

For more details and advanced usage, see the individual endpoint documentation in the sidebar.
