Integrate APIs
Call public or custom functions from anywhere.
Running functions via API
You can run any function via the Push endpoint.
For this example, we are using the Dubbing API. You can explore more API functions through the explore page and use them as sieve/function-name
.
The response will be a JSON object describing the job. Use the job id
from this response to get the status and outputs of the job. For more information, refer to the Job Outputs endpoint.
Alternatively, you can monitor your job in the dashboard where you can visualize outputs.
Function inputs and outputs vary by function. Please refer to the respective function’s Usage Guide for more information about integration.
Running functions via API
You can run any function via the Push endpoint.
For this example, we are using the Dubbing API. You can explore more API functions through the explore page and use them as sieve/function-name
.
The response will be a JSON object describing the job. Use the job id
from this response to get the status and outputs of the job. For more information, refer to the Job Outputs endpoint.
Alternatively, you can monitor your job in the dashboard where you can visualize outputs.
Function inputs and outputs vary by function. Please refer to the respective function’s Usage Guide for more information about integration.
Running functions in Python
You can also reference and run functions directly in Python. This approach offers several key benefits:
- Functions return Python objects directly rather than JSON
- Asynchronous job handling is supported without the need to poll for outputs or job status
- Calling a function from inside a Sieve function is faster and takes advantage of file caching. Contact us to learn more.
Here, output_object.path
will contain the local path(s) to the output file(s).
Alternatively, you can monitor your job in the dashboard where you can visualize outputs.
Function inputs and outputs vary by function. Please refer to the respective function’s Usage Guide for more information about integration.
The Sieve Python client supports both synchronous and asynchronous function execution. Let’s use the Dubbing API as an example.
You can also push
to a function’s queue and wait for the request to complete asynchronously. This is particularly beneficial when sending multiple requests simultaneously. The push
method returns a Python future, which can be used with other Python async utilities.
For functions that return a single output, .result()
will block until the
output is ready. For functions that return multiple outputs, .result()
will
return immediately with a generator object. Iterating over the generator will
block until each output is ready.
The job result object may or may not be a generator, depending on the function. For example, the Lipsync API returns a single output rather than a generator. Here’s how to use it asynchronously: