openapi: 3.1.0 info: title: Livepeer AI Runner accessControl stream API description: An application to run AI pipelines version: 0.0.0 servers: - url: https://dream-gateway.livepeer.cloud description: Livepeer Cloud Community Gateway - url: https://livepeer.studio/api/beta/generate description: Livepeer Studio Gateway 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: \"\",\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(\"\"),\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=\"\",\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: \"\",\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(\"\"),\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=\"\",\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: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.get(\"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Get(ctx, \"\")\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=\"\",\n)\n\nres = s.stream.get(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: \"\",\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 }, \"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Update(ctx, \"\", 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=\"\",\n)\n\nres = s.stream.update(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: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.delete(\"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Delete(ctx, \"\")\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=\"\",\n)\n\nres = s.stream.delete(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: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.terminate(\"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.Terminate(ctx, \"\")\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=\"\",\n)\n\nres = s.stream.terminate(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: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.startPull(\"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.StartPull(ctx, \"\")\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=\"\",\n)\n\nres = s.stream.start_pull(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: \"\",\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(\"\"),\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=\"\",\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: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.getClips(\"\");\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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.GetClips(ctx, \"\")\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=\"\",\n)\n\nres = s.stream.get_clips(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: \"\",\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 }, \"\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - lang: go label: addMultistreamTarget 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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.AddMultistreamTarget(ctx, \"\", components.TargetAddPayload{\n Profile: \"720p0\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetAddPayloadSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - lang: python label: addMultistreamTarget source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"\",\n)\n\nres = s.stream.add_multistream_target(id=\"\", target_add_payload={\n \"profile\": \"720p0\",\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\nif res is not None:\n # handle response\n pass" /stream/{id}/multistream/{targetId}: delete: operationId: removeMultistreamTarget x-speakeasy-name-override: removeMultistreamTarget summary: Remove a multistream target tags: - stream parameters: - in: path name: id schema: type: string description: ID of the parent stream required: true - in: path name: targetId schema: type: string description: ID of the multistream target required: true responses: default: description: Error content: application/json: schema: $ref: '#/components/schemas/error' '204': description: Success (No content) x-codeSamples: - lang: typescript label: removeMultistreamTarget source: "import { Livepeer } from \"livepeer\";\n\nconst livepeer = new Livepeer({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await livepeer.stream.removeMultistreamTarget(\"\", \"\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - lang: go label: removeMultistreamTarget 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(\"\"),\n )\n\n ctx := context.Background()\n res, err := s.Stream.RemoveMultistreamTarget(ctx, \"\", \"\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - lang: python label: removeMultistreamTarget source: "from livepeer import Livepeer\n\ns = Livepeer(\n api_key=\"\",\n)\n\nres = s.stream.remove_multistream_target(id=\"\", target_id=\"\")\n\nif res is not None:\n # handle response\n pass" components: schemas: transcode-profile: type: object description: Transcode API profile additionalProperties: false required: - bitrate properties: width: type: integer minimum: 128 example: 1280 name: type: string minLength: 1 maxLength: 500 example: 720p height: type: integer minimum: 128 example: 720 bitrate: type: integer minimum: 400 example: 3000000 quality: type: integer description: 'Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it. ' minimum: 0 maximum: 44 example: 23 fps: type: integer minimum: 0 example: 30 fpsDen: type: integer minimum: 1 example: 1 gop: type: string example: 2 profile: type: string enum: - H264Baseline - H264Main - H264High - H264ConstrainedHigh example: H264Baseline encoder: type: string enum: - H.264 - HEVC - VP8 - VP9 example: H.264 storage-status: readOnly: true additionalProperties: false required: - phase - tasks properties: phase: type: string description: Phase of the asset storage enum: - waiting - processing - ready - failed - reverted example: ready progress: type: number description: Current progress of the task updating the storage. example: 0.5 errorMessage: type: string description: Error message if the last storage changed failed. example: Failed to update storage tasks: type: object additionalProperties: false properties: pending: type: string description: 'ID of any currently running task that is exporting this asset to IPFS. ' example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 last: type: string description: 'ID of the last task to run successfully, that created the currently saved data. ' example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 failed: type: string description: ID of the last task to fail execution. example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 new-stream-payload: type: object required: - name additionalProperties: false properties: name: $ref: '#/components/schemas/stream/properties/name' pull: $ref: '#/components/schemas/stream/properties/pull' creatorId: $ref: '#/components/schemas/input-creator-id' playbackPolicy: $ref: '#/components/schemas/playback-policy' profiles: type: - array - 'null' items: $ref: '#/components/schemas/ffmpeg-profile' default: $ref: '#/components/schemas/stream/properties/profiles/default' record: $ref: '#/components/schemas/stream/properties/record' recordingSpec: type: object additionalProperties: false properties: profiles: type: - array - 'null' items: $ref: '#/components/schemas/transcode-profile' multistream: $ref: '#/components/schemas/stream/properties/multistream' userTags: $ref: '#/components/schemas/stream/properties/userTags' multistream-target: properties: url: type: string writeOnly: true description: Livepeer-compatible multistream target URL (RTMP(S) or SRT) example: rtmps://live.my-service.tv/channel/secretKey format: uri pattern: ^(srt|rtmps?):// stream: type: object required: - name additionalProperties: false properties: id: type: string readOnly: true example: de7818e7-610a-4057-8f6f-b785dc1e6f88 name: type: string example: test_stream kind: type: string example: stream deprecated: true creatorId: $ref: '#/components/schemas/creator-id' userTags: type: object description: User input tags associated with the stream additionalProperties: oneOf: - type: string - type: number - type: array items: oneOf: - type: string - type: number lastSeen: type: number example: 1587667174725 sourceSegments: type: number example: 1 transcodedSegments: type: number example: 2 sourceSegmentsDuration: type: number example: 1 description: Duration of all the source segments, sec transcodedSegmentsDuration: type: number example: 2 description: Duration of all the transcoded segments, sec sourceBytes: type: number example: 1 transcodedBytes: type: number example: 2 ingestRate: type: number example: 1 description: Rate at which sourceBytes increases (bytes/second) outgoingRate: type: number example: 2 description: Rate at which transcodedBytes increases (bytes/second) isActive: type: boolean description: If currently active example: true isHealthy: $ref: '#/components/schemas/stream-health-payload/properties/is_healthy' issues: $ref: '#/components/schemas/stream-health-payload/properties/human_issues' createdByTokenName: type: string readOnly: true description: Name of the token used to create this object example: abc-123-xyz-456 createdAt: type: number readOnly: true description: Timestamp (in milliseconds) at which stream object was created example: 1587667174725 parentId: type: string example: de7818e7-610a-4057-8f6f-b785dc1e6f88 description: Points to parent stream object streamKey: type: string example: hgebdhhigq description: Used to form RTMP ingest URL pull: type: object description: 'Configuration for a stream that should be actively pulled from an external source, rather than pushed to Livepeer. If specified, the stream will not have a streamKey.' additionalProperties: false required: - source properties: source: type: string description: URL from which to pull from. example: https://myservice.com/live/stream.flv headers: type: object description: Headers to be sent with the request to the pull source. additionalProperties: type: string example: Authorization: Bearer 123 isMobile: oneOf: - type: integer enum: - 0 - 1 - 2 description: '0: not mobile, 1: mobile screen share, 2: mobile camera.' - type: boolean description: If true, the stream will be pulled from a mobile source. description: Indicates whether the stream will be pulled from a mobile source. default: 0 location: type: object description: 'Approximate location of the pull source. The location is used to determine the closest Livepeer region to pull the stream from.' additionalProperties: false required: - lat - lon properties: lat: type: number description: 'Latitude of the pull source in degrees. North is positive, south is negative.' example: 39.739 lon: type: number description: 'Longitude of the pull source in degrees. East is positive, west is negative.' example: -104.988 playbackId: type: string example: eaw4nk06ts2d0mzb description: The playback ID to use with the Playback Info endpoint to retrieve playback URLs. playbackPolicy: $ref: '#/components/schemas/playback-policy' profiles: type: array description: 'Profiles to transcode the stream into. If not specified, a default set of profiles will be used with 240p, 360p, 480p and 720p resolutions. Keep in mind that the source rendition is always kept. ' default: - name: 240p0 fps: 0 bitrate: 250000 width: 426 height: 240 - name: 360p0 fps: 0 bitrate: 800000 width: 640 height: 360 - name: 480p0 fps: 0 bitrate: 1600000 width: 854 height: 480 - name: 720p0 fps: 0 bitrate: 3000000 width: 1280 height: 720 items: $ref: '#/components/schemas/ffmpeg-profile' projectId: type: string description: The ID of the project example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9 record: description: 'Should this stream be recorded? Uses default settings. For more customization, create and configure an object store. ' type: boolean example: false recordingSpec: type: object description: 'Configuration for recording the stream. This can only be set if `record` is true. ' additionalProperties: false properties: profiles: type: array items: $ref: '#/components/schemas/transcode-profile' description: 'Profiles to process the recording of this stream into. If not specified, default profiles will be derived based on the stream input. Keep in mind that the source rendition is always kept. ' multistream: type: object additionalProperties: false properties: targets: type: array example: - id: PUSH123 profile: 720p description: 'References to targets where this stream will be simultaneously streamed to ' items: $ref: '#/components/schemas/target' suspended: type: boolean description: If currently suspended lastTerminatedAt: type: - number - 'null' example: 1713281212993 description: Timestamp (in milliseconds) when the stream was last terminated userId: type: string readOnly: true example: we7818e7-610a-4057-8f6f-b785dc1e6f88 deprecated: true renditions: type: object stream-health-payload: properties: is_healthy: oneOf: - type: 'null' - type: boolean description: Indicates whether the stream is healthy or not. human_issues: oneOf: - type: 'null' - type: array items: type: string description: A string array of human-readable errors describing issues affecting the stream, if any. ipfs-file-info: type: object required: - cid additionalProperties: false properties: cid: type: string description: CID of the file on IPFS url: readOnly: true type: string description: URL with IPFS scheme for the file gatewayUrl: readOnly: true type: string description: URL to access file via HTTP through an IPFS gateway playback-policy: type: - object - 'null' description: Whether the playback policy for an asset or stream is public or signed additionalProperties: false required: - type properties: type: type: string enum: - public - jwt - webhook example: webhook webhookId: type: string description: ID of the webhook to use for playback policy example: 1bde4o2i6xycudoy webhookContext: type: object description: User-defined webhook context additionalProperties: true example: streamerId: my-custom-id refreshInterval: type: number description: 'Interval (in seconds) at which the playback policy should be refreshed (default 600 seconds) ' example: 600 allowedOrigins: type: array description: List of allowed origins for CORS playback (://:, ://) items: type: string target-add-payload: type: object additionalProperties: false $ref: '#/components/schemas/target' creator-id: oneOf: - type: object additionalProperties: false required: - type - value properties: type: type: string enum: - unverified example: unverified value: type: string description: Developer-managed ID of the user who created the resource. example: user123 input-creator-id: oneOf: - type: object additionalProperties: false required: - type - value properties: type: type: string enum: - unverified value: type: string - type: string description: Helper syntax to specify an unverified creator ID, fully managed by the developer. clip-payload: type: object additionalProperties: false required: - playbackId - startTime properties: playbackId: type: string description: The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. example: eaw4nk06ts2d0mzb startTime: type: number description: The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ example: 1587667174725 endTime: type: number description: The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ example: 1587667174725 name: type: string description: The optional friendly name of the clip to create. example: My Clip sessionId: type: string description: The optional session ID of the stream to clip. This can be used to clip _recordings_ - if it is not specified, it will clip the ongoing livestream. example: de7818e7-610a-4057-8f6f-b785dc1e6f88 new-asset-payload: properties: encryption: type: object additionalProperties: false required: - encryptedKey properties: encryptedKey: type: string writeOnly: true description: Encryption key used to encrypt the asset. Only writable in the upload asset endpoints and cannot be retrieved back. ffmpeg-profile: type: object description: Transcode profile additionalProperties: false required: - width - name - height - bitrate - fps properties: width: type: integer minimum: 128 example: 1280 name: type: string minLength: 1 maxLength: 500 example: 720p height: type: integer minimum: 128 example: 720 bitrate: type: integer minimum: 400 example: 3000000 fps: type: integer minimum: 0 example: 30 fpsDen: type: integer minimum: 1 example: 1 quality: type: integer description: 'Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it. ' minimum: 0 maximum: 44 example: 23 gop: type: string example: 2 profile: type: string enum: - H264Baseline - H264Main - H264High - H264ConstrainedHigh example: H264Baseline encoder: type: string enum: - H.264 asset: type: object additionalProperties: false required: - id - name - source properties: id: type: string readOnly: true example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 type: type: string enum: - video - audio description: Type of the asset. example: video playbackId: type: string example: eaw4nk06ts2d0mzb description: The playback ID to use with the Playback Info endpoint to retrieve playback URLs. userId: type: string readOnly: true example: 66E2161C-7670-4D05-B71D-DA2D6979556F deprecated: true staticMp4: type: boolean writeOnly: true description: Whether to generate MP4s for the asset. playbackUrl: readOnly: true type: string example: https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8 description: URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). downloadUrl: readOnly: true type: string example: https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4 description: The URL to directly download the asset, e.g. `https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video`. It is not recommended to use this for playback. playbackPolicy: $ref: '#/components/schemas/playback-policy' source: oneOf: - additionalProperties: false required: - type - url properties: type: type: string enum: - url url: type: string description: URL from which the asset was uploaded. gatewayUrl: type: string description: Gateway URL from asset if parsed from provided URL on upload. encryption: $ref: '#/components/schemas/new-asset-payload/properties/encryption' - additionalProperties: false required: - type - sessionId properties: type: type: string enum: - recording sessionId: type: string description: ID of the session from which this asset was created - additionalProperties: false required: - type properties: type: type: string enum: - directUpload - clip encryption: $ref: '#/components/schemas/new-asset-payload/properties/encryption' sourceId: type: string description: ID of the asset or stream from which this asset was created. sessionId: type: string description: ID of the session from which this asset was created. playbackId: type: string description: Playback ID of the asset or stream from which this asset was created. requesterId: type: string description: ID of the requester from which this asset was created. assetId: type: string description: ID of the asset from which this asset was created. creatorId: $ref: '#/components/schemas/creator-id' profiles: type: array description: 'Requested profiles for the asset to be transcoded into. Configured on the upload APIs payload or through the `stream.recordingSpec` field for recordings. If not specified, default profiles are derived based on the source input. If this is a recording, the source will not be present in this list but will be available for playback. ' items: $ref: '#/components/schemas/transcode-profile' storage: type: object additionalProperties: false properties: ipfs: type: object additionalProperties: false properties: spec: type: object additionalProperties: false default: {} properties: nftMetadataTemplate: type: string enum: - file - player default: file description: 'Name of the NFT metadata template to export. ''player'' will embed the Livepeer Player on the NFT while ''file'' will reference only the immutable MP4 files. ' nftMetadata: type: object description: 'Additional data to add to the NFT metadata exported to IPFS. Will be deep merged with the default metadata exported. ' $ref: {} nftMetadata: $ref: '#/components/schemas/ipfs-file-info' updatedAt: readOnly: true type: number description: 'Timestamp (in milliseconds) at which IPFS export task was updated ' example: 1587667174725 status: $ref: '#/components/schemas/storage-status' status: readOnly: true type: object additionalProperties: false required: - phase - updatedAt description: Status of the asset properties: phase: type: string description: Phase of the asset enum: - uploading - waiting - processing - ready - failed - deleting - deleted updatedAt: type: number description: Timestamp (in milliseconds) at which the asset was last updated example: 1587667174725 progress: type: number description: Current progress of the task creating this asset. errorMessage: type: string description: Error message if the asset creation failed. name: type: string description: 'The name of the asset. This is not necessarily the filename - it can be a custom name or title. ' example: filename.mp4 projectId: type: string description: The ID of the project example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9 createdAt: readOnly: true type: number description: Timestamp (in milliseconds) at which asset was created example: 1587667174725 createdByTokenName: type: string readOnly: true description: Name of the token used to create this object size: readOnly: true type: number description: Size of the asset in bytes example: 84934509 hash: type: - array - 'null' description: Hash of the asset items: type: object additionalProperties: false properties: hash: type: string description: Hash of the asset example: 9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57 algorithm: type: string description: Hash algorithm used to compute the hash example: sha256 videoSpec: readOnly: true type: object additionalProperties: false description: Video metadata properties: format: type: string description: Format of the asset example: mp4 duration: type: number description: Duration of the asset in seconds (float) example: 23.8328 bitrate: type: number description: Bitrate of the video in bits per second example: 1000000 tracks: type: array description: 'List of tracks associated with the asset when the format contemplates them (e.g. mp4) ' items: type: object additionalProperties: false required: - type - codec properties: type: type: string description: type of track enum: - video - audio example: video codec: type: string description: Codec of the track example: aac startTime: type: number description: Start time of the track in seconds example: 23.8238 duration: type: number description: Duration of the track in seconds example: 23.8238 bitrate: type: number description: Bitrate of the track in bits per second example: 1000000 width: type: number description: Width of the track - only for video tracks example: 1920 height: type: number description: Height of the track - only for video tracks example: 1080 pixelFormat: type: string description: Pixel format of the track - only for video tracks example: yuv420p fps: type: number description: Frame rate of the track - only for video tracks example: 30 channels: type: number description: Amount of audio channels in the track example: 2 sampleRate: type: number description: 'Sample rate of the track in samples per second - only for audio tracks ' example: 44100 bitDepth: type: number description: Bit depth of the track - only for audio tracks example: 16 stream-patch-payload: type: object additionalProperties: false properties: creatorId: $ref: '#/components/schemas/input-creator-id' record: $ref: '#/components/schemas/stream/properties/record' suspended: $ref: '#/components/schemas/stream/properties/suspended' multistream: $ref: '#/components/schemas/stream/properties/multistream' playbackPolicy: $ref: '#/components/schemas/playback-policy' profiles: $ref: '#/components/schemas/new-stream-payload/properties/profiles' recordingSpec: $ref: '#/components/schemas/new-stream-payload/properties/recordingSpec' userTags: $ref: '#/components/schemas/stream/properties/userTags' name: $ref: '#/components/schemas/stream/properties/name' target: type: object required: - profile additionalProperties: false properties: profile: type: string description: 'Name of transcoding profile that should be sent. Use "source" for pushing source stream data ' minLength: 1 maxLength: 500 example: 720p0 videoOnly: type: boolean description: 'If true, the stream audio will be muted and only silent video will be pushed to the target. ' default: false example: false id: type: string description: ID of multistream target object where to push this stream example: PUSH123 spec: type: object writeOnly: true description: 'Inline multistream target object. Will automatically create the target resource to be used by the created stream. ' required: - url additionalProperties: false properties: name: type: string example: My target url: $ref: '#/components/schemas/multistream-target/properties/url' error: type: object properties: errors: type: array minItems: 1 items: type: string example: - id not provided - Account not found securitySchemes: HTTPBearer: type: http scheme: bearer