Routes
API is served by default on the port 8081. Different port can be configured using SMELTER_API_PORT environment variable.
Start request
POST: /api/startContent-Type: application/jsontype RequestBody = {}Starts the processing pipeline.
If an output was registered before the start request, then actual output stream will start producing video/audio after this request.
Outputs configuration
Register output
POST: /api/output/:output_id/registerContent-Type: application/jsontype RequestBody = { type: "rtp_stream" | "mp4" | "whip" ... // output specific options}Register external destination that can be used as a Smelter output. See outputs documentation to learn more.
Unregister output
POST /api/output/:output_id/unregisterContent-Type: application/jsontype RequestBody = { schedule_time_ms?: number;}Unregister a previously registered output with an id :output_id.
schedule_time_ms- Time in milliseconds when this request should be applied. Value0represents time of the start request.
Update output
POST: /api/output/:output_id/updateContent-Type: application/jsontype RequestBody = { video?: { root: Component }; audio?: { inputs: AudioInput[]; }; schedule_time_ms?: number;}
type AudioInput = { input_id: InputId; volume?: number;}Update scene definition and audio mixer configuration for output with ID :output_id. The output stream has to be registered first. See register output request.
video- Configuration for video output.video.root- Root of a component tree/scene that should be rendered for the output.audio- Configuration for audio output.audio.inputs- Input streams that should be mixed together and their configuration.audio.inputs[].input_id- Input ID.audio.inputs[].volume- (default=1.0) Float in[0, 1]range representing volume.schedule_time_ms- Time in milliseconds when this request should be applied. Value0represents time of the start request.
Request keyframe
POST: /api/output/:output_id/request_keyframeContent-Type: application/jsontype RequestBody = {}Requests additional keyframe (I frame) on the video output.
Inputs configuration
Register input
POST: /api/input/:input_id/registerContent-Type: application/jsontype RequestBody = { type: "rtp_stream" | "mp4" | "decklink" | "whip"; ... // input specific options}Register external source that can be used as a Smelter input. See inputs documentation to learn more.
Unregister input
POST: /api/input/:input_id/unregisterContent-Type: application/jsontype RequestBody = { schedule_time_ms?: number;}Unregister a previously registered input with an id :input_id.
schedule_time_ms- Time in milliseconds when this request should be applied. Value0represents time of the start request.
Resources configuration
Register image
POST: /api/image/:image_id/registerContent-Type: application/jsonRegister an image asset. Request body is defined in the image docs.
Unregister image
POST: /api/image/:image_id/unregisterContent-Type: application/jsontype RequestBody = {}Unregister a previously registered image asset with an id :image_id.
Register shader
POST: /api/shader/:shader_id/registerContent-Type: application/jsonRegister a shader. Request body is defined in the shader docs.
Unregister shader
POST: /api/shader/:shader_id/unregisterContent-Type: application/jsontype RequestBody = {}Unregister a previously registered shader with an id :shader_id.
Register web renderer instance
POST: /api/web-renderer/:instance_id/registerContent-Type: application/jsonRegister a web renderer instance. Request body is defined in the web renderer docs.
Unregister web renderer instance
POST: /api/web-renderer/:instance_id/unregisterContent-Type: application/jsontype RequestBody = {}Unregister a previously registered web renderer instance with an id :instance_id.
Register font
POST: /api/font/registerContent-Type: multipart/form-dataUpload additional fonts to the Smelter server. After request completes, you can
start using new fonts with a Text component.
Status endpoint
GET: /statusContent-Type: application/jsontype Response = { instance_id: string}Status/health check endpoint. Returns 200 OK.
instance_id- ID that can be provided usingSMELTER_INSTANCE_IDenvironment variable. Defaults to random number.
WebSocket endpoint
GET: /wsEstablish WebSocket connection to listen for Smelter events. List of supported events and their descriptions can be found here.