Skip to main content
env puts your own variables in the container. They are stored with the instance and reapplied every time the container is rebuilt, so a restart, an update, or a wake from sleep keeps them.
Your variables layer over the managed services the platform injects, so the three names above are how you point a catalog agent at your own OpenAI-compatible provider instead of the managed one. Any endpoint works, OpenRouter included; the URL is normalized to end in /v1. Spend then goes to that provider, not your Agent37 wallet, and the instance’s budget no longer applies to model calls. For a fuller setup with your own per-user metering, see Bring your own model. Six names are set by the platform and rejected with 400 invalid_request rather than silently ignored, because they tell the image which instance it is: AGENT37_INSTANCE_ID, AGENT37_RUNTIME_IMAGE_REF, AGENT37_AGENT_TYPE, AGENT37_GATEWAY_PORT, OPENCLAW_GATEWAY_PORT, and OPENCLAW_CONTROL_UI_INSTANCE_ORIGIN. env is write-only: it is not returned by GET /v1/instances/{id}, so a token you put here lives in the container alone and nothing reads it back out of the API.

Changing a variable later

PATCH /v1/instances/{id} edits the stored environment. The keys you send are set, a null value unsets that one variable, and anything you leave out stays as it is, so you never have to restate the whole environment.
The edit is stored, not injected. A container is handed its environment when it starts, so the new values arrive with the next container build: restart the instance, stop and start it, update it, or resize it. Processes already running keep the environment they started with. The instance keeps its id, its URLs, its public ports, and its disk throughout. Waking a sleeping instance is not one of those: a wake restores the sandbox exactly as it was, down to the environment its processes were holding. Restart a sleeper instead, which boots it fresh on the new values. An instance holds any number of variables, each under 128 KB and 256 KB in total. An edit is measured against the merged result, so one that would take the instance past a limit returns 400 invalid_request and changes nothing.