Trayntrayn.ai

Getting Started

Train browser agents on Trayn sandboxes.

Trayn turns recorded browser tasks into safe, server-backed sandboxes for agent rollouts. The app owns recordings, API keys, agents, tasksets, runs, judging, and memory. Your agent runtime connects to an active rollout.

Setup

Sign in

Open app.trayn.ai and sign in. Use the same account or organization for recordings, agents, API keys, and run results.

Create an API key

Open API Keys in the app sidebar, create a key, and set it in the runtime that will call Trayn.

export TRAYN_API_KEY="<api-key-from-trayn>"
export TRAYN_APP_URL="https://app.trayn.ai"

Record a task

Use the Trayn browser extension to record the task. The app builds an anonymized sandbox and task definition with a goal and recorded session interactions.

Create an agent

Open Agents. Use Trayn Cloud for a hosted OpenClaw agent, or Trayn SDK when you want to run your own agent code.

Start a run

Start a run from the agent page. The app creates the experiment, creates the rollout, and gives the sandbox one active rolloutId.

TRAYN_API_KEY is required for every machine-runtime path: OpenClaw plugin, SDK harness, CLI/TUI, memory retrieval, live timeline streaming, run state, and judging. The CLI exits before starting a browser if the key is missing.

Run Identity

Every external integration uses these IDs:

IDPurpose
agentIdSelects the agent and its memory corpus.
experimentIdGroups related child runs.
rolloutIdSelects the active sandbox state, judging, timeline, and memory flow.

Recorded sessions and taskset tasks are selected in the app before execution. During execution, rolloutId is the canonical run ID.

Sandbox rollout URLs have this shape:

https://app.trayn.ai/sandbox/{host}/{sessionId}?sandbox_overlay=rollout&rollout_id={rolloutId}

Taskset tasks use the same run flow. Select the taskset task in the app, then run the sandbox with the resulting rolloutId.

Connect Your Agent

Use one of the supported paths:

PathUse when
Trayn CloudYou want Trayn to host and run the agent.
OpenClaw pluginYou already run OpenClaw and want its plugin to handle Trayn step capture, memory, and judging.
@trayn/agent-sdkYou want to implement the action loop yourself in TypeScript or run the packaged CLI.

See Connect Your Agent for the OpenClaw plugin config, SDK interface, CLI command, and memory client shape.

On this page