camelRun by camelAI
Self-hosted AI agents
Deploy open-source camelRun v2 to your own Cloudflare account with Wrangler, or test it on your own machines with celld (experimental). Your Durable Objects, R2 repos, and secrets stay in your account, and the same v2 API runs on run.camelai.com.
npx wrangler deploy -c worker/wrangler.pilot.jsonc
wrangler deploy 0/2
Worker camelrun · DO + R2UploadingContainer camelfs-linux · Cloudflare ContainersBuildingcd ~/hello-agent
export CAMELRUN_BASE_URL=https://agents.yourcompany.com
export CAMELRUN_API_KEY=cr_live_...
python hello.py
Hello! ¡Hola! Bonjour!
Same v2 API
The same AI agent code, hosted or self-hosted
Point CAMELRUN_BASE_URL at run.camelai.com or at your own Cloudflare Worker deployment. Every v2 REST, SSE, WebSocket, and MCP endpoint is identical, so nothing else in your agent code changes.
import os, requests
BASE = os .environ .get( "CAMELRUN_BASE_URL", "https://run.camelai.com")
HEADERS = {"Authorization": f"Bearer {os.environ['CAMELRUN_API_KEY']}"}
requests .put(
f"{BASE}/v2/agents/hello",
headers=HEADERS,
json={"model": "openrouter/openai/gpt-6-luna", "instructions": "Be concise."},
)
run = requests .post(
f"{BASE}/v2/agents/hello/runs",
headers=HEADERS,
json={"prompt": "Say hello in three languages.", "wait": True},
) .json()
print( run["text"])export CAMELRUN_BASE_URL=https://agents.yourcompany.comexport CAMELRUN_API_KEY=cr_live_...export CAMELRUN_API_KEY=cr_live_...Deploy to your own Cloudflare
camelRun v2 runs on Cloudflare Workers, SQLite Durable Objects, R2, Queues, Containers, and Browser Rendering — with no Postgres and no servers to babysit. Deploy your own copy with Wrangler, or test running the same code on your own machines with celld (experimental).
git clone https://github.com/ qaml-ai/ run
cd run/v2 && npm ci
# edit account_id, routes, and Worker secrets (ADMIN_SECRET, VAULT_SECRET, TOOL_IDENTITY_PRIVATE_JWK)
npx wrangler deploy -c codemode-sandbox/wrangler.jsonc
npx wrangler deploy -c svg-renderer/wrangler.jsonc
npx wrangler deploy -c worker/ wrangler.pilot.jsonc
curl -s https://agents.yourcompany.com/ v2/ health
{"ok":true,"service":"camelrun-worker-v2"}- Cloudflare
- Workers plan with SQLite Durable Objects, R2, Queues, Containers, Browser Rendering, and Images.
- Build tools
- Node 22+, Go 1.24+, and Wrangler. Update account_id, routes, and Worker secrets for your account.
- Provider keys
Store keys per tenant over the v2 API (sealed with your VAULT_SECRET), or as Worker secrets.PUT /v2/providers/:provider - Own machines
- Run the same Durable Objects, R2, Queues, and Containers stack outside Cloudflare with celld (experimental).
Your account boundary
Keep agent state and secrets in your own account
Your Durable Objects, R2 repositories, VAULT_SECRET, and Ed25519 tool-signing key stay inside your Cloudflare account. Outbound MCP and webhook tool calls go through camelRun's SSRF guard and never follow redirects to private addresses.
ADMIN_SECRET=<operator-bootstrap-key>
VAULT_SECRET=<seals-tenant-provider-keys>
TOOL_IDENTITY_ISSUER=https://agents.yourcompany.com/v2
TOOL_IDENTITY_PRIVATE_JWK=<ed25519-private-jwk>ADMIN_SECRET= <operator-bootstrap-key>
VAULT_SECRET= <seals-tenant-provider-keys>
TOOL_IDENTITY_ISSUER= https://agents.yourcompany.com/ v2
TOOL_IDENTITY_PRIVATE_JWK= <ed25519-private-jwk>Data portability
Read out agent history and files over v2 REST
State in camelRun v2 lives in per-agent SQLite Durable Objects and versioned camelFS repositories in R2. There is no single-click account ZIP export yet, so you can inspect and copy any agent's config, paged conversation history, and camelFS files directly through the v2 REST API.
- GET /
v2/ agents/ :key PUT /v2/agents/:key - GET /
v2/ agents/ :key/ history paged JSON history - GET /
v2/ repos/ :id/ files POST /v2/repos/:id/write
curl -sf "https://run.camelai.com/v2/agents/hello/history?after=0&limit=50" -H "Authorization: Bearer $CAMELRUN_API_KEY"curl -sf "https://run.camelai.com/ v2/ agents/ hello/ history?after= 0& limit= 50" -H "Authorization: Bearer $CAMELRUN_API_KEY"An open source AI agent platform you can read, run and fork
The v2 runtime and its console are AGPL-3.0. The SDKs, plugins, and examples are MIT, so they go in any app. If the AGPL doesn't work for your organization, camelAI offers the runtime under a commercial license too.
- v2/worker/API Worker, SQLite Durable Objects and R2
- v2/codemode-sandbox/QuickJS codemode Worker
- v2/ingress/Edge router and console ingress
- console/The web console
- sdk/TypeScript client SDK
- plugins/Agent plugins
- examples/Runnable examples
Questions about self-hosted AI agents
Can I self-host an AI agent platform?
- Yes. Deploy the AGPL-3.0 runtime from
qaml-ai/runto your Cloudflare account with Wrangler, or try the experimentalcelldstack on your own machines. Where does my agents' data live when I self-host?
- Agents' history and files stay in your Cloudflare account, in SQLite Durable Objects and versioned
camelFSrepos in R2. YourVAULT_SECRETseals provider keys, and model calls go to the configured providers over HTTPS. Is camelRun open source?
- Yes. The runtime is AGPL-3.0-only, with MIT SDKs, plugins, and examples. Commercial licensing is available through camelai.com. Hosted pricing is $0.05 per active agent-hour and $0.18/hr for active Linux containers ($0.00005/sec), with free pre-warming. Idle time and storage cost $0.
What do I need to run camelRun myself?
- You need Workers, SQLite Durable Objects, R2, Queues, Containers, Browser Rendering, and Images in your Cloudflare account, plus Node 22+, Go 1.24+, Wrangler, and model keys. Set your account ID, routes, and secrets in the
v2/Wrangler configs. How do I upgrade a self-hosted camelRun?
- Pull the latest
qaml-ai/runcommit and runnpx wrangler deploy. SQLite migrations apply automatically, checkpoints survive deploys, and the rollout gives runs in progress time to finish. Do I have to manage Postgres or multi-node clusters?
- Cloudflare scales keyed agents across SQLite Durable Objects, with R2 for
camelFSrepos and Queues for webhook delivery. There's no Postgres server, Docker cluster, or manual sharding to manage.
Is the self-hosted API the same as the hosted one?
- Yes. Both serve the same v2 REST, SSE, WebSocket, and MCP routes. Set
CAMELRUN_BASE_URLto your Worker hostname and use a tenant key created viaPOST /v2/tenantswith yourADMIN_SECRET. Can I move my agents between run.camelai.com and my own deployment?
- Use the v2 API to read agent configs with
GET /v2/agents/:key, page through history withGET /v2/agents/:key/history, and read or write workspace files through/v2/repos/:repoId.
More on camelRun
- OverviewcamelRunThe runtime for AI agents: the loop, history, tools, channels and pricing.
- ComparisonClaude Managed Agents alternativeKeep your Anthropic SDK and use the Claude Managed Agents API at /anthropic/v1 with a camelRun key. Sessions run as durable keyed agents on Cloudflare.
- ComparisonLetta AI alternativeCompare how Letta and camelRun keep agent state. In camelRun, each keyed agent gets its own conversation history and versioned workspace.
- camelRun featureDurable AI agentsKeyed agents keep their history, versioned camelFS workspaces, and pending runs in camelRun. Fork any agent and its repo instantly at any step (atSeq).
- camelRun featureMCP agentsConnect agents to remote HTTP MCP tools. Use the hosted MCP server at /mcp with OAuth 2.1 or connect to one agent at /v2/agents/:key/mcp.
- camelRun featureMulti-tenant AI agentsGive each user or thread a keyed agent with its own history and workspace. Runtime-authenticated MCP calls carry Ed25519-signed JWTs proving the agent and end-user.
- ComparisonsManaged agents comparedCompare managed agent platforms by where agents run, which models they support, how they keep state, and how you can migrate.
- From the blogcamelAI is going open source. Here's whyWhy camelAI opens its products' source, starting with camelCode.
- DocsSelf-host camelRunCloudflare bindings, Wrangler configs, Worker secrets, and deploying your own copy.
Start hosted or in your own cloud
Get an API key and run on run.camelai.com at $0.05 per active agent-hour ($0 while idle), or clone qaml-ai/run and deploy camelRun v2 to your own Cloudflare account with Wrangler.