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

# Create a livestream

> Learn how to create a livestream

Creating and watching a livestream is easy! The example below uses
[Create Stream API](/api-reference/stream/create.md) to create and watch a
livestream.

### Stream Creation

We can use the Livepeer SDK to create a stream. The example below uses the
[Create Stream API](/api-reference/stream/create.md).

> [tab] Node.js
>
> ```javascript theme={null}
> import { Livepeer } from "livepeer";
>
> const apiKey = 'YOUR_API_KEY';
>
> const livepeer = new Livepeer({apiKey});
>
> const streamData = {
>   name: "test_stream"
> };
>
> livepeer
>   .stream.create(streamData)
>   .then((response) => {
>     console.log("Stream created:", response);
>   })
>   .catch((error) => {
>     console.error("Error creating stream:", error);
>   });
> ```

> [tab] Python
>
> ```python theme={null}
> from livepeer import Livepeer
>
> # Initialize the Livepeer client with your API key
> api_key = "YOUR_API_KEY"
> livepeer = Livepeer(api_key)
>
> stream_data = {
>   "name": "test_stream"
> }
>
> try:
>     # Create the stream
>     response = livepeer.stream.create(stream_data)
>     print("Stream created:", response)
> except Exception as e:
>     print("Error creating stream:", e)
> ```

> [tab] Go
>
> ```go theme={null}
> package main
>
> import (
>   "fmt"
>   "os"
>
>   "github.com/livepeer/livepeer-go"
> )
>
> func main() {
>   // Initialize the Livepeer client with your API key
>   apiKey := "YOUR_API_KEY"
>   client := livepeer.NewLivepeerClient(apiKey)
>
>   streamData := map[string]interface{}{
>     "name": "test_stream",
>   }
>
>   // Create the stream
>   response, err := client.Stream.Create(streamData)
>   if err != nil {
>     fmt.Printf("Error creating stream: %v\n", err)
>     os.Exit(1)
>   }
>
>   fmt.Printf("Stream created: %+v\n", response)
> }
> ```

You can find all the information required to broadcast to the stream in the
[response object](/api-reference/stream/overview.md).

The RTMP ingest URL of Livepeer Studio is `rtmp://rtmp.livepeer.com/live`, and
the `streamKey` is present in the response object. You can use these two values
to broadcast to the stream.

You can also use WebRTC WHIP to broadcast, using the URL
`https://playback.livepeer.studio/webrtc/{streamKey}`. This is used for
[in-browser broadcasting](/developers/guides/livestream-from-browser.md).

> [!NOTE]
>
> To learn more about other stream functions such as stopping a stream,
> recording a stream, and more, see the [Stream
> API](/api-reference/stream/overview.md).

### Play a Stream

To learn how to play a stream, see the
[Play a Livestream](/developers/guides/playback-a-livestream.md) guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.