POST
Create an environment

Authorizations

Authorization
string
header
required

A server API key, ask_.... Carries a role.

Headers

Idempotency-Key
string

Up to 255 characters. The key is scoped to the calling principal, the HTTP method, the path and the key. Only 2xx responses are stored, for 24 hours. The same key with the same body replays the stored response, with the response header Idempotency-Replayed: true. The same key with a different body is 422 idempotency_key_reuse. If the first request is still running, the answer is 409 idempotency_in_progress; a record in progress for more than 60 seconds is taken over by the new request. A key that is longer than 255 characters or not printable ASCII is 400 invalid_idempotency_key.

Maximum string length: 255

Body

application/json
name
string
required
Required string length: 1 - 100
network
enum<string>

none blocks all outbound traffic. limited allows only allowed_hosts. full allows any host.

Available options:
none,
limited,
full
allowed_hosts
string[]

Used when network is limited. Exact hostnames, optionally with a port.

git
object
mcp
object
image
string
packages
any
metadata
object

Response

The new environment.

id
string
required
object
string
required
Allowed value: "environment"
name
string
required
network
enum<string>
required

none blocks all outbound traffic. limited allows only allowed_hosts. full allows any host.

Available options:
none,
limited,
full
allowed_hosts
string[]
required
git
object
required
mcp
object
required
image
string | null
required
packages
object
required
metadata
object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
worker_count
integer

Workers that claimed or heartbeat in the last 60 seconds.

queue_depth
integer

Work items waiting to be claimed.