Skip to content

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/start
Content-Type: application/json
type 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/register
Content-Type: application/json
type 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/unregister
Content-Type: application/json
type 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. Value 0 represents time of the start request.

Update output

POST: /api/output/:output_id/update
Content-Type: application/json
type 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. Value 0 represents time of the start request.

Request keyframe

POST: /api/output/:output_id/request_keyframe
Content-Type: application/json
type RequestBody = {}

Requests additional keyframe (I frame) on the video output.

Inputs configuration

Register input

POST: /api/input/:input_id/register
Content-Type: application/json
type 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/unregister
Content-Type: application/json
type 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. Value 0 represents time of the start request.

Resources configuration

Register image

POST: /api/image/:image_id/register
Content-Type: application/json

Register an image asset. Request body is defined in the image docs.

Unregister image

POST: /api/image/:image_id/unregister
Content-Type: application/json
type RequestBody = {}

Unregister a previously registered image asset with an id :image_id.

Register shader

POST: /api/shader/:shader_id/register
Content-Type: application/json

Register a shader. Request body is defined in the shader docs.

Unregister shader

POST: /api/shader/:shader_id/unregister
Content-Type: application/json
type RequestBody = {}

Unregister a previously registered shader with an id :shader_id.

Register web renderer instance

POST: /api/web-renderer/:instance_id/register
Content-Type: application/json

Register a web renderer instance. Request body is defined in the web renderer docs.

Unregister web renderer instance

POST: /api/web-renderer/:instance_id/unregister
Content-Type: application/json
type RequestBody = {}

Unregister a previously registered web renderer instance with an id :instance_id.

Register font

POST: /api/font
Content-Type: multipart/form-data

Upload additional fonts to the Smelter server. After request completes, you can start using new fonts with a Text component.

Status endpoint

GET: /status
Content-Type: application/json
type Response = {
instance_id: string
}

Status/health check endpoint. Returns 200 OK.

  • instance_id - ID that can be provided using SMELTER_INSTANCE_ID environment variable. Defaults to random number.

WebSocket endpoint

GET: /ws

Establish WebSocket connection to listen for Smelter events. List of supported events and their descriptions can be found here.