Trigger from your code
Start a new agent session from your own code. No browser needed. Use this to open sessions from CI, webhooks, or scripts, then drive them over the connection URL.
In the UI
In the UI
-
Open Sessions in the sidebar and click New session.
-
Choose a project and agent, then type your prompt.
-
Click Run. The session starts immediately.
Programmatically
Creating a session opens the agent’s sandbox and returns the session object. You then drive the session over its connection URL, or read its messages back. To start a session that runs a prompt on its own with no connection, schedule a cron trigger. The trigger’s inputMessage is the prompt the agent receives on each fire.
Create a session
ren sessions create \ --pod-id pod_abc123 \ --project-id prj_def456 \ --title "Weekly report"List sessions
ren sessions list --project-id prj_def456Get a session’s connection URL (for driving the session or opening it in a coding agent)
ren sessions url ses_abc123Create a session
curl -X POST https://api.renai.build/api/sessions \ -H "Authorization: Bearer $REN_PAT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "podId": "pod_abc123", "projectId": "prj_def456", "title": "Weekly report" }'List sessions
curl "https://api.renai.build/api/sessions?projectId=prj_def456" \ -H "Authorization: Bearer $REN_PAT_TOKEN"Get a session’s connection URL
curl "https://api.renai.build/api/sessions/ses_abc123/url" \ -H "Authorization: Bearer $REN_PAT_TOKEN"import { createRenClient, pat } from "@renai-labs/sdk"
const client = createRenClient({baseUrl: "https://api.renai.build",auth: pat(process.env.REN_PAT_TOKEN!),})
// Create a sessionconst { data: session, error } = await client.session.create({body: {podId: "pod_abc123",projectId: "prj_def456",title: "Weekly report",},})if (error) throw errorconsole.log(session.id, session.status) // "ses_abc123" "idle"
// Get its connection URL to drive the sessionconst { data: url } = await client.session.url({ path: { id: session.id } })console.log(url.authedUrl) // "https://…"