Using Node.js 22+? The JavaScript SDK quickstart
covers
@erstan/sdk, including its current private-beta installation path,
typed run helpers, and handling of pauses. This page remains the direct HTTP
alternative; no SDK is required.1. Create an API key
In Erstan, open Settings -> API Keys -> Create Key. Select these scopes:ers_live_... secret when it is shown.
2. Set environment variables
3. List available agents
defaultLaneId is present, the agent has one public lane and you can omit laneId when starting a run.
4. Inspect an agent
id returned here is the same lane ID used in the Erstan frontend.
5. Start a run
For a single-lane agent that accepts fields:laneId:
6. Poll for results
finalResponse contains the agent’s final output.
7. Cancel a run
Cancellation is an explicit, idempotent request. A run first reportscancelling; it becomes cancelled when the owning worker acknowledges the
signal or its lease expires.
JavaScript without the SDK
The following is a directfetch illustration. For bounded polling, typed
errors, interactions, and continuation helpers, see the
SDK reference. Select an Agent and lane explicitly;
do not run the first discovered Agent automatically.