camelAI Documentation

Self-hosting

Self-hosted camelRun v2 configuration reference

Cloudflare Worker bindings, secrets, and environment variables, plus camelfsd flags and environment variables for camelRun v2.

View as Markdown

This page lists every runtime binding, secret, and flag read by the camelRun v2 Worker (worker/src/types.ts) and camelfsd (camelfsd/cmd/camelfsd/main.go).

Cloudflare Worker bindings

Configured in wrangler.jsonc (or your production Wrangler config):

BindingTypePurpose
TENANT_DODurable Object (TenantDO)Per-tenant SQLite store for keys, providers, billing, usage, definitions, repos, channels, webhooks, and rate buckets
AGENT_DODurable Object (AgentDO)Per-agent SQLite store for config, messages, compactions, runs, events, inputs, schedules, workflows, and voice sessions
VOICE_CALL_DODurable Object (VoiceCallDO)Optional Durable Object class for managed realtime voice calls (/v2/voice/calls)
MEDIA_BUCKETR2 BucketOptional R2 bucket for generated images, transcriptions, TTS audio, and resized tool images
EVENTS_QUEUEQueue producer & consumerOptional Cloudflare Queue for async webhook and channel reply delivery
IMAGESCloudflare Images bindingOptional binding used to scale down oversized image attachments before model calls
SVG_RENDERERService FetcherOptional Worker service binding backing POST /v2/images/render and the render_image built-in

Worker secrets and environment variables

Store secrets with wrangler secret put or --secrets-file (kept outside version control). Never commit production secrets to wrangler.jsonc.

Core security and CamelFS

VariableRequiredDescription
ADMIN_SECRETYesShared secret checked in X-Admin-Key for POST /v2/tenants and POST /v2/billing/credits
VAULT_SECRETYesMaster key used to derive the AES-GCM key sealing provider keys, agent tokens, webhook secrets, and channel secrets
CAMELFS_URLYesBase HTTP(S) URL of the camelfsd service (for example http://127.0.0.1:8790 locally)
CAMELFS_SIGNING_KEYProductionEd25519 signing key formatted as <kid>:<base64url-ed25519-seed> (or PKCS8 PEM) used to mint short-lived camelfs+jwt tokens
CAMELFS_DEV_TOKENDev onlyShared bearer fallback for local camelfsd development when CAMELFS_SIGNING_KEY is unset
TOOL_IDENTITY_ISSUERFor signed MCPIssuer URL placed in iss of runtime tool JWTs (for example https://run.camelai.com/v2)
TOOL_IDENTITY_PRIVATE_JWKFor signed MCPJSON Ed25519 private JWK (kty: "OKP", crv: "Ed25519", x, d, kid). Public half is served at GET /v2/.well-known/jwks.json

Models, providers, and voice

VariableDescription
DEFAULT_MODELDefault model ID when an agent or run omits model (code fallback: azure/gpt-6.2-sol)
AZURE_OPENAI_SOL_ENDPOINTAzure OpenAI resource endpoint serving the gpt-6.2-sol deployment
AZURE_OPENAI_SOL_API_KEYAPI key for the platform Azure gpt-6.2-sol deployment
OPENAI_API_KEYPlatform OpenAI API key (models, transcription, speech, images, moderation, realtime voice)
ANTHROPIC_API_KEYPlatform Anthropic API key
GEMINI_API_KEYPlatform Google Gemini API key
OPENROUTER_API_KEYPlatform OpenRouter API key
ELEVENLABS_API_KEYPlatform ElevenLabs API key (voice search and realtime calls)
VOICE_OPENAI_BASE_URLOptional base URL override for OpenAI Realtime API
VOICE_ELEVENLABS_BASE_URLOptional base URL override for ElevenLabs API
VOICE_PUBLIC_URLOptional public base URL used for ElevenLabs callback URLs
AGENT_VOICE_SESSIONS_PER_TENANTMaximum concurrent active voice calls per tenant (default 50)

camelfsd flags and environment variables

Each flag accepts a matching CAMELFSD_* environment variable:

FlagEnvironment variableDefaultDescription
--listenCAMELFSD_LISTEN127.0.0.1:8790HTTP listen address
--data-dirCAMELFSD_DATA_DIR./dataData directory for local backend and VM sockets/workspaces
--backendCAMELFSD_BACKENDlocalStorage backend: local (SQLite + FS) or aws (DynamoDB + S3)
--vm-driverCAMELFSD_VM_DRIVERlocalVM driver: local, firecracker, or remote
--public-keysCAMELFSD_PUBLIC_KEYS(empty)Comma-separated <kid>:<base64url-32-byte-ed25519-pubkey> entries verifying Worker JWTs
--dev-tokenCAMELFSD_DEV_TOKEN(empty)Shared bearer token for local development
--host-tokenCAMELFSD_HOST_TOKEN(empty)Shared token authenticating outbound compute hosts
--s3-bucketCAMELFSD_S3_BUCKET(empty)S3 bucket for content-addressed trees and blobs (--backend=aws)
--ddb-repos-tableCAMELFSD_DDB_REPOS_TABLEcamelfs-reposDynamoDB table for lineages, refs, and leases (PK, SK)
--ddb-vms-tableCAMELFSD_DDB_VMS_TABLEcamelfs-vmsDynamoDB table for VM sessions, exec receipts, and hosts (PK, SK)
--firecracker-binCAMELFSD_FC_BINfirecrackerPath to the firecracker binary
--firecracker-jailerCAMELFSD_FC_JAILER(empty)Path to the matching Firecracker jailer binary
--firecracker-kernelCAMELFSD_FC_KERNEL(empty)Absolute path to the Firecracker guest kernel image
--firecracker-rootfsCAMELFSD_FC_ROOTFS(empty)Absolute path to the Firecracker guest rootfs ext4 image