Getting Started
Train browser agents on Trayn sandboxes.
Trayn turns recorded browser workflows into safe, server-backed sandboxes for agent training. The app owns recordings, API keys, agents, datasets, runs, grading, and memory. Your agent runtime connects to an active training run.
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 workflow
Use the Trayn browser extension to record the workflow. The app builds an anonymized sandbox and task definition with a goal and verifiers.
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
training run, and gives the sandbox one active trainingRunId.
TRAYN_API_KEY is required for every machine-runtime path: OpenClaw plugin,
SDK harness, CLI/TUI, memory retrieval, live timeline streaming, run state, and
grading. The CLI exits before starting a browser if the key is missing.
Run Identity
Every external integration uses these IDs:
| ID | Purpose |
|---|---|
agentId | Selects the agent and its memory corpus. |
experimentId | Groups related child runs. |
trainingRunId | Selects the active sandbox state, grading, timeline, and memory flow. |
Recorded sessions and dataset tasks are selected in the app before execution.
During execution, trainingRunId is the canonical run ID.
Sandbox training URLs have this shape:
https://app.trayn.ai/sandbox/{host}/{sessionId}?sandbox_overlay=training_run&training_run_id={trainingRunId}Dataset tasks use the same run flow. Select the dataset task in the app, then
run the sandbox with the resulting trainingRunId.
Connect Your Agent
Use one of the supported paths:
| Path | Use when |
|---|---|
| Trayn Cloud | You want Trayn to host and run the agent. |
| OpenClaw plugin | You already run OpenClaw and want its plugin to handle Trayn step capture, memory, and grading. |
@trayn/agent-sdk | You 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.