palbaseDocs

Palbase ai · API

PUT/ai/environments/{name}

Create or update a runtime environment

Upserts a runtime environment by name.

Called by your server, with the project's secret key.

Path

namestring · requiredThe environment's name.

Request body

namestring · optionalEnvironment name (required on POST /ai/environments; ignored when provided in the path on PUT).
runtimeobject · optionalContainer image, Dockerfile, Mac VM profile, and pre-install setup commands for an environment.
mode"ephemeral" | "always_on" · optionalLifecycle mode: ephemeral or always_on.
isolation"strict" | "relaxed" · optionalSandbox isolation posture.
resourcesobject · optionalCompute and idle lifecycle limits for an environment.
scalingobject · optionalWarm pool and concurrency scaling bounds.
networkobject · optionalOutbound network egress policy and Palbase DB connectivity.
curl
curl -X PUT "https://<your-ref>.palbase.studio/ai/environments/<name>" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"string","runtime":{"image":"string","dockerfile":"string","vm_profile":"macos-xcode","setup":["string"]},"mode":"ephemeral","isolation":"strict","resources":{"cpu":1,"memory_mb":256,"disk_mb":1024,"idle_timeout_seconds":0},"scaling":{"min_warm":0,"max_instances":1},"network":{"egress":"default","allow_palbase_db":false,"allow_hosts":["string"]}}'

Responses

200The saved environment

400The request is malformed, or names what this module does not offer (the error names which)

401No valid credential

403A publishable key or a user's session: everything here is the project's server's, called with the secret key

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation PutEnvironment of ai's contract.