Start Here
camelRun v2: durable AI agent runtime and CamelFS
camelRun v2 hosts durable keyed AI agents on Cloudflare Durable Objects with CamelFS git-backed repositories, session VMs, MCP tools, and streaming.
camelRun v2 is camelAI's durable AI agent runtime served at https://run.camelai.com/v2. You define an agent by key, give it instructions, built-in suites, MCP servers, HTTP webhook tools, or local tools served over a hibernatable WebSocket. camelRun runs the model loop, stores conversation history and Git-backed workspace files in CamelFS, compacts long contexts, executes bash inside persistent session VMs, and wakes agents on schedules or inbound channels.
Upgrading from camelRun v1? camelRun v2 replaces /v1/* with /v2/*, replaces mutable volumes and mounts with CamelFS git-backed repositories (/v2/repos), and moves end-user credit enforcement to your application with per-run and per-agent spendLimitUsd. See Migrating from v1 to v2.
import { CamelRun, defineTool } from "@camelai/run";
const client = new CamelRun({
baseUrl: "https://run.camelai.com",
apiKey: process.env.CAMELRUN_API_KEY!,
});
const lookupOrder = defineTool({
name: "lookupOrder",
description: "Look up an order by ID",
parameters: {
type: "object",
properties: { orderId: { type: "string" } },
required: ["orderId"],
},
execute: ({ orderId }) => ({ orderId, status: "shipped" }),
});
const agent = await client.agents.upsert("support-triage", {
instructions: "Be concise.",
tools: [lookupOrder],
});
const run = await agent.run("What is the status of order ORD-42?");
console.log(run.text);
client.close();| API base | https://run.camelai.com/v2 |
| Health check | GET /v2/health |
| JWKS (runtime tool auth) | GET /v2/.well-known/jwks.json |
| TypeScript SDK | @camelai/run (2.0.0, zero dependencies) |
What you get
Upsert an agent by key with PUT /v2/agents/:key. History, schedules, pending inputs, and configuration persist until you delete it.
Every agent can bind a Git-backed repository at /workspace with atomic commits, branches, checkpoints, restore, and persistent bash VMs.
Run tools locally over a hibernatable WebSocket, behind HTTP webhooks, via signed MCP servers with runtime JWTs, or with built-in suites.
Pause runs on ask_human, tool approvals, or signed MCP form and URL elicitations, then resume from any process.
Delegate work to child agents or run deterministic replay-cached JavaScript workflows with wf.agent, wf.parallel, and wf.bash.
Wake agents on intervals or cron expressions, and consolidate long-term memory into /workspace/MEMORY.md while idle.
Run one-shot prompts at POST /v2/runs or classify inputs into calibrated probabilities with POST /v2/decisions.
Route Slack, email, and HTTP channels to thread-keyed agents, run realtime voice calls and sessions, render SVGs, and verify signed webhooks.
Start here
Install @camelai/run, upsert a keyed agent with a local tool, and stream its response.
Stream runs into your UI over SSE or WebSocket without exposing your tenant API key.
Work with Git-backed repositories, commits, attachments, and persistent bash sessions.
Complete reference for every /v2/* endpoint and WebSocket frame.