openapi: 3.1.0 info: title: Livepeer API Reference 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 - name: asset description: Operations related to asset/vod api - name: webhook description: Operations related to webhook api - name: multistream description: Operations related to multistream api - name: session description: Operations related to session api - name: room description: Operations related to rooms api - name: transcode description: Operations related to transcode api - name: metrics description: Operations related to metrics api - name: playback description: Operations related to playback api - name: accessControl description: Operations related to access control/signing keys api - name: task description: Operations related to tasks api - name: generate description: Operations related to AI generate api components: securitySchemes: apiKey: type: http scheme: bearer bearerFormat: JWT HTTPBearer: type: http scheme: bearer schemas: 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 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 webhook: type: object required: - name - url additionalProperties: false properties: id: type: string readOnly: true example: de7818e7-610a-4057-8f6f-b785dc1e6f88 name: type: string example: test_webhook kind: type: string example: webhook readOnly: true deprecated: true userId: type: string readOnly: true deprecated: true projectId: type: string description: The ID of the project example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9 createdAt: type: number readOnly: true description: Timestamp (in milliseconds) at which stream object was created example: 1587667174725 events: type: array items: type: string enum: - stream.started - stream.detection - stream.idle - recording.ready - recording.started - recording.waiting - multistream.connected - multistream.error - multistream.disconnected - playback.user.new - playback.accessControl - asset.created - asset.updated - asset.failed - asset.ready - asset.deleted - task.spawned - task.updated - task.completed - task.failed example: - stream.started - stream.idle url: type: string format: uri pattern: "^http(s)?://" example: "https://my-service.com/webhook" sharedSecret: type: string writeOnly: true description: shared secret used to sign the webhook payload example: my-secret streamId: type: string description: streamId of the stream on which the webhook is applied example: de7818e7-610a-4057-8f6f-b785dc1e6f88 status: type: object readOnly: true description: status of webhook properties: lastFailure: type: object readOnly: true description: failure timestamp and error message with status code properties: timestamp: type: number readOnly: true example: 1587667174725 description: Timestamp (in milliseconds) at which the webhook last failed error: readOnly: true type: string description: Webhook failure error message example: Error message response: readOnly: true type: string description: Webhook failure response example: Response body statusCode: readOnly: true type: number description: Webhook failure status code example: 500 lastTriggeredAt: type: number description: | Timestamp (in milliseconds) at which the webhook last was triggered example: 1587667174725 webhook-log: type: object required: - id - webhookId additionalProperties: false properties: id: type: string readOnly: true example: de7818e7-610a-4057-8f6f-b785dc1e6f88 webhookId: readOnly: true type: string description: ID of the webhook this request was made for example: de7818e7-610a-4057-8f6f-b785dc1e6f88 event: readOnly: true type: string description: The event type that triggered the webhook request example: stream.started createdAt: readOnly: true type: number description: | Timestamp (in milliseconds) at which webhook request object was created example: 1587667174725 duration: type: number description: The time taken (in seconds) to make the webhook request example: 0.5 success: type: boolean description: Whether the webhook request was successful example: true request: type: object properties: url: type: string description: URL used for the request example: "https://my-service.com/webhook" method: type: string description: HTTP request method example: POST headers: type: object description: HTTP request headers additionalProperties: type: string example: User-Agent: livepeer.studio body: type: string description: request body example: '{"event": "stream.started"}' response: type: object additionalProperties: false properties: body: type: string description: response body status: type: number description: HTTP status code statusText: type: string description: response status text 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 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" project: type: object required: - name additionalProperties: false properties: id: type: string readOnly: true example: de7818e7-610a-4057-8f6f-b785dc1e6f88 name: type: string example: test_project createdAt: type: number readOnly: true description: Timestamp (in milliseconds) at which stream object was created example: 1587667174725 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 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" asset-patch-payload: type: object additionalProperties: false properties: name: $ref: "#/components/schemas/asset/properties/name" creatorId: $ref: "#/components/schemas/input-creator-id" playbackPolicy: $ref: "#/components/schemas/playback-policy" storage: $ref: "#/components/schemas/new-asset-payload/properties/storage" 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-add-payload: type: object additionalProperties: false $ref: "#/components/schemas/target" stream-health-payload: type: object description: | Payload received from Catalyst about the health of livestreams currently or recently active on Mist. required: - stream_name - is_active - is_healthy properties: stream_name: type: string description: | The name of the stream within Catalyst/Mist, normally comprised of the base stream name with the playback ID after the + sign. example: videorec+eaw4nk06ts2d0mzb session_id: description: | The unique identifier for the specific session, created by Mist and used for creating the session object in the DB. type: string is_active: type: boolean description: Indicates whether the stream is currently live or not. is_healthy: oneOf: - type: "null" - type: "boolean" description: "Indicates whether the stream is healthy or not." issues: oneOf: - type: "null" - type: "string" description: | "Raw issues affecting the stream as described by Mist, if any. We don't expose those to the end-user, showing only human_issues instead." 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." tracks: type: object description: | A map of track objects containing information about the stream's tracks. The keys are the unique track ID from Mist. additionalProperties: type: object properties: codec: type: string description: The codec being used for the track. kbits: type: number description: "The bitrate of the track, in kilobits per second." keys: type: object description: An object containing additional track-specific metrics. additionalProperties: type: number fpks: type: number description: | The framerate of the track, in frames per thousand seconds (kilo-second). height: type: number description: The height of the track's video resolution. width: type: number description: The width of the track's video resolution. extra: type: object description: | An object containing any additional fields sent by mist in the health (STREAM_BUFFER) payload. additionalProperties: true multistream-target-patch-payload: $ref: "#/components/schemas/multistream-target" required: [] session: type: object required: - name - streamId additionalProperties: false properties: id: type: string readOnly: true example: de7818e7-610a-4057-8f6f-b785dc1e6f88 kind: type: string example: stream deprecated: true userId: type: string readOnly: true example: 66E2161C-7670-4D05-B71D-DA2D6979556F deprecated: true name: type: string example: test_session 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) isHealthy: $ref: "#/components/schemas/stream-health-payload/properties/is_healthy" issues: $ref: "#/components/schemas/stream-health-payload/properties/human_issues" createdAt: readOnly: true type: number 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 projectId: type: string description: The ID of the project example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9 record: description: > Whether the stream should be recorded. Uses default settings. For more customization, create and configure an object store. type: boolean example: false recordingStatus: readOnly: true type: string description: The status of the recording process of this stream session. enum: - waiting - ready - failed - deleted - none recordingUrl: type: string readOnly: true description: URL for accessing the recording of this stream session. mp4Url: type: string readOnly: true description: The URL for the stream session recording packaged in an MP4. playbackId: type: string example: eaw4nk06ts2d0mzb description: >- The playback ID to use with the Playback Info endpoint to retrieve playback URLs. profiles: $ref: "#/components/schemas/stream/properties/profiles" recordingSpec: $ref: "#/components/schemas/stream/properties/recordingSpec" error: type: object properties: errors: type: array minItems: 1 items: type: string example: - id not provided - Account not found multistream-target: type: object required: - url additionalProperties: false properties: id: type: string readOnly: true example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 name: type: string userId: type: string readOnly: true example: 66E2161C-7670-4D05-B71D-DA2D6979556F deprecated: true 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?)://" disabled: type: boolean description: | If true then this multistream target will not be used for pushing even if it is configured in a stream object. createdAt: type: number readOnly: true description: | Timestamp (in milliseconds) at which multistream target object was created example: 1587667174725 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 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 new-signing-key-payload: additionalProperties: false properties: name: type: string description: Name of the signing key projectId: type: string description: Project ID to which this signing key belongs new-asset-payload: additionalProperties: false required: - name properties: 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 staticMp4: type: boolean description: Whether to generate MP4s for the asset. example: true playbackPolicy: $ref: "#/components/schemas/playback-policy" creatorId: $ref: "#/components/schemas/input-creator-id" storage: type: object additionalProperties: false properties: ipfs: description: | Set to true to make default export to IPFS. To customize the pinned files, specify an object with a spec field. False or null means to unpin from IPFS, but it's unsupported right now. oneOf: - type: object additionalProperties: false properties: spec: oneOf: - type: "null" - $ref: >- #/components/schemas/asset/properties/storage/properties/ipfs/properties/spec - type: boolean - type: "null" 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. c2pa: type: boolean description: Decides if the output video should include C2PA signature profiles: type: - array - "null" items: $ref: "#/components/schemas/transcode-profile" targetSegmentSizeSecs: type: number description: How many seconds the duration of each output segment should be room-user-payload: type: object required: - name additionalProperties: false properties: name: type: string description: Display name example: name canPublish: type: boolean description: Whether a user is allowed to publish audio/video tracks example: true canPublishData: type: boolean description: Whether a user is allowed to publish data messages to the room example: true metadata: type: string description: User defined payload to store for the participant create-room-response: type: object properties: id: type: string description: The ID of the room example: d32ae9e6-c459-4931-9898-e86e2f5e7e16 room-user-response: type: object properties: id: type: string description: The ID of the user example: d32ae9e6-c459-4931-9898-e86e2f5e7e16 joinUrl: type: string description: >- Joining URL - use this for Livepeer's default meeting app (see the multiparticipant streaming guide for more info). example: "https://meet.livepeer.chat" token: type: string description: >- Joining JWT - this can be used if you have a custom meeting app (see the multiparticipant streaming guide for more info). example: token get-room-user-response: type: object properties: id: type: string description: The ID of the user example: d32ae9e6-c459-4931-9898-e86e2f5e7e16 joinedAt: type: integer description: Timestamp (in milliseconds) at which the user joined example: 1687517025261 name: type: string description: The display name of the user example: name isPublisher: type: boolean description: Whether a user is allowed to publish audio/video tracks example: true default: true metadata: type: string description: User defined payload to store for the participant room-egress-payload: type: object required: - streamId additionalProperties: false properties: streamId: type: string description: The ID of the Livepeer Stream to stream to example: aac12556-4d65-4d34-9fb6-d1f0985eb0a9 room-user-update-payload: type: object required: - canPublish additionalProperties: false properties: canPublish: type: boolean description: >- Whether a user is allowed to publish audio/video tracks (i.e. their microphone and webcam) example: true default: true canPublishData: type: boolean description: Whether a user is allowed to publish data messages to the room example: true default: true metadata: type: string description: User defined payload to store for the participant room: type: object required: - id - participants - events properties: id: type: string readOnly: true description: room ID example: d32ae9e6-c459-4931-9898-e86e2f5e7e16 createdAt: type: number readOnly: true description: Timestamp (in milliseconds) at which the room was created example: 1587667174725 updatedAt: type: number readOnly: true description: Timestamp (in milliseconds) at which room was updated example: 1587667174725 egressId: type: string description: internal ID for egress output participants: type: object additionalProperties: type: object properties: identity: type: string description: participant ID name: type: string description: user defined participant name joinedAt: type: integer description: the time the participant joined leftAt: type: integer description: the time the participant left transcode-payload: additionalProperties: false required: - input - storage - outputs properties: input: oneOf: - type: object additionalProperties: false description: URL input video required: - url properties: url: type: string format: uri pattern: "^(https?|ipfs|ar)://" description: URL of the video to transcode example: "https://s3.amazonaws.com/bucket/file.mp4" - type: object additionalProperties: false description: S3-like storage input video required: - type - endpoint - bucket - path - credentials properties: type: type: string enum: - s3 description: | Type of service. This is optional and defaults to `url` if ŚURL field is provided. endpoint: type: string format: uri pattern: "^http(s)?://" description: >- Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) example: "https://gateway.storjshare.io" bucket: type: string description: Bucket with input file example: inputbucket path: type: string description: Path to the input file inside the bucket example: /path/file.mp4 credentials: type: object additionalProperties: false required: - accessKeyId - secretAccessKey description: Credentials for the private input video storage properties: accessKeyId: type: string description: Access Key ID example: AKIAIOSFODNN7EXAMPLE secretAccessKey: type: string description: Secret Access Key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY storage: oneOf: - type: object additionalProperties: false required: - type - endpoint - bucket - credentials description: Storage for the output files properties: type: type: string enum: - s3 description: Type of service used for output files endpoint: type: string format: uri pattern: "^http(s)?://" description: >- Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) example: "https://gateway.storjshare.io" bucket: type: string description: Bucket with output files example: outputbucket credentials: type: object additionalProperties: false required: - accessKeyId - secretAccessKey description: Credentials for the output video storage properties: accessKeyId: type: string description: Access Key ID example: AKIAIOSFODNN7EXAMPLE secretAccessKey: type: string description: Secret Access Key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY - type: object additionalProperties: false required: - type - credentials description: Storage for the output files properties: type: type: string enum: - web3.storage description: Type of service used for output files credentials: type: object additionalProperties: false required: - proof description: | Delegation proof for Livepeer to be able to upload to web3.storage properties: proof: type: string description: Base64 encoded UCAN delegation proof example: >- EaJlcm9vdHOAZ3ZlcnNpb24BmgIBcRIg2uxHpcPYSWNtifMKFkPC7IEDvFDCxCd3ADViv0coV7SnYXNYRO2hA0AnblHEW38s3lSlcwaDjPn outputs: type: object additionalProperties: false description: Output formats properties: hls: type: object additionalProperties: false required: - path description: HLS output format properties: path: type: string description: Path for the HLS output example: /samplevideo/hls mp4: type: object additionalProperties: false required: - path description: MP4 output format properties: path: type: string description: Path for the MP4 output example: /samplevideo/mp4 fmp4: type: object additionalProperties: false required: - path description: FMP4 output format properties: path: type: string description: Path for the FMP4 output example: /samplevideo/fmp4 profiles: type: array items: $ref: "#/components/schemas/transcode-profile" targetSegmentSizeSecs: type: number description: How many seconds the duration of each output segment should be creatorId: $ref: "#/components/schemas/input-creator-id" c2pa: type: boolean description: Decides if the output video should include C2PA signature task: type: object additionalProperties: false properties: id: type: string description: Task ID readOnly: true example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 type: type: string description: Type of the task enum: - upload - export - export-data - transcode-file - clip example: upload createdAt: readOnly: true type: number description: Timestamp (in milliseconds) at which task was created example: 1587667174725 scheduledAt: readOnly: true type: number description: | Timestamp (in milliseconds) at which the task was scheduled for execution (e.g. after file upload finished). example: 1587667174725 inputAssetId: type: string description: ID of the input asset example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 outputAssetId: type: string description: ID of the output asset example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 projectId: type: string description: ID of the project example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 requesterId: type: string description: ID of the requester hash(IP + SALT + PlaybackId) example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 params: type: object additionalProperties: false description: Parameters of the task properties: upload: type: object additionalProperties: false description: Parameters for the upload task properties: url: type: string description: URL of the asset to "upload" example: "https://cdn.livepeer.com/ABC123/filename.mp4" encryption: $ref: "#/components/schemas/new-asset-payload/properties/encryption" c2pa: type: boolean description: Decides if the output video should include C2PA signature example: true profiles: type: array items: $ref: "#/components/schemas/transcode-profile" targetSegmentSizeSecs: type: number description: >- How many seconds the duration of each output segment should be example: 6 export: $ref: "#/components/schemas/export-task-params" exportData: type: object additionalProperties: false description: Parameters for the export-data task required: - content properties: content: type: object description: File content to store into IPFS example: data: "Hello, World!" ipfs: $ref: "#/components/schemas/ipfs-export-params" type: type: string description: Optional type of content example: text/plain id: type: string description: Optional ID of the content example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 transcode-file: type: object additionalProperties: false description: Parameters for the transcode-file task properties: input: type: object additionalProperties: false description: Input video file to transcode properties: url: type: string description: | URL of a video to transcode, accepts object-store format "s3+https" example: "https://cdn.livepeer.com/ABC123/filename.mp4" storage: type: object additionalProperties: false description: Storage for the output files properties: url: type: string description: | URL of the output storage, accepts object-store format "s3+https" example: "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket" outputs: type: object additionalProperties: false description: Output formats properties: hls: type: object additionalProperties: false description: HLS output format properties: path: type: string description: Path for the HLS output example: /samplevideo/hls mp4: type: object additionalProperties: false description: MP4 output format properties: path: type: string description: Path for the MP4 output example: /samplevideo/mp4 profiles: type: array items: $ref: "#/components/schemas/transcode-profile" targetSegmentSizeSecs: type: number description: | How many seconds the duration of each output segment should be example: 10 creatorId: $ref: "#/components/schemas/input-creator-id" c2pa: type: boolean description: Decides if the output video should include C2PA signature example: false clip: properties: url: type: string description: URL of the asset to "clip" example: >- https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 clipStrategy: type: object description: >- Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. additionalProperties: false properties: startTime: $ref: "#/components/schemas/clip-payload/properties/startTime" endTime: $ref: "#/components/schemas/clip-payload/properties/endTime" playbackId: $ref: "#/components/schemas/clip-payload/properties/playbackId" catalystPipelineStrategy: type: string description: >- Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. enum: - catalyst - catalyst_ffmpeg - background_external - background_mist - fallback_external - external example: catalyst_ffmpeg sessionId: type: string description: ID of the session example: d32ae9e6-c459-4931-9898-e86e2f5e7e16 inputId: type: string description: ID of the input asset or stream example: 09F8B46C-61A0-4254-9875-F71F4C605BC7 status: readOnly: true type: object additionalProperties: false description: Status of the task required: - phase - updatedAt properties: phase: type: string description: Phase of the task enum: - pending - waiting - running - failed - completed - cancelled example: pending updatedAt: type: number description: Timestamp (in milliseconds) at which task was updated example: 1587667174725 progress: type: number description: Current progress of the task in a 0-1 ratio example: 0.5 errorMessage: type: string description: Error message if the task failed example: Failed to upload file retries: type: number description: Number of retries done on the task example: 3 step: type: string writeOnly: true description: Step of the task processing example: upload output: type: object additionalProperties: false description: Output of the task properties: upload: type: object additionalProperties: true description: Output of the upload task properties: videoFilePath: type: string writeOnly: true example: "https://s3.amazonaws.com/my-bucket/path/filename.mp4" metadataFilePath: type: string writeOnly: true example: "https://s3.amazonaws.com/my-bucket/path/filename.json" assetSpec: $ref: "#/components/schemas/asset" export: type: object additionalProperties: false description: Output of the export task properties: ipfs: type: object additionalProperties: false required: - videoFileCid properties: videoFileCid: type: string description: IPFS CID of the exported video file example: Qmabc123xyz341 videoFileUrl: type: string readOnly: true description: URL for the file with the IPFS protocol example: "ipfs://Qmabc123xyz341" videoFileGatewayUrl: readOnly: true type: string description: URL to access file via HTTP through an IPFS gateway example: "https://gateway.ipfs.io/ipfs/Qmabc123xyz341" nftMetadataCid: type: string description: IPFS CID of the default metadata exported for the video example: Qmabc123xyz341 nftMetadataUrl: readOnly: true type: string description: URL for the metadata file with the IPFS protocol example: "ipfs://Qmabc123xyz341" nftMetadataGatewayUrl: readOnly: true type: string description: | URL to access metadata file via HTTP through an IPFS gateway example: "https://gateway.ipfs.io/ipfs/Qmabc123xyz341" exportData: type: object additionalProperties: false description: Output of the export data task properties: ipfs: type: object additionalProperties: false required: - cid properties: cid: type: string description: IPFS CID of the exported data example: Qmabc123xyz341 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. 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" export-task-params: description: Parameters for the export task oneOf: - type: object additionalProperties: false required: - custom properties: custom: type: object description: custom URL parameters for the export task additionalProperties: false required: - url properties: url: type: string format: uri pattern: "^http(s)?://" description: URL where to export the asset example: >- https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB method: type: string description: Method to use on the export request default: PUT example: POST headers: type: object description: Headers to add to the export request additionalProperties: type: string - type: object additionalProperties: false required: - ipfs properties: ipfs: $ref: "#/components/schemas/ipfs-export-params" signing-key: type: object additionalProperties: false required: - publicKey properties: id: type: string readOnly: true example: 78df0075-b5f3-4683-a618-1086faca35dc name: type: string description: Name of the signing key example: key1 userId: type: string readOnly: true example: 78df0075-b5f3-4683-a618-1086faca35dc deprecated: true createdAt: readOnly: true type: number description: Timestamp (in milliseconds) at which the signing-key was created example: 1587667174725 lastSeen: readOnly: true type: number description: Timestamp (in milliseconds) at which the signing-key was last used example: 1587667174725 publicKey: type: string disabled: type: boolean description: Disable the signing key to allow rotation safely example: false projectId: type: string description: The ID of the project example: aac12556-4d65-4d34-9fb user: type: object required: - email - password additionalProperties: false properties: email: type: string description: user email address example: useremail@gmail.com password: type: string example: thisisapassword minLength: 64 maxLength: 64 writeOnly: true emailValidToken: type: string example: E1F53135E559C253 writeOnly: true emailValid: type: boolean example: true suspended: type: boolean disabled: type: boolean salt: type: string example: E1F53135E559C253 writeOnly: true id: type: string readOnly: true example: abc123 firstName: type: string example: Joe lastName: type: string example: Smith organization: type: string example: Livepeer phone: type: string example: 2034212122 ccLast4: type: string example: 1234 ccBrand: type: string example: 1234 createdAt: type: number description: Timestamp (in milliseconds) at which user object was created example: 1587667174725 verifiedAt: type: number description: Timestamp (in milliseconds) at which user object was verified example: 1587667174725 planChangedAt: type: number description: Timestamp (in milliseconds) at which user object was verified example: 1587667174725 lastStreamedAt: type: number description: | Timestamp (in milliseconds) at which user streamed RTMP stream last time example: 1587667174725 lastSeen: type: number description: Timestamp (in milliseconds) at which user's password was used example: 1587667174725 usage: type: object additionalProperties: false properties: id: type: string description: day associated with usage example: 2021-01-30T00:00:00.000Z date: type: number readOnly: true example: usage sourceSegments: type: number example: 200000 transcodedSegments: type: number example: 200000 sourceSegmentsDuration: type: number example: 200000 transcodedSegmentsDuration: type: number example: 200000 streamCount: type: number example: 200000 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 usage-metric: type: object description: | An individual metric about usage of a user. properties: UserID: type: string description: The user ID associated with the metric example: 1bde4o2i6xycudoy CreatorID: type: string description: The creator ID associated with the metric example: john@doe.com DeliveryUsageMins: type: number description: Total minutes of delivery usage. example: 100 TotalUsageMins: type: number description: Total transcoded minutes. example: 100 StorageUsageMins: type: number description: Total minutes of storage usage. example: 100 realtime-viewership-metric: type: object description: | An individual metric about realtime viewership of a stream/asset. required: - viewCount - errorRate properties: playbackId: type: string description: The playback ID associated with the metric. example: 1bde4o2i6xycudoy device: type: string description: The device used by the viewer. example: iPhone browser: type: string description: The browser used by the viewer. example: Safari country: type: string description: The country where the viewer is located. example: United States viewCount: type: integer description: The number of views for the stream/asset. example: 100 errorRate: type: number description: The error rate for the stream/asset. example: 0.1 viewership-metric: type: object description: | An individual metric about viewership of a stream/asset. Necessarily, at least 1 of playbackId and dStorageUrl will be present, depending on the query. required: - viewCount - playtimeMins properties: playbackId: type: string description: The playback ID associated with the metric. example: 1bde4o2i6xycudoy creatorId: type: string description: The ID of the creator associated with the metric. example: john@doe.com viewerId: type: string description: The ID of the viewer associated with the metric. example: 1bde4o2i6xycudoy dStorageUrl: type: string description: The URL of the distributed storage used for the asset example: "ipfs://QmZ4" timestamp: type: number example: 1587667174725 description: | Timestamp (in milliseconds) when the metric was recorded. If the query contains a time step, this timestamp will point to the beginning of the time step period. device: type: string description: The device used by the viewer. example: iPhone deviceType: type: string description: The type of the device used by the viewer. example: mobile cpu: type: string description: The CPU used by the viewer's device. example: ARM os: type: string description: The operating system used by the viewer. example: iOS browser: type: string description: The browser used by the viewer. example: Safari browserEngine: type: string description: The browser engine used by the viewer's browser. example: WebKit continent: type: string description: The continent where the viewer is located. example: North America country: type: string description: The country where the viewer is located. example: United States subdivision: type: string description: | The subdivision (e.g., state or province) where the viewer is located. example: California timezone: type: string description: The timezone where the viewer is located. example: America/Los_Angeles geohash: type: string description: Geographic encoding of the viewers location. Accurate to 3 digits. example: 123 viewCount: type: integer description: The number of views for the stream/asset. example: 100 playtimeMins: type: number description: The total playtime in minutes for the stream/asset. example: 10 ttffMs: type: number description: The time-to-first-frame (TTFF) in milliseconds. example: 100 rebufferRatio: type: number description: The rebuffering ratio for the asset. example: 0.1 errorRate: type: number description: The error rate for the stream/asset. example: 0.1 exitsBeforeStart: type: number description: | The percentage of sessions that existed before the asset started playing. example: 0.5 playback-info: type: object additionalProperties: false required: - type - meta properties: type: type: string example: vod enum: - live - vod - recording meta: type: object additionalProperties: false required: - source properties: live: type: integer enum: - 0 - 1 example: 0 playbackPolicy: $ref: "#/components/schemas/playback-policy" source: type: array items: type: object additionalProperties: false required: - hrn - type - url properties: hrn: type: string description: Human Readable Name example: MP4 enum: - HLS (TS) - MP4 - WebRTC (H264) - FLV (H264) - Thumbnail (JPEG) - Thumbnail (PNG) - Thumbnails type: type: string example: html5/video/mp4 enum: - html5/application/vnd.apple.mpegurl - html5/video/mp4 - html5/video/h264 - video/x-flv - image/jpeg - image/png - text/vtt url: type: string example: >- https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 size: type: number example: 494778 width: type: number example: 204 height: type: number example: 360 bitrate: type: number example: 449890 dvrPlayback: type: array items: type: object additionalProperties: false properties: hrn: type: string example: MP4 enum: - HLS (TS) type: type: string example: html5/video/mp4 enum: - html5/application/vnd.apple.mpegurl url: type: string example: >- https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 error: type: string attestation: $ref: "#/components/schemas/attestation" attestation: type: object additionalProperties: false required: - primaryType - domain - message - signature properties: id: type: string readOnly: true example: 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 primaryType: type: string description: Video Metadata EIP-712 primaryType enum: - VideoAttestation example: VideoAttestation domain: type: object description: Video Metadata EIP-712 domain additionalProperties: false required: - name - version properties: name: type: string enum: - Verifiable Video example: Verifiable Video version: type: string enum: - "1" example: "1" message: type: object additionalProperties: false description: Video Metadata EIP-712 message content required: - video - attestations - signer - timestamp properties: video: type: string example: 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 attestations: type: array items: type: object additionalProperties: false required: - role - address properties: role: type: string example: creator address: type: string example: 1311768467294899700 signer: type: string example: 1311768467294899700 timestamp: type: number example: 1587667174725 signature: type: string description: Video Metadata EIP-712 message signature example: 1311768467294899700 createdAt: type: number readOnly: true description: Timestamp (in milliseconds) at which the object was created example: 1587667174725 signatureType: type: string enum: - eip712 - flow example: eip712 storage: additionalProperties: false properties: ipfs: type: object additionalProperties: false properties: $ref: {} updatedAt: readOnly: true type: number description: > Timestamp (in milliseconds) at which IPFS export task was updated example: 1587667174725 status: $ref: "#/components/schemas/storage-status" ipfs-export-params: type: object additionalProperties: false properties: $ref: {} pinata: description: | Custom credentials for the Piñata service. Must have either a JWT or an API key and an API secret. oneOf: - type: object additionalProperties: false required: - jwt properties: jwt: type: string writeOnly: true description: | Will be added to the Authorization header as a Bearer token. example: >- eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c - type: object additionalProperties: false required: - apiKey - apiSecret properties: apiKey: type: string description: Will be added to the pinata_api_key header. example: "1234567890" apiSecret: type: string writeOnly: true description: Will be added to the pinata_secret_api_key header. example: 1234567890abcdef 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-asset-from-url-payload: additionalProperties: false required: - name - url properties: name: $ref: "#/components/schemas/new-asset-payload/properties/name" staticMp4: $ref: "#/components/schemas/new-asset-payload/properties/staticMp4" playbackPolicy: $ref: "#/components/schemas/playback-policy" creatorId: $ref: "#/components/schemas/input-creator-id" storage: $ref: "#/components/schemas/new-asset-payload/properties/storage" url: type: string format: uri pattern: "^(https?|ipfs|ar)://" description: > URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`. For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave source: `ar://{CID}`. example: "https://s3.amazonaws.com/my-bucket/path/filename.mp4" encryption: $ref: "#/components/schemas/new-asset-payload/properties/encryption" c2pa: $ref: "#/components/schemas/new-asset-payload/properties/c2pa" profiles: $ref: "#/components/schemas/new-asset-payload/properties/profiles" targetSegmentSizeSecs: $ref: >- #/components/schemas/new-asset-payload/properties/targetSegmentSizeSecs APIError: properties: msg: type: string title: Msg description: The error message. type: object required: - msg title: APIError description: API error response model. Body_genAudioToText: properties: audio: type: string format: binary title: Audio description: Uploaded audio file to be transcribed. model_id: type: string title: Model Id description: Hugging Face model ID used for transcription. default: openai/whisper-large-v3 return_timestamps: type: string title: Return Timestamps description: >- Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a string boolean ('true' or 'false'). Default is 'true' ('sentence'). 'false' means no timestamps. 'word' means word-based timestamps. default: "true" type: object required: - audio title: Body_genAudioToText additionalProperties: false Body_genImageToImage: properties: prompt: type: string title: Prompt description: Text prompt(s) to guide image generation. image: type: string format: binary title: Image description: Uploaded image to modify with the pipeline. model_id: type: string title: Model Id description: Hugging Face model ID used for image generation. default: timbrooks/instruct-pix2pix loras: type: string title: Loras description: >- A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}. default: "" strength: type: number title: Strength description: Degree of transformation applied to the reference image (0 to 1). default: 0.8 guidance_scale: type: number title: Guidance Scale description: >- Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). default: 7.5 image_guidance_scale: type: number title: Image Guidance Scale description: >- Degree to which the generated image is pushed towards the initial image. default: 1.5 negative_prompt: type: string title: Negative Prompt description: >- Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. default: "" safety_check: type: boolean title: Safety Check description: >- Perform a safety check to estimate if generated images could be offensive or harmful. default: true seed: type: integer title: Seed description: Seed for random number generation. num_inference_steps: type: integer title: Num Inference Steps description: >- Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. default: 100 num_images_per_prompt: type: integer title: Num Images Per Prompt description: Number of images to generate per prompt. default: 1 type: object required: - prompt - image title: Body_genImageToImage additionalProperties: false Body_genImageToVideo: properties: image: type: string format: binary title: Image description: Uploaded image to generate a video from. model_id: type: string title: Model Id description: Hugging Face model ID used for video generation. default: stabilityai/stable-video-diffusion-img2vid-xt-1-1 height: type: integer title: Height description: The height in pixels of the generated video. default: 576 width: type: integer title: Width description: The width in pixels of the generated video. default: 1024 fps: type: integer title: Fps description: The frames per second of the generated video. default: 6 motion_bucket_id: type: integer title: Motion Bucket Id description: >- Used for conditioning the amount of motion for the generation. The higher the number the more motion will be in the video. default: 127 noise_aug_strength: type: number title: Noise Aug Strength description: >- Amount of noise added to the conditioning image. Higher values reduce resemblance to the conditioning image and increase motion. default: 0.02 safety_check: type: boolean title: Safety Check description: >- Perform a safety check to estimate if generated images could be offensive or harmful. default: true seed: type: integer title: Seed description: Seed for random number generation. num_inference_steps: type: integer title: Num Inference Steps description: >- Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. default: 25 type: object required: - image title: Body_genImageToVideo additionalProperties: false Body_genLLM: properties: prompt: type: string title: Prompt model_id: type: string title: Model Id default: meta-llama/Meta-Llama-3.1-8B-Instruct system_msg: type: string title: System Msg default: "" temperature: type: number title: Temperature default: 0.7 max_tokens: type: integer title: Max Tokens default: 256 history: type: string title: History default: "[]" stream: type: boolean title: Stream default: false type: object required: - prompt title: Body_genLLM additionalProperties: false Body_genSegmentAnything2: properties: image: type: string format: binary title: Image description: Image to segment. model_id: type: string title: Model Id description: Hugging Face model ID used for image generation. default: facebook/sam2-hiera-large point_coords: type: string title: Point Coords description: >- Nx2 array of point prompts to the model, where each point is in (X,Y) in pixels. point_labels: type: string title: Point Labels description: >- Labels for the point prompts, where 1 indicates a foreground point and 0 indicates a background point. box: type: string title: Box description: "A length 4 array given as a box prompt to the model, in XYXY format." mask_input: type: string title: Mask Input description: >- A low-resolution mask input to the model, typically from a previous prediction iteration, with the form 1xHxW (H=W=256 for SAM). multimask_output: type: boolean title: Multimask Output description: >- If true, the model will return three masks for ambiguous input prompts, often producing better masks than a single prediction. default: true return_logits: type: boolean title: Return Logits description: >- If true, returns un-thresholded mask logits instead of a binary mask. default: true normalize_coords: type: boolean title: Normalize Coords description: >- If true, the point coordinates will be normalized to the range [0,1], with point_coords expected to be with respect to image dimensions. default: true type: object required: - image title: Body_genSegmentAnything2 additionalProperties: false Body_genUpscale: properties: prompt: type: string title: Prompt description: Text prompt(s) to guide upscaled image generation. image: type: string format: binary title: Image description: Uploaded image to modify with the pipeline. model_id: type: string title: Model Id description: Hugging Face model ID used for upscaled image generation. default: stabilityai/stable-diffusion-x4-upscaler safety_check: type: boolean title: Safety Check description: >- Perform a safety check to estimate if generated images could be offensive or harmful. default: true seed: type: integer title: Seed description: Seed for random number generation. num_inference_steps: type: integer title: Num Inference Steps description: >- Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. default: 75 type: object required: - prompt - image title: Body_genUpscale additionalProperties: false Chunk: properties: timestamp: items: {} type: array title: Timestamp description: The timestamp of the chunk. text: type: string title: Text description: The text of the chunk. type: object required: - timestamp - text title: Chunk description: A chunk of text with a timestamp. HTTPError: properties: detail: allOf: - $ref: "#/components/schemas/APIError" description: Detailed error information. type: object required: - detail title: HTTPError description: HTTP error response model. HTTPValidationError: properties: detail: items: $ref: "#/components/schemas/ValidationError" type: array title: Detail type: object title: HTTPValidationError ImageResponse: properties: images: items: $ref: "#/components/schemas/Media" type: array title: Images description: The generated images. type: object required: - images title: ImageResponse description: Response model for image generation. LLMResponse: properties: response: type: string title: Response tokens_used: type: integer title: Tokens Used type: object required: - response - tokens_used title: LLMResponse MasksResponse: properties: masks: type: string title: Masks description: The generated masks. scores: type: string title: Scores description: The model's confidence scores for each generated mask. logits: type: string title: Logits description: "The raw, unnormalized predictions (logits) for the masks." type: object required: - masks - scores - logits title: MasksResponse description: Response model for object segmentation. Media: properties: url: type: string title: Url description: The URL where the media can be accessed. seed: type: integer title: Seed description: The seed used to generate the media. nsfw: type: boolean title: Nsfw description: Whether the media was flagged as NSFW. type: object required: - url - seed - nsfw title: Media description: A media object containing information about the generated media. TextResponse: properties: text: type: string title: Text description: The generated text. chunks: items: $ref: "#/components/schemas/Chunk" type: array title: Chunks description: The generated text chunks. type: object required: - text - chunks title: TextResponse description: Response model for text generation. TextToImageParams: properties: model_id: type: string title: Model Id description: Hugging Face model ID used for image generation. default: SG161222/RealVisXL_V4.0_Lightning loras: type: string title: Loras description: >- A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}. default: "" prompt: type: string title: Prompt description: >- Text prompt(s) to guide image generation. Separate multiple prompts with '|' if supported by the model. height: type: integer title: Height description: The height in pixels of the generated image. default: 576 width: type: integer title: Width description: The width in pixels of the generated image. default: 1024 guidance_scale: type: number title: Guidance Scale description: >- Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). default: 7.5 negative_prompt: type: string title: Negative Prompt description: >- Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. default: "" safety_check: type: boolean title: Safety Check description: >- Perform a safety check to estimate if generated images could be offensive or harmful. default: true seed: type: integer title: Seed description: Seed for random number generation. num_inference_steps: type: integer title: Num Inference Steps description: >- Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. default: 50 num_images_per_prompt: type: integer title: Num Images Per Prompt description: Number of images to generate per prompt. default: 1 type: object required: - prompt title: TextToImageParams additionalProperties: false ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError VideoResponse: properties: images: items: $ref: "#/components/schemas/Media" type: array title: Images description: The generated images. type: object required: - images title: VideoResponse description: Response model for image generation. studio-api-error: type: object properties: errors: type: array minItems: 1 items: type: string 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"; import { Profile, TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.create({ name: "test_stream", pull: { source: "https://myservice.com/live/stream.flv", headers: { "Authorization": "Bearer 123", }, location: { lat: 39.739, lon: -104.988, }, }, playbackPolicy: { type: Type.Webhook, webhookId: "1bde4o2i6xycudoy", webhookContext: { "streamerId": "my-custom-id", }, refreshInterval: 600, }, profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, fps: 30, fpsDen: 1, quality: 23, gop: "2", profile: Profile.H264Baseline, }, ], record: false, recordingSpec: { profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, ], }, multistream: { targets: [ { profile: "720p0", videoOnly: false, id: "PUSH123", spec: { name: "My target", url: "rtmps://live.my-service.tv/channel/secretKey", }, }, ], }, }); // Handle the result console.log(result); } run(); - lang: go label: createStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.Create(ctx, components.NewStreamPayload{ Name: "test_stream", Pull: &components.Pull{ Source: "https://myservice.com/live/stream.flv", Headers: map[string]string{ "Authorization": "Bearer 123", }, Location: &components.Location{ Lat: 39.739, Lon: -104.988, }, }, PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, RefreshInterval: livepeergo.Float64(600), }, Profiles: []components.FfmpegProfile{ components.FfmpegProfile{ Width: 1280, Name: "720p", Height: 720, Bitrate: 3000000, Fps: 30, FpsDen: livepeergo.Int64(1), Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), Profile: components.ProfileH264Baseline.ToPointer(), }, }, Record: livepeergo.Bool(false), RecordingSpec: &components.NewStreamPayloadRecordingSpec{ Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ Width: livepeergo.Int64(1280), Name: livepeergo.String("720p"), Height: livepeergo.Int64(720), Bitrate: 3000000, Quality: livepeergo.Int64(23), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), Encoder: components.TranscodeProfileEncoderH264.ToPointer(), }, }, }, Multistream: &components.Multistream{ Targets: []components.Target{ components.Target{ Profile: "720p", VideoOnly: livepeergo.Bool(false), ID: livepeergo.String("PUSH123"), Spec: &components.TargetSpec{ Name: livepeergo.String("My target"), URL: "rtmps://live.my-service.tv/channel/secretKey", }, }, }, }, }) if err != nil { log.Fatal(err) } if res.Stream != nil { // handle response } } - lang: python label: createStream source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.stream.create(request={ "name": "test_stream", "pull": { "source": "https://myservice.com/live/stream.flv", "headers": { "Authorization": "Bearer 123", }, "location": { "lat": 39.739, "lon": -104.988, }, }, "playback_policy": { "type": components.Type.WEBHOOK, "webhook_id": "1bde4o2i6xycudoy", "webhook_context": { "streamerId": "my-custom-id", }, "refresh_interval": 600, }, "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fps_den": 1, "quality": 23, "gop": "2", "profile": components.Profile.H264_BASELINE, }, ], "record": False, "recording_spec": { "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, "gop": "2", "profile": components.TranscodeProfileProfile.H264_BASELINE, "encoder": components.TranscodeProfileEncoder.H_264, }, ], }, "multistream": { "targets": [ { "profile": "720p", "video_only": False, "id": "PUSH123", "spec": { "name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey", }, }, ], }, }) if res.stream is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getStreams source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.GetAll(ctx, nil) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getStreams source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.get_all() if res.data is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.get(""); // Handle the result console.log(result); } run(); - lang: go label: getStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Stream != nil { // handle response } } - lang: python label: getStream source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.get(id="") if res.stream is not None: # handle response 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"; import { Profile, TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.update({ record: false, multistream: { targets: [ { profile: "720p0", videoOnly: false, id: "PUSH123", spec: { name: "My target", url: "rtmps://live.my-service.tv/channel/secretKey", }, }, ], }, playbackPolicy: { type: Type.Webhook, webhookId: "1bde4o2i6xycudoy", webhookContext: { "streamerId": "my-custom-id", }, refreshInterval: 600, }, profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, fps: 30, fpsDen: 1, quality: 23, gop: "2", profile: Profile.H264Baseline, }, { width: 1280, name: "720p", height: 720, bitrate: 3000000, fps: 30, fpsDen: 1, quality: 23, gop: "2", profile: Profile.H264Baseline, }, { width: 1280, name: "720p", height: 720, bitrate: 3000000, fps: 30, fpsDen: 1, quality: 23, gop: "2", profile: Profile.H264Baseline, }, ], recordingSpec: { profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, ], }, name: "test_stream", }, ""); // Handle the result console.log(result); } run(); - lang: go label: updateStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.Update(ctx, "", components.StreamPatchPayload{ Record: livepeergo.Bool(false), Multistream: &components.Multistream{ Targets: []components.Target{ components.Target{ Profile: "720p", VideoOnly: livepeergo.Bool(false), ID: livepeergo.String("PUSH123"), Spec: &components.TargetSpec{ Name: livepeergo.String("My target"), URL: "rtmps://live.my-service.tv/channel/secretKey", }, }, }, }, PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, RefreshInterval: livepeergo.Float64(600), }, Profiles: []components.FfmpegProfile{ components.FfmpegProfile{ Width: 1280, Name: "720p", Height: 720, Bitrate: 3000000, Fps: 30, FpsDen: livepeergo.Int64(1), Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), Profile: components.ProfileH264Baseline.ToPointer(), }, }, RecordingSpec: &components.RecordingSpec{ Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ Width: livepeergo.Int64(1280), Name: livepeergo.String("720p"), Height: livepeergo.Int64(720), Bitrate: 3000000, Quality: livepeergo.Int64(23), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), Encoder: components.TranscodeProfileEncoderH264.ToPointer(), }, }, }, }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: updateStream source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.stream.update(id="", stream_patch_payload={ "record": False, "multistream": { "targets": [ { "profile": "720p", "video_only": False, "id": "PUSH123", "spec": { "name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey", }, }, ], }, "playback_policy": { "type": components.Type.WEBHOOK, "webhook_id": "1bde4o2i6xycudoy", "webhook_context": { "streamerId": "my-custom-id", }, "refresh_interval": 600, }, "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fps_den": 1, "quality": 23, "gop": "2", "profile": components.Profile.H264_BASELINE, }, ], "recording_spec": { "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, "gop": "2", "profile": components.TranscodeProfileProfile.H264_BASELINE, "encoder": components.TranscodeProfileEncoder.H_264, }, ], }, }) if res is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.delete(""); // Handle the result console.log(result); } run(); - lang: go label: deleteStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.Delete(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteStream source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.delete(id="") if res is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.terminate(""); // Handle the result console.log(result); } run(); - lang: go label: terminateStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.Terminate(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: terminateStream source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.terminate(id="") if res is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.startPull(""); // Handle the result console.log(result); } run(); - lang: go label: startPullStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.StartPull(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: startPullStream source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.start_pull(id="") if res is not None: # handle response pass /multistream/target: get: operationId: getMultistreamTargets x-speakeasy-name-override: getAll summary: Retrieve Multistream Targets tags: - multistream 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/multistream-target" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getMultistreamTargets source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.multistream.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getMultistreamTargets source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Multistream.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getMultistreamTargets source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.multistream.get_all() if res.data is not None: # handle response pass post: operationId: createMultistreamTarget x-speakeasy-name-override: create summary: Create a multistream target tags: - multistream requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/multistream-target" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "201": description: Success content: application/json: schema: $ref: "#/components/schemas/multistream-target" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: createMultistreamTarget source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.multistream.create({ url: "rtmps://live.my-service.tv/channel/secretKey", }); // Handle the result console.log(result); } run(); - lang: go label: createMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Multistream.Create(ctx, components.MultistreamTargetInput{ URL: "rtmps://live.my-service.tv/channel/secretKey", }) if err != nil { log.Fatal(err) } if res.MultistreamTarget != nil { // handle response } } - lang: python label: createMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.multistream.create(request={ "url": "rtmps://live.my-service.tv/channel/secretKey", }) if res.multistream_target is not None: # handle response pass "/multistream/target/{id}": parameters: - name: id description: ID of the multistream target in: path required: true schema: type: string get: operationId: getMultistreamTarget x-speakeasy-name-override: get summary: Retrieve a multistream target tags: - multistream responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/multistream-target" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getMultistreamTarget source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.multistream.get(""); // Handle the result console.log(result); } run(); - lang: go label: getMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Multistream.Get(ctx, "") if err != nil { log.Fatal(err) } if res.MultistreamTarget != nil { // handle response } } - lang: python label: getMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.multistream.get(id="") if res.multistream_target is not None: # handle response pass patch: operationId: updateMultistreamTarget x-speakeasy-name-override: update summary: Update Multistream Target tags: - multistream requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/multistream-target-patch-payload" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: typescript label: updateMultistreamTarget source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.multistream.update({ url: "rtmps://live.my-service.tv/channel/secretKey", }, ""); // Handle the result console.log(result); } run(); - lang: go label: updateMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Multistream.Update(ctx, "", components.MultistreamTargetPatchPayload{ URL: "rtmps://live.my-service.tv/channel/secretKey", }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: updateMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.multistream.update(id="", multistream_target_patch_payload={ "url": "rtmps://live.my-service.tv/channel/secretKey", }) if res is not None: # handle response pass delete: operationId: deleteMultistreamTarget x-speakeasy-name-override: delete summary: Delete a multistream target tags: - multistream description: | Make sure to remove any references to the target on existing streams before actually deleting it from the API. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: typescript label: deleteMultistreamTarget source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.multistream.delete(""); // Handle the result console.log(result); } run(); - lang: go label: deleteMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Multistream.Delete(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.multistream.delete(id="") if res is not None: # handle response pass /webhook: get: x-speakeasy-name-override: getAll operationId: getWebhooks summary: Retrieve a Webhook tags: - webhook 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/webhook" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getWebhooks source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getWebhooks source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getWebhooks source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.get_all() if res.data is not None: # handle response pass post: operationId: createWebhook x-speakeasy-name-override: create summary: Create a webhook tags: - webhook description: > To create a new webhook, you need to make an API call with the events you want to listen for and the URL that will be called when those events occur. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/webhook" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: createWebhook source: |- import { Livepeer } from "livepeer"; import { Events } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.create({ name: "test_webhook", projectId: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", events: [ Events.StreamStarted, Events.StreamIdle, ], url: "https://my-service.com/webhook", sharedSecret: "my-secret", streamId: "de7818e7-610a-4057-8f6f-b785dc1e6f88", }); // Handle the result console.log(result); } run(); - lang: go label: createWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.Create(ctx, components.WebhookInput{ Name: "test_webhook", ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), Events: []components.Events{ components.EventsStreamStarted, components.EventsStreamIdle, }, URL: "https://my-service.com/webhook", SharedSecret: livepeergo.String("my-secret"), StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), }) if err != nil { log.Fatal(err) } if res.Webhook != nil { // handle response } } - lang: python label: createWebhook source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.webhook.create(request={ "name": "test_webhook", "project_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "events": [ components.Events.STREAM_STARTED, components.Events.STREAM_IDLE, ], "url": "https://my-service.com/webhook", "shared_secret": "my-secret", "stream_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", }) if res.webhook is not None: # handle response pass "/webhook/{id}": get: operationId: getWebhook x-speakeasy-name-override: get summary: Retrieve a webhook tags: - webhook parameters: - name: id in: path required: true schema: type: string responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getWebhook source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.get(""); // Handle the result console.log(result); } run(); - lang: go label: getWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Webhook != nil { // handle response } } - lang: python label: getWebhook source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.get(id="") if res.webhook is not None: # handle response pass put: parameters: - name: id in: path required: true schema: type: string summary: Update a webhook x-speakeasy-name-override: update operationId: updateWebhook tags: - webhook requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/webhook" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: updateWebhook source: |- import { Livepeer } from "livepeer"; import { Events } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.update({ name: "test_webhook", projectId: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", events: [ Events.StreamStarted, Events.StreamIdle, ], url: "https://my-service.com/webhook", sharedSecret: "my-secret", streamId: "de7818e7-610a-4057-8f6f-b785dc1e6f88", }, ""); // Handle the result console.log(result); } run(); - lang: go label: updateWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.Update(ctx, "", components.WebhookInput{ Name: "test_webhook", ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), Events: []components.Events{ components.EventsStreamStarted, components.EventsStreamIdle, }, URL: "https://my-service.com/webhook", SharedSecret: livepeergo.String("my-secret"), StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), }) if err != nil { log.Fatal(err) } if res.Webhook != nil { // handle response } } - lang: python label: updateWebhook source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.webhook.update(id="", webhook={ "name": "test_webhook", "project_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "events": [ components.Events.STREAM_STARTED, components.Events.STREAM_IDLE, ], "url": "https://my-service.com/webhook", "shared_secret": "my-secret", "stream_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", }) if res.webhook is not None: # handle response pass delete: tags: - webhook parameters: - name: id in: path required: true schema: type: string operationId: deleteWebhook x-speakeasy-name-override: delete summary: Delete a webhook responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: deleteWebhook source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.delete(""); // Handle the result console.log(result); } run(); - lang: go label: deleteWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.Delete(ctx, "") if err != nil { log.Fatal(err) } if res.Webhook != nil { // handle response } } - lang: python label: deleteWebhook source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.delete(id="") if res.webhook is not None: # handle response pass "/webhook/{id}/log": get: operationId: getWebhookLogs x-speakeasy-name-override: getLogs tags: - webhook summary: Retrieve webhook logs parameters: - name: id in: path required: true 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/webhook-log" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getWebhookLogs source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.getLogs(""); // Handle the result console.log(result); } run(); - lang: go label: getWebhookLogs source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.GetLogs(ctx, "") if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getWebhookLogs source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.get_logs(id="") if res.data is not None: # handle response pass "/webhook/{id}/log/{logId}": get: tags: - webhook operationId: getWebhookLog x-speakeasy-name-override: getLog summary: Retrieve a webhook log parameters: - name: id in: path required: true schema: type: string - name: logId in: path required: true schema: type: string responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook-log" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getWebhookLog source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.getLog("", ""); // Handle the result console.log(result); } run(); - lang: go label: getWebhookLog source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.GetLog(ctx, "", "") if err != nil { log.Fatal(err) } if res.WebhookLog != nil { // handle response } } - lang: python label: getWebhookLog source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.get_log(id="", log_id="") if res.webhook_log is not None: # handle response pass "/webhook/{id}/log/{logId}/resend": post: tags: - webhook operationId: resendWebhook x-speakeasy-name-override: resendLog summary: Resend a webhook description: | Use this API to resend the same webhook request. This is useful when developing and debugging, allowing you to easily repeat the same webhook to check or fix the behaviour in your handler. parameters: - name: id in: path required: true schema: type: string - name: logId in: path required: true schema: type: string responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/webhook-log" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: resendWebhook source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.webhook.resendLog("", ""); // Handle the result console.log(result); } run(); - lang: go label: resendWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Webhook.ResendLog(ctx, "", "") if err != nil { log.Fatal(err) } if res.WebhookLog != nil { // handle response } } - lang: python label: resendWebhook source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.webhook.resend_log(id="", log_id="") if res.webhook_log is not None: # handle response pass /asset: get: operationId: getAssets x-speakeasy-name-override: getAll tags: - asset summary: Retrieve assets 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: getAssets source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getAssets source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getAssets source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.asset.get_all() if res.data is not None: # handle response pass /asset/request-upload: post: operationId: requestUpload x-speakeasy-name-override: create tags: - asset summary: Upload an asset description: | To upload an asset, your first need to request for a direct upload URL and only then actually upload the contents of the asset. \ \ Once you created a upload link, you have 2 options, resumable or direct upload. For a more reliable experience, you should use resumable uploads which will work better for users with unreliable or slow network connections. If you want a simpler implementation though, you should just use a direct upload. ## Direct Upload For a direct upload, make a PUT request to the URL received in the url field of the response above, with the raw video file as the request body. response above: ## Resumable Upload Livepeer supports resumable uploads via Tus. This section provides a simple example of how to use tus-js-client to upload a video file. \ \ From the previous section, we generated a URL to upload a video file to Livepeer on POST /api/asset/request-upload. You should use the tusEndpoint field of the response to upload the video file and track the progress: ``` # This assumes there is an `input` element of `type="file"` with id `fileInput` in the HTML const input = document.getElementById('fileInput'); const file = input.files[0]; const upload = new tus.Upload(file, { endpoint: tusEndpoint, // URL from `tusEndpoint` field in the `/request-upload` response metadata: { filename, filetype: 'video/mp4', }, uploadSize: file.size, onError(err) { console.error('Error uploading file:', err); }, onProgress(bytesUploaded, bytesTotal) { const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2); console.log('Uploaded ' + percentage + '%'); }, onSuccess() { console.log('Upload finished:', upload.url); }, }); const previousUploads = await upload.findPreviousUploads(); if (previousUploads.length > 0) { upload.resumeFromPreviousUpload(previousUploads[0]); } upload.start(); ``` > Note: If you are using tus from node.js, you need to add a custom URL storage to enable resuming from previous uploads. On the browser, this is enabled by default using local storage. In node.js, add urlStorage: new tus.FileUrlStorage("path/to/tmp/file"), to the UploadFile object definition above. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/new-asset-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: - url - tusEndpoint - asset - task properties: url: type: string description: >- The direct upload endpoint for which supports PUT requests. **It is recommended to use the Tus endpoint for a better upload experience.** example: >- https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q tusEndpoint: type: string description: >- The [Tus-compatible](https://tus.io/) endpoint for resumable uploads. **This is the recommended way to upload assets.** See the [Tus-js](https://github.com/tus/tus-js-client) client for more information. example: >- https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q asset: $ref: "#/components/schemas/asset" task: type: object required: - id additionalProperties: false properties: id: type: string example: 34d7618e-fd42-4798-acf5-19504616a11e x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: requestUpload source: |- import { Livepeer } from "livepeer"; import { TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.create({ name: "filename.mp4", staticMp4: true, playbackPolicy: { type: Type.Webhook, webhookId: "1bde4o2i6xycudoy", webhookContext: { "streamerId": "my-custom-id", }, refreshInterval: 600, }, profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, ], }); // Handle the result console.log(result); } run(); - lang: go label: requestUpload source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.Create(ctx, components.NewAssetPayload{ Name: "filename.mp4", StaticMp4: livepeergo.Bool(true), PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, RefreshInterval: livepeergo.Float64(600), }, Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ Width: livepeergo.Int64(1280), Name: livepeergo.String("720p"), Height: livepeergo.Int64(720), Bitrate: 3000000, Quality: livepeergo.Int64(23), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), Encoder: components.TranscodeProfileEncoderH264.ToPointer(), }, }, }) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: requestUpload source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.asset.create(request={ "name": "filename.mp4", "static_mp4": True, "playback_policy": { "type": components.Type.WEBHOOK, "webhook_id": "1bde4o2i6xycudoy", "webhook_context": { "streamerId": "my-custom-id", }, "refresh_interval": 600, }, "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, "gop": "2", "profile": components.TranscodeProfileProfile.H264_BASELINE, "encoder": components.TranscodeProfileEncoder.H_264, }, ], }) if res.data is not None: # handle response pass /asset/upload/url: post: operationId: uploadAsset x-speakeasy-name-override: createViaUrl summary: Upload asset via URL tags: - asset requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/new-asset-from-url-payload" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Upload in progress content: application/json: schema: type: object additionalProperties: false required: - asset - task properties: asset: $ref: "#/components/schemas/asset" task: type: object required: - id additionalProperties: false properties: id: type: string example: 34d7618e-fd42-4798-acf5-19504616a11e x-speakeasy-name-override: data "201": description: Upload started content: application/json: schema: type: object additionalProperties: false required: - asset - task properties: asset: $ref: "#/components/schemas/asset" task: type: object required: - id additionalProperties: false properties: id: type: string example: 34d7618e-fd42-4798-acf5-19504616a11e x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: uploadAsset source: |- import { Livepeer } from "livepeer"; import { TranscodeProfileEncoder, TranscodeProfileProfile, Type } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.createViaUrl({ name: "filename.mp4", staticMp4: true, playbackPolicy: { type: Type.Webhook, webhookId: "1bde4o2i6xycudoy", webhookContext: { "streamerId": "my-custom-id", }, refreshInterval: 600, }, url: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, ], }); // Handle the result console.log(result); } run(); - lang: go label: uploadAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.CreateViaURL(ctx, components.NewAssetFromURLPayload{ Name: "filename.mp4", StaticMp4: livepeergo.Bool(true), PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, RefreshInterval: livepeergo.Float64(600), }, URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ Width: livepeergo.Int64(1280), Name: livepeergo.String("720p"), Height: livepeergo.Int64(720), Bitrate: 3000000, Quality: livepeergo.Int64(23), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), Encoder: components.TranscodeProfileEncoderH264.ToPointer(), }, }, }) if err != nil { log.Fatal(err) } if res.TwoHundredApplicationJSONData != nil { // handle response } } - lang: python label: uploadAsset source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.asset.create_via_url(request={ "name": "filename.mp4", "static_mp4": True, "playback_policy": { "type": components.Type.WEBHOOK, "webhook_id": "1bde4o2i6xycudoy", "webhook_context": { "streamerId": "my-custom-id", }, "refresh_interval": 600, }, "url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4", "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, "gop": "2", "profile": components.TranscodeProfileProfile.H264_BASELINE, "encoder": components.TranscodeProfileEncoder.H_264, }, ], }) if res.two_hundred_application_json_data is not None: # handle response pass "/asset/{assetId}": get: operationId: getAsset x-speakeasy-name-override: get tags: - asset summary: Retrieves an asset parameters: - in: path name: assetId schema: type: string description: ID of the asset required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/asset" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getAsset source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.get(""); // Handle the result console.log(result); } run(); - lang: go label: getAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Asset != nil { // handle response } } - lang: python label: getAsset source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.asset.get(asset_id="") if res.asset is not None: # handle response pass patch: operationId: updateAsset x-speakeasy-name-override: update summary: Patch an asset tags: - asset parameters: - in: path name: assetId schema: type: string description: ID of the asset required: true requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/asset-patch-payload" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/asset" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: updateAsset source: |- import { Livepeer } from "livepeer"; import { Type } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.update({ name: "filename.mp4", playbackPolicy: { type: Type.Webhook, webhookId: "1bde4o2i6xycudoy", webhookContext: { "streamerId": "my-custom-id", }, refreshInterval: 600, }, }, ""); // Handle the result console.log(result); } run(); - lang: go label: updateAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.Update(ctx, "", components.AssetPatchPayload{ Name: livepeergo.String("filename.mp4"), PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, RefreshInterval: livepeergo.Float64(600), }, }) if err != nil { log.Fatal(err) } if res.Asset != nil { // handle response } } - lang: python label: updateAsset source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.asset.update(asset_id="", asset_patch_payload={ "name": "filename.mp4", "playback_policy": { "type": components.Type.WEBHOOK, "webhook_id": "1bde4o2i6xycudoy", "webhook_context": { "streamerId": "my-custom-id", }, "refresh_interval": 600, }, }) if res.asset is not None: # handle response pass delete: operationId: deleteAsset x-speakeasy-name-override: delete summary: Delete an asset tags: - asset parameters: - in: path name: assetId schema: type: string description: ID of the asset required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success (No content) x-codeSamples: - lang: typescript label: deleteAsset source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.asset.delete(""); // Handle the result console.log(result); } run(); - lang: go label: deleteAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Asset.Delete(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteAsset source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.asset.delete(asset_id="") if res is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.createClip({ playbackId: "eaw4nk06ts2d0mzb", startTime: 1587667174725, endTime: 1587667174725, name: "My Clip", sessionId: "de7818e7-610a-4057-8f6f-b785dc1e6f88", }); // Handle the result console.log(result); } run(); - lang: go label: createClip source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.CreateClip(ctx, components.ClipPayload{ PlaybackID: "eaw4nk06ts2d0mzb", StartTime: 1587667174725, EndTime: livepeergo.Float64(1587667174725), Name: livepeergo.String("My Clip"), SessionID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), }) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: createClip source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.create_clip(request={ "playback_id": "eaw4nk06ts2d0mzb", "start_time": 1587667174725, "end_time": 1587667174725, "name": "My Clip", "session_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", }) if res.data is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.getClips(""); // Handle the result console.log(result); } run(); - lang: go label: getClips source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.GetClips(ctx, "") if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getClips source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.get_clips(id="") if res.data is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.addMultistreamTarget({ profile: "720p0", videoOnly: false, id: "PUSH123", spec: { name: "My target", url: "rtmps://live.my-service.tv/channel/secretKey", }, }, ""); // Handle the result console.log(result); } run(); - lang: go label: addMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.AddMultistreamTarget(ctx, "", components.TargetAddPayload{ Profile: "720p0", VideoOnly: livepeergo.Bool(false), ID: livepeergo.String("PUSH123"), Spec: &components.TargetAddPayloadSpec{ Name: livepeergo.String("My target"), URL: "rtmps://live.my-service.tv/channel/secretKey", }, }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: addMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.add_multistream_target(id="", target_add_payload={ "profile": "720p0", "video_only": False, "id": "PUSH123", "spec": { "name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey", }, }) if res is not None: # handle response 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"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.stream.removeMultistreamTarget("", ""); // Handle the result console.log(result); } run(); - lang: go label: removeMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Stream.RemoveMultistreamTarget(ctx, "", "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: removeMultistreamTarget source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.stream.remove_multistream_target(id="", target_id="") if res is not None: # handle response pass "/session/{id}/clips": get: operationId: getSessionClips x-speakeasy-name-override: getClips summary: Retrieve clips of a session tags: - session parameters: - in: path name: id schema: type: string description: ID of the parent session 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: getSessionClips source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.session.getClips(""); // Handle the result console.log(result); } run(); - lang: go label: getSessionClips source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Session.GetClips(ctx, "") if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getSessionClips source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.session.get_clips(id="") if res.data is not None: # handle response pass /room: post: deprecated: true operationId: createRoom x-speakeasy-name-override: create summary: Create a room tags: - room description: | Create a multiparticipant livestreaming room. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/create-room-response" x-speakeasy-name-override: data x-codeSamples: - lang: go label: createRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.Create(ctx) if err != nil { log.Fatal(err) } if res.CreateRoomResponse != nil { // handle response } } - lang: python label: createRoom source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.create() if res.create_room_response is not None: # handle response pass "/room/{id}": get: deprecated: true operationId: getRoom x-speakeasy-name-override: get tags: - room parameters: - name: id in: path required: true schema: type: string summary: Retrieve a room responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/room" x-speakeasy-name-override: data x-codeSamples: - lang: go label: getRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Room != nil { // handle response } } - lang: python label: getRoom source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.get(id="") if res.room is not None: # handle response pass delete: deprecated: true operationId: deleteRoom x-speakeasy-name-override: delete tags: - room parameters: - name: id in: path required: true schema: type: string summary: Delete a room responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: go label: deleteRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.Delete(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteRoom source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.delete(id="") if res is not None: # handle response pass "/room/{id}/egress": post: deprecated: true operationId: startRoomEgress x-speakeasy-name-override: startEgress tags: - room requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/room-egress-payload" parameters: - name: id in: path required: true schema: type: string summary: Start room RTMP egress description: > Create a livestream for your room. This allows you to leverage livestreaming features like recording and HLS output. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: go label: startRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.StartEgress(ctx, "", components.RoomEgressPayload{ StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: startRoomEgress source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.start_egress(id="", room_egress_payload={ "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", }) if res is not None: # handle response pass delete: deprecated: true operationId: stopRoomEgress x-speakeasy-name-override: stopEgress summary: Stop room RTMP egress tags: - room parameters: - name: id in: path required: true schema: type: string responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: go label: stopRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.StopEgress(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: stopRoomEgress source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.stop_egress(id="") if res is not None: # handle response pass "/room/{id}/user": post: deprecated: true operationId: createRoomUser x-speakeasy-name-override: createUser tags: - room requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/room-user-payload" parameters: - name: id in: path required: true schema: type: string summary: Create a room user description: > Call this endpoint to add a user to a room, specifying a display name at a minimum. The response will contain a joining URL for Livepeer's default meeting app. Alternatively the joining token can be used with a custom app. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "201": description: Success content: application/json: schema: $ref: "#/components/schemas/room-user-response" x-speakeasy-name-override: data x-codeSamples: - lang: go label: createRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.CreateUser(ctx, "", components.RoomUserPayload{ Name: "name", CanPublish: livepeergo.Bool(true), CanPublishData: livepeergo.Bool(true), }) if err != nil { log.Fatal(err) } if res.RoomUserResponse != nil { // handle response } } - lang: python label: createRoomUser source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.create_user(id="", room_user_payload={ "name": "name", "can_publish": True, "can_publish_data": True, }) if res.room_user_response is not None: # handle response pass "/room/{id}/user/{userId}": get: operationId: getRoomUser x-speakeasy-name-override: getUser tags: - room deprecated: true parameters: - name: id in: path required: true schema: type: string - name: userId in: path required: true schema: type: string summary: Get user details responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/get-room-user-response" x-speakeasy-name-override: data x-codeSamples: - lang: go label: getRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.GetUser(ctx, "", "") if err != nil { log.Fatal(err) } if res.GetRoomUserResponse != nil { // handle response } } - lang: python label: getRoomUser source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.get_user(id="", user_id="") if res.get_room_user_response is not None: # handle response pass put: deprecated: true operationId: updateRoomUser x-speakeasy-name-override: updateUser tags: - room requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/room-user-update-payload" parameters: - name: id in: path required: true schema: type: string - name: userId in: path required: true schema: type: string summary: Update a room user description: Update properties for a user. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: go label: updateRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.UpdateUser(ctx, "", "", components.RoomUserUpdatePayload{ CanPublish: livepeergo.Bool(true), CanPublishData: livepeergo.Bool(true), }) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: updateRoomUser source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.update_user(id="", user_id="", room_user_update_payload={ "can_publish": True, "can_publish_data": True, }) if res is not None: # handle response pass delete: operationId: deleteRoomUser x-speakeasy-name-override: deleteUser tags: - room deprecated: true parameters: - name: id in: path required: true schema: type: string - name: userId in: path required: true schema: type: string summary: Remove a user from the room responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success x-codeSamples: - lang: go label: deleteRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Room.DeleteUser(ctx, "", "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteRoomUser source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.room.delete_user(id="", user_id="") if res is not None: # handle response pass /data/views/now: get: operationId: getRealtimeViewershipNow x-speakeasy-name-override: getRealtimeViewership summary: Query realtime viewership tags: - metrics description: | Requires a private (non-CORS) API key to be used. parameters: - name: playbackId in: query description: | The playback ID to filter the query results. This can be a canonical playback ID from Livepeer assets or streams, or dStorage identifiers for assets schema: type: string - name: creatorId in: query description: The creator ID to filter the query results schema: type: string - name: "breakdownBy[]" in: query description: | The list of fields to break down the query results. Specify this query-string multiple times to break down by multiple fields. schema: type: array items: type: string enum: - playbackId - device - browser - country responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: A list of Metric objects content: application/json: schema: type: array items: $ref: "#/components/schemas/realtime-viewership-metric" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getRealtimeViewershipNow source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.metrics.getRealtimeViewership(); // Handle the result console.log(result); } run(); - lang: go label: getRealtimeViewershipNow source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Metrics.GetRealtimeViewership(ctx, nil, nil, nil) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getRealtimeViewershipNow source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.metrics.get_realtime_viewership() if res.data is not None: # handle response pass /data/views/query: get: operationId: getViewershipMetrics x-speakeasy-name-override: getViewership summary: Query viewership metrics tags: - metrics description: | Requires a private (non-CORS) API key to be used. parameters: - name: playbackId in: query description: | The playback ID to filter the query results. This can be a canonical playback ID from Livepeer assets or streams, or dStorage identifiers for assets schema: type: string - name: from in: query description: Start timestamp for the query range (inclusive) schema: oneOf: - type: string format: date-time - type: integer - name: to in: query description: End timestamp for the query range (exclusive) schema: oneOf: - type: string format: date-time - type: integer - name: timeStep in: query description: The time step to aggregate viewership metrics by schema: type: string enum: - hour - day - week - month - year - name: assetId in: query description: The asset ID to filter metrics for schema: type: string - name: streamId in: query description: The stream ID to filter metrics for schema: type: string - name: creatorId in: query description: The creator ID to filter the query results schema: type: string - name: "breakdownBy[]" in: query description: | The list of fields to break down the query results. Specify this query-string multiple times to break down by multiple fields. schema: type: array items: type: string enum: - playbackId - deviceType - device - cpu - os - browser - browserEngine - continent - country - subdivision - timezone - geohash - viewerId - creatorId responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: A list of Metric objects content: application/json: schema: type: array items: $ref: "#/components/schemas/viewership-metric" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getViewershipMetrics source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.metrics.getViewership({}); // Handle the result console.log(result); } run(); - lang: go label: getViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/operations" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Metrics.GetViewership(ctx, operations.GetViewershipMetricsRequest{}) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getViewershipMetrics source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.metrics.get_viewership(request={}) if res.data is not None: # handle response pass /data/views/query/creator: get: operationId: getCreatorViewershipMetrics x-speakeasy-name-override: getCreatorViewership summary: Query creator viewership metrics tags: - metrics description: > Requires a proof of ownership to be sent in the request, which for now is just the assetId or streamId parameters (1 of those must be in the query-string). parameters: - name: from in: query description: Start timestamp for the query range (inclusive) schema: oneOf: - type: string format: date-time - type: integer - name: to in: query description: End timestamp for the query range (exclusive) schema: oneOf: - type: string format: date-time - type: integer - name: timeStep in: query description: The time step to aggregate viewership metrics by schema: type: string enum: - hour - day - week - month - year - name: assetId in: query description: The asset ID to filter metrics for schema: type: string - name: streamId in: query description: The stream ID to filter metrics for schema: type: string - name: creatorId in: query description: The creator ID to filter the query results schema: type: string - name: "breakdownBy[]" in: query description: | The list of fields to break down the query results. Specify this query-string multiple times to break down by multiple fields. schema: type: array items: type: string enum: - deviceType - device - cpu - os - browser - browserEngine - continent - country - subdivision - timezone - viewerId responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: A list of Metric objects content: application/json: schema: type: array items: $ref: "#/components/schemas/viewership-metric" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getCreatorViewershipMetrics source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.metrics.getCreatorViewership({}); // Handle the result console.log(result); } run(); - lang: go label: getCreatorViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/operations" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Metrics.GetCreatorViewership(ctx, operations.GetCreatorViewershipMetricsRequest{}) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getCreatorViewershipMetrics source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.metrics.get_creator_viewership(request={}) if res.data is not None: # handle response pass "/data/views/query/total/{playbackId}": get: operationId: getPublicViewershipMetrics x-speakeasy-name-override: getPublicViewership summary: Query public total views metrics tags: - metrics description: | Allows querying for the public metrics for viewership about a video. This can be called from the frontend with a CORS key, or even unauthenticated. parameters: - name: playbackId in: path required: true description: | The playback ID to filter the query results. This can be a canonical playback ID from Livepeer assets or streams, or dStorage identifiers for assets schema: type: string responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: A single Metric object with the viewCount and playtimeMins metrics. content: application/json: schema: type: object description: | A simplified metric object about aggregate viewership of an asset. Either playbackId or dStorageUrl will be set. properties: playbackId: $ref: >- #/components/schemas/viewership-metric/properties/playbackId dStorageUrl: $ref: >- #/components/schemas/viewership-metric/properties/dStorageUrl viewCount: $ref: >- #/components/schemas/viewership-metric/properties/viewCount playtimeMins: $ref: >- #/components/schemas/viewership-metric/properties/playtimeMins x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getPublicViewershipMetrics source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.metrics.getPublicViewership(""); // Handle the result console.log(result); } run(); - lang: go label: getPublicViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Metrics.GetPublicViewership(ctx, "") if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getPublicViewershipMetrics source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.metrics.get_public_viewership(playback_id="") if res.data is not None: # handle response pass /data/usage/query: get: operationId: getUsageMetrics x-speakeasy-name-override: getUsage tags: - metrics summary: Query usage metrics parameters: - name: from in: query description: | Start millis timestamp for the query range (inclusive) schema: type: integer - name: to in: query description: | End millis timestamp for the query range (exclusive) schema: type: integer - name: timeStep in: query description: | The time step to aggregate viewership metrics by schema: type: string enum: - hour - day - name: creatorId in: query description: | The creator ID to filter the query results schema: type: string - name: "breakdownBy[]" in: query description: | The list of fields to break down the query results. Currently the only supported breakdown is by `creatorId`. schema: type: array items: type: string enum: - creatorId responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: A Usage Metric object content: application/json: schema: $ref: "#/components/schemas/usage-metric" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getUsageMetrics source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.metrics.getUsage({}); // Handle the result console.log(result); } run(); - lang: go label: getUsageMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/operations" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Metrics.GetUsage(ctx, operations.GetUsageMetricsRequest{}) if err != nil { log.Fatal(err) } if res.UsageMetric != nil { // handle response } } - lang: python label: getUsageMetrics source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.metrics.get_usage(request={}) if res.usage_metric is not None: # handle response pass /session: get: operationId: getSessions x-speakeasy-name-override: getAll summary: Retrieve sessions tags: - session 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/session" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getSessions source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.session.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getSessions source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Session.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getSessions source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.session.get_all() if res.data is not None: # handle response pass "/session/{id}": get: operationId: getSession x-speakeasy-name-override: get summary: Retrieve a session tags: - session parameters: - in: path name: id schema: type: string description: ID of the session required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/session" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getSession source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.session.get(""); // Handle the result console.log(result); } run(); - lang: go label: getSession source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Session.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Session != nil { // handle response } } - lang: python label: getSession source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.session.get(id="") if res.session is not None: # handle response pass "/stream/{parentId}/sessions": get: operationId: getRecordedSessions x-speakeasy-name-override: getRecorded summary: Retrieve Recorded Sessions tags: - session parameters: - in: path name: parentId schema: type: string description: ID of the parent stream required: true - in: query name: record schema: oneOf: - type: boolean - type: integer example: true description: | Flag indicating if the response should only include recorded sessions 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/session" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getRecordedSessions source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.session.getRecorded("", true); // Handle the result console.log(result); } run(); - lang: go label: getRecordedSessions source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Session.GetRecorded(ctx, "", livepeergo.Pointer(operations.CreateRecordBoolean( true, ))) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getRecordedSessions source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.session.get_recorded(parent_id="", record=True) if res.data is not None: # handle response pass /access-control/signing-key: post: operationId: createSigningKey x-speakeasy-name-override: create summary: Create a signing key tags: - accessControl description: > The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/signing-key" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: createSigningKey source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.create(); // Handle the result console.log(result); } run(); - lang: go label: createSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.AccessControl.Create(ctx) if err != nil { log.Fatal(err) } if res.SigningKey != nil { // handle response } } - lang: python label: createSigningKey source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.access_control.create() if res.signing_key is not None: # handle response pass get: operationId: getSigningKeys x-speakeasy-name-override: getAll summary: Retrieves signing keys tags: - accessControl 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/signing-key" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getSigningKeys source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getSigningKeys source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getSigningKeys source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.access_control.get_all() if res.data is not None: # handle response pass "/access-control/signing-key/{keyId}": delete: operationId: deleteSigningKey x-speakeasy-name-override: delete summary: Delete Signing Key tags: - accessControl parameters: - in: path name: keyId schema: type: string description: ID of the signing key required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success (No content) x-codeSamples: - lang: typescript label: deleteSigningKey source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.delete(""); // Handle the result console.log(result); } run(); - lang: go label: deleteSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.AccessControl.Delete(ctx, "") if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: deleteSigningKey source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.access_control.delete(key_id="") if res is not None: # handle response pass get: operationId: getSigningKey x-speakeasy-name-override: get summary: Retrieves a signing key tags: - accessControl parameters: - in: path name: keyId schema: type: string description: ID of the signing key required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/signing-key" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getSigningKey source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.get(""); // Handle the result console.log(result); } run(); - lang: go label: getSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.AccessControl.Get(ctx, "") if err != nil { log.Fatal(err) } if res.SigningKey != nil { // handle response } } - lang: python label: getSigningKey source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.access_control.get(key_id="") if res.signing_key is not None: # handle response pass patch: operationId: updateSigningKey x-speakeasy-name-override: update summary: Update a signing key tags: - accessControl parameters: - in: path name: keyId schema: type: string description: ID of the signing key required: true requestBody: required: true content: application/json: schema: type: object properties: disabled: type: boolean name: type: string additionalProperties: false responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "204": description: Success (No content) x-codeSamples: - lang: typescript label: updateSigningKey source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.accessControl.update({}, ""); // Handle the result console.log(result); } run(); - lang: go label: updateSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/operations" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.AccessControl.Update(ctx, "", operations.UpdateSigningKeyRequestBody{}) if err != nil { log.Fatal(err) } if res != nil { // handle response } } - lang: python label: updateSigningKey source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.access_control.update(key_id="", request_body={}) if res is not None: # handle response pass /task: get: operationId: getTasks x-speakeasy-name-override: getAll summary: Retrieve Tasks tags: - task 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/task" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getTasks source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.task.getAll(); // Handle the result console.log(result); } run(); - lang: go label: getTasks source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Task.GetAll(ctx) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } } - lang: python label: getTasks source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.task.get_all() if res.data is not None: # handle response pass "/task/{taskId}": get: operationId: getTask x-speakeasy-name-override: get summary: Retrieve a Task tags: - task parameters: - in: path name: taskId schema: type: string description: ID of the task required: true responses: default: description: Error "200": description: Success content: application/json: schema: $ref: "#/components/schemas/task" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: getTask source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.task.get(""); // Handle the result console.log(result); } run(); - lang: go label: getTask source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Task.Get(ctx, "") if err != nil { log.Fatal(err) } if res.Task != nil { // handle response } } - lang: python label: getTask source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.task.get(task_id="") if res.task is not None: # handle response pass /transcode: post: operationId: transcodeVideo x-speakeasy-name-override: create summary: Transcode a video tags: - transcode description: | `POST /transcode` transcodes a video file and uploads the results to the specified storage service. \ \ Transcoding is asynchronous so you will need to check the status of the task in order to determine when transcoding is complete. The `id` field in the response is the unique ID for the transcoding `Task`. The task status can be queried using the [GET tasks endpoint](https://docs.livepeer.org/reference/api/get-tasks): \ \ When `status.phase` is `completed`, transcoding will be complete and the results will be stored in the storage service and the specified output location. \ \ The results will be available under `params.outputs.hls.path` and `params.outputs.mp4.path` in the specified storage service. ## Input \ This endpoint currently supports the following inputs: - HTTP - S3 API Compatible Service \ \ **HTTP** \ A public HTTP URL can be used to read a video file. ```json { "url": "https://www.example.com/video.mp4" } ``` | Name | Type | Description | | ---- | ------ | ------------------------------------ | | url | string | A public HTTP URL for the video file. | Note: For IPFS HTTP gateway URLs, the API currently only supports “path style” URLs and does not support “subdomain style” URLs. The API will support both styles of URLs in a future update. \ \ **S3 API Compatible Service** \ \ S3 credentials can be used to authenticate with a S3 API compatible service to read a video file. ```json { "type": "s3", "endpoint": "https://gateway.storjshare.io", "credentials": { "accessKeyId": "$ACCESS_KEY_ID", "secretAccessKey": "$SECRET_ACCESS_KEY" }, "bucket": "inbucket", "path": "/video/source.mp4" } ``` ## Storage \ This endpoint currently supports the following storage services: - S3 API Compatible Service - Web3 Storage \ \ **S3 API Compatible Service** ```json { "type": "s3", "endpoint": "https://gateway.storjshare.io", "credentials": { "accessKeyId": "$ACCESS_KEY_ID", "secretAccessKey": "$SECRET_ACCESS_KEY" }, "bucket": "mybucket" } ``` **Web3 Storage** ```json { "type": "web3.storage", "credentials": { "proof": "$UCAN_DELEGATION_PROOF", } } ``` ## Outputs \ This endpoint currently supports the following output types: - HLS - MP4 **HLS** ```json { "hls": { "path": "/samplevideo/hls" } } ``` **MP4** ```json { "mp4": { "path": "/samplevideo/mp4" } } ``` requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/transcode-payload" responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Success content: application/json: schema: $ref: "#/components/schemas/task" x-speakeasy-name-override: data x-codeSamples: - lang: typescript label: transcodeVideo source: |- import { Livepeer } from "livepeer"; import { TranscodePayloadSchemasStorageType, TranscodeProfileEncoder, TranscodeProfileProfile, } from "livepeer/models/components"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.transcode.create({ input: { url: "https://s3.amazonaws.com/bucket/file.mp4", }, storage: { type: TranscodePayloadSchemasStorageType.Web3Storage, credentials: { proof: "EaJlcm9vdHOAZ3ZlcnNpb24BmgIBcRIg2uxHpcPYSWNtifMKFkPC7IEDvFDCxCd3ADViv0coV7SnYXNYRO2hA0AnblHEW38s3lSlcwaDjPn", }, }, outputs: { hls: { path: "/samplevideo/hls", }, mp4: { path: "/samplevideo/mp4", }, fmp4: { path: "/samplevideo/fmp4", }, }, profiles: [ { width: 1280, name: "720p", height: 720, bitrate: 3000000, quality: 23, fps: 30, fpsDen: 1, gop: "2", profile: TranscodeProfileProfile.H264Baseline, encoder: TranscodeProfileEncoder.H264, }, ], }); // Handle the result console.log(result); } run(); - lang: go label: transcodeVideo source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Transcode.Create(ctx, components.TranscodePayload{ Input: components.CreateInputInput1( components.Input1{ URL: "https://s3.amazonaws.com/bucket/file.mp4", }, ), Storage: components.CreateTranscodePayloadStorageStorage1( components.Storage1{ Type: components.StorageTypeS3, Endpoint: "https://gateway.storjshare.io", Bucket: "outputbucket", Credentials: components.StorageCredentials{ AccessKeyID: "AKIAIOSFODNN7EXAMPLE", SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", }, }, ), Outputs: components.Outputs{ Hls: &components.Hls{ Path: "/samplevideo/hls", }, Mp4: &components.Mp4{ Path: "/samplevideo/mp4", }, Fmp4: &components.Fmp4{ Path: "/samplevideo/fmp4", }, }, Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ Width: livepeergo.Int64(1280), Name: livepeergo.String("720p"), Height: livepeergo.Int64(720), Bitrate: 3000000, Quality: livepeergo.Int64(23), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), Encoder: components.TranscodeProfileEncoderH264.ToPointer(), }, }, }) if err != nil { log.Fatal(err) } if res.Task != nil { // handle response } } - lang: python label: transcodeVideo source: |- from livepeer import Livepeer from livepeer.models import components s = Livepeer( api_key="", ) res = s.transcode.create(request={ "input": { "url": "https://s3.amazonaws.com/bucket/file.mp4", }, "storage": { "type": components.StorageType.S3, "endpoint": "https://gateway.storjshare.io", "bucket": "outputbucket", "credentials": { "access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", }, }, "outputs": { "hls": { "path": "/samplevideo/hls", }, "mp4": { "path": "/samplevideo/mp4", }, "fmp4": { "path": "/samplevideo/fmp4", }, }, "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, "gop": "2", "profile": components.TranscodeProfileProfile.H264_BASELINE, "encoder": components.TranscodeProfileEncoder.H_264, }, ], }) if res.task is not None: # handle response pass "/playback/{id}": get: operationId: getPlaybackInfo summary: Retrieve Playback Info x-speakeasy-name-override: get tags: - playback parameters: - in: path name: id required: true schema: type: string description: >- The playback ID from the asset or livestream, e.g. `eaw4nk06ts2d0mzb`. responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/error" "200": description: Successful response content: application/json: schema: $ref: "#/components/schemas/playback-info" x-speakeasy-name-override: data "404": description: Playback not found content: application/json: schema: $ref: "#/components/schemas/error" x-codeSamples: - lang: typescript label: getPlaybackInfo source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.playback.get(""); // Handle the result console.log(result); } run(); - lang: go label: getPlaybackInfo source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" "context" "log" ) func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) ctx := context.Background() res, err := s.Playback.Get(ctx, "") if err != nil { log.Fatal(err) } if res.PlaybackInfo != nil { // handle response } } - lang: python label: getPlaybackInfo source: |- from livepeer import Livepeer s = Livepeer( api_key="", ) res = s.playback.get(id="") if res.playback_info is not None: # handle response pass /api/generate/text-to-image: post: tags: - generate summary: Text To Image description: Generate images from text prompts. operationId: genTextToImage requestBody: content: application/json: schema: $ref: "#/components/schemas/TextToImageParams" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/ImageResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: textToImage x-codeSamples: - lang: typescript label: genTextToImage source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.textToImage({ prompt: "", }); // Handle the result console.log(result); } run(); /api/generate/image-to-image: post: tags: - generate summary: Image To Image description: Apply image transformations to a provided image. operationId: genImageToImage requestBody: content: multipart/form-data: schema: $ref: "#/components/schemas/Body_genImageToImage" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/ImageResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: imageToImage x-codeSamples: - lang: typescript label: genImageToImage source: |- import { Livepeer } from "livepeer"; import { openAsBlob } from "node:fs"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.imageToImage({ prompt: "", image: await openAsBlob("example.file"), }); // Handle the result console.log(result); } run(); /api/generate/image-to-video: post: tags: - generate summary: Image To Video description: Generate a video from a provided image. operationId: genImageToVideo requestBody: content: multipart/form-data: schema: $ref: "#/components/schemas/Body_genImageToVideo" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/VideoResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: imageToVideo x-codeSamples: - lang: typescript label: genImageToVideo source: |- import { Livepeer } from "livepeer"; import { openAsBlob } from "node:fs"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.imageToVideo({ image: await openAsBlob("example.file"), }); // Handle the result console.log(result); } run(); /api/generate/upscale: post: tags: - generate summary: Upscale description: Upscale an image by increasing its resolution. operationId: genUpscale requestBody: content: multipart/form-data: schema: $ref: "#/components/schemas/Body_genUpscale" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/ImageResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: upscale x-codeSamples: - lang: typescript label: genUpscale source: |- import { Livepeer } from "livepeer"; import { openAsBlob } from "node:fs"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.upscale({ prompt: "", image: await openAsBlob("example.file"), }); // Handle the result console.log(result); } run(); /api/generate/audio-to-text: post: tags: - generate summary: Audio To Text description: Transcribe audio files to text. operationId: genAudioToText requestBody: content: multipart/form-data: schema: $ref: "#/components/schemas/Body_genAudioToText" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/TextResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "413": description: Request Entity Too Large content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "415": description: Unsupported Media Type content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: audioToText x-codeSamples: - lang: typescript label: genAudioToText source: |- import { Livepeer } from "livepeer"; import { openAsBlob } from "node:fs"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.audioToText({ audio: await openAsBlob("example.file"), }); // Handle the result console.log(result); } run(); /api/generate/segment-anything-2: post: tags: - generate summary: Segment Anything 2 description: Segment objects in an image. operationId: genSegmentAnything2 requestBody: content: multipart/form-data: schema: $ref: "#/components/schemas/Body_genSegmentAnything2" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/MasksResponse" x-speakeasy-name-override: data "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: segmentAnything2 x-codeSamples: - lang: typescript label: genSegmentAnything2 source: |- import { Livepeer } from "livepeer"; import { openAsBlob } from "node:fs"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.segmentAnything2({ image: await openAsBlob("example.file"), }); // Handle the result console.log(result); } run(); /api/generate/llm: post: tags: - generate summary: LLM description: Generate text using a language model. operationId: genLLM requestBody: content: application/x-www-form-urlencoded: schema: $ref: "#/components/schemas/Body_genLLM" required: true responses: default: description: Error content: application/json: schema: $ref: "#/components/schemas/studio-api-error" "200": description: Successful Response content: application/json: schema: $ref: "#/components/schemas/LLMResponse" "400": description: Bad Request content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "401": description: Unauthorized content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" "422": description: Validation Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPValidationError" - $ref: "#/components/schemas/studio-api-error" "500": description: Internal Server Error content: application/json: schema: oneOf: - $ref: "#/components/schemas/HTTPError" - $ref: "#/components/schemas/studio-api-error" x-speakeasy-name-override: llm x-codeSamples: - lang: typescript label: genLLM source: |- import { Livepeer } from "livepeer"; const livepeer = new Livepeer({ apiKey: "", }); async function run() { const result = await livepeer.generate.llm({ prompt: "", }); // Handle the result console.log(result); } run();