Skip to content

Configuration ​

The control plane reads .env in the install directory (mode 600). VM2API_* overrides the older KIN_* name when both are set. A full copy for systemd lives at docs/deploy/env.example in the product repository.

Changing .env needs a control-plane restart. It does not, by itself, replace the kernel already running inside a slot.

Required ​

VariablePurpose
VM2API_API_KEYMaster key. Calls /v1/* and the panel API. Generated when empty.
VM2API_ADMIN_USERConsole user. Default admin.
VM2API_ADMIN_PASSWORDConsole password. Empty becomes 123456 and an existing value is kept.
VM2API_DB_SECRETDatabase secret. Generated when empty.

Listen and paths ​

VariableDefaultPurpose
PORT8787HTTP port
HOST0.0.0.0Bind address
PUBLIC_BASE_URLunsetPublic origin, when you terminate TLS in front
KIN_PROJECT_ROOT/opt/vm2apiInstall directory
KIN_DATA_DIR/opt/vm2api/dataSQLite and runtime data
KIN_KERNEL_BIN/opt/vm2api/bin/kin-kernelKernel used when creating or syncing a slot
KIN_EGRESS_BIN/opt/vm2api/bin/kin-egressEgress binary
KIN_WORKER_BIN/opt/vm2api/bin/kin-workerWorker binary
VM2API_HOST_ROOTunsetHost path of the install directory, if Docker inspect cannot see it
KIN_VM_MEMORY1g for new native Claude slotsMemory cap applied when a slot container is created
KIN_MAX_BODY128MBRequest body cap. Over the limit returns 413 before account selection

Optional ​

VariablePurpose
GITHUB_TOKEN or VM2API_GITHUB_TOKENHigher GitHub release rate limit for the in-console update check
VM2API_CLUSTER_SOCKET_DIRDirectory for cluster Docker-bridge sockets. Default is $KIN_DATA_DIR/cluster. Move it to a local filesystem if the data directory cannot hold a Unix socket
KIN_PROXY_GEO_V6_IP_URLIPv6 probe used by proxy geo lookup. Default https://ipv6.icanhazip.com

Compatibility layout ​

Persona and cleanup are stored as routing config, not as env vars. The console model / system pages edit them. The product names are:

LayoutBehavior
zeroNo injected system persona
officialOfficial-shaped identity, without the full prompt pack
official_fullFull official identity pack
customA template you store yourself

web_search is added only on the last user turn, and only when that turn mentions search, unless the client already declared the tool or turned it off (web_search: false, x-kin-web-search: false, or tool_choice: none). Official Claude Code inbound traffic does not get an injected search tool.

OpenAI quota object ​

Saved under routing settings, not .env:

json
{"codex":{"quota":{"limit_5h":1,"limit_7d":1,"max_concurrency":2,"max_rpm":0,"max_sessions":0}}}

Claude tier limits and this object are independent. A per-slot number overrides the platform value. null on the slot clears the override.

What not to put in the client ​

  • Do not ship VM2API_API_KEY inside an end-user app. Issue an sk-vm-… key.
  • Do not commit .env, data/, or any slot credentials.json.

Software use is Non-commercial. See the product license in the vm2api repository.