> ## Documentation Index
> Fetch the complete documentation index at: https://docs.livepeer.org/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) 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).

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    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>

  <Tab title="Python">
    ```python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    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>

  <Tab title="Go">
    ```go theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    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)
    }
    ```
  </Tab>
</Tabs>

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

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).

<Info>
  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).
</Info>

### Play a Stream

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