API referenceAgents APIEnvironmentsCreate

Create an environment

⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/environments

Define a container image for an agent’s code tools and start building it. The response arrives with build.status: "queued"; poll the environment or subscribe to the environment.build.succeeded and environment.build.failed webhooks.

For how this fits into a full workflow, see Environments.

Headers

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.
syntic-betaYes, while in previewagents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning.
Content-TypeYesapplication/json
Idempotency-KeyNoUp to 255 characters. Retrying with the same key within 24 hours returns the first result instead of creating a duplicate. See Idempotency.

Body parameters

ParameterTypeRequiredNotes
namestringYesUnique in the workspace, up to 64 characters.
base_imagestringNosyntic/base (default), syntic/python:3.12, syntic/node:22 or syntic/full.
packagesobjectNoapt, pip and npm lists; up to 200 packages in total. Pin versions for repeatable builds.
setup_scriptstringNoShell run once at build time, up to 16 KB.
filesarrayNo{file_id, path} copied in under /workspace; up to 50 files, 500 MB.
networkobjectNomode: none (default), allowlist with allowed_hosts, or open.
resourcesobjectNocpu 1-8, memory_mb 512-16384, disk_mb 1024-51200.
timeoutsobjectNocommand_seconds (max 3600), idle_minutes, max_lifetime_minutes (max 1440).
env_varsobjectNoPlain variables, readable through the API. Never secrets.
vault_secretsarrayNo{vault_id, name} injected as environment variables at container start.

Response

201 Created, Content-Type: application/json

{
  "id": "env_01JC5B2D4F6H8K0M2P4R",
  "type": "environment",
  "name": "data-analysis",
  "base_image": "syntic/python:3.12",
  "packages": {
    "apt": [
      "git"
    ],
    "pip": [
      "pandas==2.2.3",
      "matplotlib"
    ],
    "npm": []
  },
  "setup_script": "mkdir -p /workspace/out",
  "files": [],
  "network": {
    "mode": "none",
    "allowed_hosts": []
  },
  "resources": {
    "cpu": 2,
    "memory_mb": 4096,
    "disk_mb": 10240
  },
  "timeouts": {
    "command_seconds": 300,
    "idle_minutes": 15,
    "max_lifetime_minutes": 240
  },
  "env_vars": {
    "TZ": "UTC"
  },
  "vault_secrets": [],
  "build": {
    "status": "queued",
    "image_digest": null,
    "finished_at": null,
    "error": null
  },
  "created_at": "2026-11-04T08:10:02Z",
  "updated_at": "2026-11-04T08:10:02Z"
}

Examples

curl -sS https://app.syntic.ai/v1/environments \
  -H "Authorization: Bearer $SYNTIC_API_KEY" \
  -H "syntic-beta: agents-2026-11-01" \
  -H "Idempotency-Key: 8d6f0c1e-4b2a-4a57-9f0e-2f1d3c4b5a69" \
  -H "Content-Type: application/json" \
  -d '{
      "name": "data-analysis",
      "base_image": "syntic/python:3.12",
      "packages": {
        "pip": [
          "pandas==2.2.3",
          "matplotlib"
        ]
      },
      "network": {
        "mode": "none"
      },
      "resources": {
        "cpu": 2,
        "memory_mb": 4096
      }
    }'

Errors

Errors use the error envelope and carry a request_id. Codes specific to this operation:

StatustypecodeWhen
400invalid_request_errorbeta_requiredThe syntic-beta header is missing.
400invalid_request_errorunknown_base_imagebase_image is not offered.
400invalid_request_errorresource_out_of_rangeA resource or timeout is outside its range.
400invalid_request_errorinvalid_host_patternAn allowed_hosts entry is not a host or *. wildcard.
409conflict_errorname_takenAnother environment uses this name.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?