Get or create an unnamed environment for a composed stack
GET-OR-CREATE an UNNAMED, content-addressed environment for a composed stack: a host plus an optional server group and model override. The environment does not appear in the project’s list of named environments.
Deduplicated by a server-side fingerprint of the stack, so the same stack always returns the same environment. created says which happened: the status is 200 either way, because get-or-create cannot honestly answer 201 on the dedupe path.
A deployment that predates ad-hoc environments answers 400 with details.reason: "ADHOC_UNAVAILABLE".
Requires project membership.
Authorizations
MCPJam API key (sk_…). Create one at Settings → API keys. Guest sessions cannot use the API, and API keys cannot manage other API keys.
Body
A composed stack: the same execution axes a named environment carries, minus the name.
Which PROJECT SECRETS a run launched from this environment receives: ids only. The environment is the GRANT BOUNDARY: absent means no secrets, and there is no "all of them" mode. Cannot be empty; clear the field instead (send null on update) to revoke the grant.
Membership is not delivery. A sharing: user secret selected here reaches ONLY sessions its owner started; every other member's run of this environment silently does not receive it, and that rule is re-checked live at launch rather than baked into the selection.
Response
The environment for this stack, created or reused.
An UNNAMED, content-addressed environment: a composed client/model/computer/skills stack rather than a saved entry in the project's environment list. Its own shape rather than ProjectEnvironment with a nullable name, because that schema's name is required and every environment listing filters ad-hoc rows out precisely so that promise holds.

