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

# Create a livestream

> Create a livestream with the Livepeer Studio API and get a stream key and playback ID.

Create a stream via the API or SDK to get a **stream key** (for broadcasters) and a **playback ID** (for viewers). The example below uses the [Create Stream API](https://livepeer.studio/docs/api-reference/stream/create).

## Create a stream with the SDK

> [tab] Node.js
>
> ```javascript icon="terminal" theme={null}
> import { Livepeer } from "livepeer";
>
> const livepeer = new Livepeer({ apiKey: process.env.LIVEPEER_API_KEY });
>
> const { data } = await livepeer.stream.create({
>   name: "my-stream",
> });
>
> console.log("Stream key:", data.streamKey);
> console.log("Playback ID:", data.playbackId);
> ```

> [tab] Python
>
> ```python icon="terminal" theme={null}
> from livepeer import Livepeer
>
> livepeer = Livepeer(api_key=os.environ["LIVEPEER_API_KEY"])
> response = livepeer.stream.create({"name": "my-stream"})
>
> if response.stream:
>     print("Stream key:", response.stream.stream_key)
>     print("Playback ID:", response.stream.playback_id)
> ```

> [tab] Go
>
> ```go icon="terminal" theme={null}
> package main
>
> import (
>     "github.com/livepeer/livepeer-go"
>     "context"
> )
>
> func main() {
>     client := livepeer.New(livepeer.WithAPIKey(os.Getenv("LIVEPEER_API_KEY")))
>     ctx := context.Background()
>     res, err := client.Stream.Create(ctx, livepeer.StreamCreationPayload{
>         Name: livepeer.String("my-stream"),
>     })
>     if err != nil {
>         log.Fatal(err)
>     }
>     if res.Stream != nil {
>         fmt.Println("Stream key:", *res.Stream.StreamKey)
>         fmt.Println("Playback ID:", *res.Stream.PlaybackId)
>     }
> }
> ```

## Use the stream key and playback ID

* **Stream key** - Give this to the broadcaster. They enter it in OBS (or another encoder) or use it for [in-browser WebRTC broadcast](/v2/solutions/livepeer-studio/docs/livestream/livestream-from-browser.md). Keep the stream key secret; anyone with it can push video to the stream.
* **Playback ID** - Use this in your app to play the stream (e.g. with the [Livepeer Player](/v2/solutions/livepeer-studio/docs/player.md) or the [Playback Info API](https://livepeer.studio/docs/api-reference/playback/get)). You can expose the playback ID to viewers.

## Next steps

* [Play a livestream](/v2/solutions/livepeer-studio/docs/livestream/playback-livestream.md) - Play the stream in your app.
* [Stream via OBS](/v2/solutions/livepeer-studio/docs/livestream/stream-via-obs.md) - Configure OBS with the stream key.
* [Livestream from browser](/v2/solutions/livepeer-studio/docs/livestream/livestream-from-browser.md) - Broadcast with WebRTC from the browser.
* [Multistream](/v2/solutions/livepeer-studio/docs/livestream/multistream.md) - Send the stream to multiple destinations.


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