Skip to main content

JavaScript Endpoints Guide

Interacting with Tensor One Endpoints is a core feature of the JavaScript SDK. This guide covers synchronous & asynchronous execution, polling status, streaming output, health checks and job control.

Prerequisites

Before continuing, ensure you have:
  • Installed the SDK: tensorone-sdk
  • Set your API key and Endpoint ID

SDK Initialization


Run the Endpoint

Synchronous Execution

Asynchronous Execution


Polling Status of an Async Job


Streaming Output

Your handler must support return_aggregate_stream: true to enable streaming:

Check Endpoint Health


Check Job Status


Cancel a Job


Set a Timeout for Execution


Set an Execution Policy


Purge the Queue

Use these SDK methods to efficiently integrate, monitor, and control your serverless endpoints in any JavaScript-based application.