openapi: 3.1.0
info:
title: Livepeer API Reference accessControl stream API
description: 'Welcome to the Livepeer API reference docs. Here you will find all the
endpoints exposed on the standard Livepeer API, learn how to use them and
what they return.
'
version: 1.0.0
servers:
- url: https://livepeer.studio/api
security:
- apiKey: []
tags:
- name: stream
description: Operations related to livestream api
paths:
/stream:
post:
operationId: createStream
x-speakeasy-name-override: create
tags:
- stream
summary: Create a stream
description: 'The only parameter you are required to set is the name of your stream,
but we also highly recommend that you define transcoding profiles
parameter that suits your specific broadcasting configuration.
\
\
If you do not define transcoding rendition profiles when creating the
stream, a default set of profiles will be used. These profiles include
240p, 360p, 480p and 720p.
\
\
The playback policy is set to public by default for new streams. It can
also be added upon the creation of a new stream by adding
`"playbackPolicy": {"type": "jwt"}`
'
requestBody:
required: true
content:
application/json:
schema:
type: object
$ref: '#/components/schemas/new-stream-payload'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'201':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/stream'
x-speakeasy-name-override: data
x-codeSamples:
- lang: typescript
label: createStream
source: "import { Livepeer } from \"livepeer\";\nimport { Profile, TranscodeProfileEncoder, TranscodeProfileProfile, Type } from \"livepeer/models/components\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.create({\n name: \"test_stream\",\n pull: {\n source: \"https://myservice.com/live/stream.flv\",\n headers: {\n \"Authorization\": \"Bearer 123\",\n },\n location: {\n lat: 39.739,\n lon: -104.988,\n },\n },\n playbackPolicy: {\n type: Type.Webhook,\n webhookId: \"1bde4o2i6xycudoy\",\n webhookContext: {\n \"streamerId\": \"my-custom-id\",\n },\n refreshInterval: 600,\n },\n profiles: [\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n fps: 30,\n fpsDen: 1,\n quality: 23,\n gop: \"2\",\n profile: Profile.H264Baseline,\n },\n ],\n record: false,\n recordingSpec: {\n profiles: [\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n quality: 23,\n fps: 30,\n fpsDen: 1,\n gop: \"2\",\n profile: TranscodeProfileProfile.H264Baseline,\n encoder: TranscodeProfileEncoder.H264,\n },\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n quality: 23,\n fps: 30,\n fpsDen: 1,\n gop: \"2\",\n profile: TranscodeProfileProfile.H264Baseline,\n encoder: TranscodeProfileEncoder.H264,\n },\n ],\n },\n multistream: {\n targets: [\n {\n profile: \"720p0\",\n videoOnly: false,\n id: \"PUSH123\",\n spec: {\n name: \"My target\",\n url: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n ],\n },\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: createStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Create(ctx, components.NewStreamPayload{\n Name: \"test_stream\",\n Pull: &components.Pull{\n Source: \"https://myservice.com/live/stream.flv\",\n Headers: map[string]string{\n \"Authorization\": \"Bearer 123\",\n },\n Location: &components.Location{\n Lat: 39.739,\n Lon: -104.988,\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 720,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n Record: livepeergo.Bool(false),\n RecordingSpec: &components.NewStreamPayloadRecordingSpec{\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Height: livepeergo.Int64(720),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n },\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}"
- lang: python
label: createStream
source: "from livepeer import Livepeer\nfrom livepeer.models import components\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.create(request={\n \"name\": \"test_stream\",\n \"pull\": {\n \"source\": \"https://myservice.com/live/stream.flv\",\n \"headers\": {\n \"Authorization\": \"Bearer 123\",\n },\n \"location\": {\n \"lat\": 39.739,\n \"lon\": -104.988,\n },\n },\n \"playback_policy\": {\n \"type\": components.Type.WEBHOOK,\n \"webhook_id\": \"1bde4o2i6xycudoy\",\n \"webhook_context\": {\n \"streamerId\": \"my-custom-id\",\n },\n \"refresh_interval\": 600,\n },\n \"profiles\": [\n {\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"bitrate\": 3000000,\n \"fps\": 30,\n \"fps_den\": 1,\n \"quality\": 23,\n \"gop\": \"2\",\n \"profile\": components.Profile.H264_BASELINE,\n },\n ],\n \"record\": False,\n \"recording_spec\": {\n \"profiles\": [\n {\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"bitrate\": 3000000,\n \"quality\": 23,\n \"fps\": 30,\n \"fps_den\": 1,\n \"gop\": \"2\",\n \"profile\": components.TranscodeProfileProfile.H264_BASELINE,\n \"encoder\": components.TranscodeProfileEncoder.H_264,\n },\n ],\n },\n \"multistream\": {\n \"targets\": [\n {\n \"profile\": \"720p\",\n \"video_only\": False,\n \"id\": \"PUSH123\",\n \"spec\": {\n \"name\": \"My target\",\n \"url\": \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n ],\n },\n})\n\nif res.stream is not None:\n # handle response\n pass"
get:
operationId: getStreams
x-speakeasy-name-override: getAll
summary: Retrieve streams
tags:
- stream
parameters:
- name: streamsonly
in: query
schema:
type: string
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'200':
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/stream'
x-speakeasy-name-override: data
x-codeSamples:
- lang: typescript
label: getStreams
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.getAll();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: getStreams
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.GetAll(ctx, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}"
- lang: python
label: getStreams
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.get_all()\n\nif res.data is not None:\n # handle response\n pass"
/stream/{id}:
parameters:
- name: id
description: ID of the stream
in: path
required: true
schema:
type: string
get:
operationId: getStream
x-speakeasy-name-override: get
tags:
- stream
summary: Retrieve a stream
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/stream'
x-speakeasy-name-override: data
x-codeSamples:
- lang: typescript
label: getStream
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.get(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: getStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Get(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}"
- lang: python
label: getStream
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.get(id=\"<id>\")\n\nif res.stream is not None:\n # handle response\n pass"
patch:
operationId: updateStream
x-speakeasy-name-override: update
summary: Update a stream
tags:
- stream
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/stream-patch-payload'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'204':
description: Success
x-codeSamples:
- lang: typescript
label: updateStream
source: "import { Livepeer } from \"livepeer\";\nimport { Profile, TranscodeProfileEncoder, TranscodeProfileProfile, Type } from \"livepeer/models/components\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.update({\n record: false,\n multistream: {\n targets: [\n {\n profile: \"720p0\",\n videoOnly: false,\n id: \"PUSH123\",\n spec: {\n name: \"My target\",\n url: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n ],\n },\n playbackPolicy: {\n type: Type.Webhook,\n webhookId: \"1bde4o2i6xycudoy\",\n webhookContext: {\n \"streamerId\": \"my-custom-id\",\n },\n refreshInterval: 600,\n },\n profiles: [\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n fps: 30,\n fpsDen: 1,\n quality: 23,\n gop: \"2\",\n profile: Profile.H264Baseline,\n },\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n fps: 30,\n fpsDen: 1,\n quality: 23,\n gop: \"2\",\n profile: Profile.H264Baseline,\n },\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n fps: 30,\n fpsDen: 1,\n quality: 23,\n gop: \"2\",\n profile: Profile.H264Baseline,\n },\n ],\n recordingSpec: {\n profiles: [\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n quality: 23,\n fps: 30,\n fpsDen: 1,\n gop: \"2\",\n profile: TranscodeProfileProfile.H264Baseline,\n encoder: TranscodeProfileEncoder.H264,\n },\n {\n width: 1280,\n name: \"720p\",\n height: 720,\n bitrate: 3000000,\n quality: 23,\n fps: 30,\n fpsDen: 1,\n gop: \"2\",\n profile: TranscodeProfileProfile.H264Baseline,\n encoder: TranscodeProfileEncoder.H264,\n },\n ],\n },\n name: \"test_stream\",\n }, \"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: updateStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Update(ctx, \"<id>\", components.StreamPatchPayload{\n Record: livepeergo.Bool(false),\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 720,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n RecordingSpec: &components.RecordingSpec{\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Height: livepeergo.Int64(720),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- lang: python
label: updateStream
source: "from livepeer import Livepeer\nfrom livepeer.models import components\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.update(id=\"<id>\", stream_patch_payload={\n \"record\": False,\n \"multistream\": {\n \"targets\": [\n {\n \"profile\": \"720p\",\n \"video_only\": False,\n \"id\": \"PUSH123\",\n \"spec\": {\n \"name\": \"My target\",\n \"url\": \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n ],\n },\n \"playback_policy\": {\n \"type\": components.Type.WEBHOOK,\n \"webhook_id\": \"1bde4o2i6xycudoy\",\n \"webhook_context\": {\n \"streamerId\": \"my-custom-id\",\n },\n \"refresh_interval\": 600,\n },\n \"profiles\": [\n {\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"bitrate\": 3000000,\n \"fps\": 30,\n \"fps_den\": 1,\n \"quality\": 23,\n \"gop\": \"2\",\n \"profile\": components.Profile.H264_BASELINE,\n },\n ],\n \"recording_spec\": {\n \"profiles\": [\n {\n \"width\": 1280,\n \"name\": \"720p\",\n \"height\": 720,\n \"bitrate\": 3000000,\n \"quality\": 23,\n \"fps\": 30,\n \"fps_den\": 1,\n \"gop\": \"2\",\n \"profile\": components.TranscodeProfileProfile.H264_BASELINE,\n \"encoder\": components.TranscodeProfileEncoder.H_264,\n },\n ],\n },\n})\n\nif res is not None:\n # handle response\n pass"
delete:
operationId: deleteStream
x-speakeasy-name-override: delete
summary: Delete a stream
tags:
- stream
description: 'This will also suspend any active stream sessions, so make sure to wait
until the stream has finished. To explicitly interrupt an active
session, consider instead updating the suspended field in the stream
using the PATCH stream API.
'
parameters:
- in: path
name: id
schema:
type: string
description: ID of the stream
required: true
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'204':
description: Success (No content)
x-codeSamples:
- lang: typescript
label: deleteStream
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.delete(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: deleteStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Delete(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- lang: python
label: deleteStream
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.delete(id=\"<id>\")\n\nif res is not None:\n # handle response\n pass"
/stream/{id}/terminate:
parameters:
- name: id
description: ID of the stream
in: path
required: true
schema:
type: string
delete:
operationId: terminateStream
x-speakeasy-name-override: terminate
tags:
- stream
summary: Terminates a live stream
description: '`DELETE /stream/{id}/terminate` can be used to terminate an ongoing
session on a live stream. Unlike suspending the stream, it allows the
streamer to restart streaming even immediately, but it will force
terminate the current session and stop the recording.
\
\
A 204 No Content status response indicates the stream was successfully
terminated.
'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'204':
description: Success
x-codeSamples:
- lang: typescript
label: terminateStream
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.terminate(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: terminateStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Terminate(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- lang: python
label: terminateStream
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.terminate(id=\"<id>\")\n\nif res is not None:\n # handle response\n pass"
/stream/{id}/start-pull:
parameters:
- name: id
description: ID of the stream
in: path
required: true
schema:
type: string
post:
operationId: startPullStream
x-speakeasy-name-override: startPull
summary: Start ingest for a pull stream
tags:
- stream
description: '`POST /stream/{id}/start-pull` can be used to start ingest for a stream
configured with a pull source. If the stream has recording configured,
it will also start recording.
\
\
A 204 No Content status response indicates the stream was successfully
started.
'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'204':
description: Success
x-codeSamples:
- lang: typescript
label: startPullStream
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.startPull(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: startPullStream
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.StartPull(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- lang: python
label: startPullStream
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.start_pull(id=\"<id>\")\n\nif res is not None:\n # handle response\n pass"
/clip:
post:
operationId: createClip
x-speakeasy-name-override: createClip
summary: Create a clip
tags:
- stream
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/clip-payload'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'200':
description: Success
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- asset
- task
properties:
asset:
$ref: '#/components/schemas/asset'
task:
type: object
properties:
id:
type: string
example: 34d7618e-fd42-4798-acf5-19504616a11e
x-speakeasy-name-override: data
x-codeSamples:
- lang: typescript
label: createClip
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.createClip({\n playbackId: \"eaw4nk06ts2d0mzb\",\n startTime: 1587667174725,\n endTime: 1587667174725,\n name: \"My Clip\",\n sessionId: \"de7818e7-610a-4057-8f6f-b785dc1e6f88\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: createClip
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.CreateClip(ctx, components.ClipPayload{\n PlaybackID: \"eaw4nk06ts2d0mzb\",\n StartTime: 1587667174725,\n EndTime: livepeergo.Float64(1587667174725),\n Name: livepeergo.String(\"My Clip\"),\n SessionID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}"
- lang: python
label: createClip
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.create_clip(request={\n \"playback_id\": \"eaw4nk06ts2d0mzb\",\n \"start_time\": 1587667174725,\n \"end_time\": 1587667174725,\n \"name\": \"My Clip\",\n \"session_id\": \"de7818e7-610a-4057-8f6f-b785dc1e6f88\",\n})\n\nif res.data is not None:\n # handle response\n pass"
/stream/{id}/clips:
get:
operationId: getClips
x-speakeasy-name-override: getClips
tags:
- stream
summary: Retrieve clips of a livestream
parameters:
- in: path
name: id
schema:
type: string
description: ID of the parent stream or playbackId of parent stream
required: true
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'200':
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/asset'
x-speakeasy-name-override: data
x-codeSamples:
- lang: typescript
label: getClips
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.getClips(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- lang: go
label: getClips
source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"<YOUR_BEARER_TOKEN_HERE>\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.GetClips(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}"
- lang: python
label: getClips
source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"<YOUR_BEARER_TOKEN_HERE>\",\n)\n\nres = s.stream.get_clips(id=\"<id>\")\n\nif res.data is not None:\n # handle response\n pass"
/stream/{id}/create-multistream-target:
post:
operationId: addMultistreamTarget
x-speakeasy-name-override: addMultistreamTarget
summary: Add a multistream target
tags:
- stream
parameters:
- in: path
name: id
schema:
type: string
description: ID of the parent stream
required: true
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/target-add-payload'
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'204':
description: Success (No content)
x-codeSamples:
- lang: typescript
label: addMultistreamTarget
source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"<YOUR_BEARER_TOKEN_HERE>\",\n});\n\nasync function run() {\n const result = await livepeer.stream.addMultistreamTarget({\n profile: \"720p0\",\n videoOnly: false,\n id: \"PUSH123\",\n spec: {\n name: \"My target\",\n url: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n }, \"<id>\");\n\n // Handle the result
# --- truncated at 32 KB (67 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/livepeer/refs/heads/main/openapi/livepeer-stream-api-openapi.yml