codai · Schema

Environment

The stored environment row (camelCase, as persisted) plus snake_case `for_user_id` and, when known, the project's `isolation`. `metadata` never contains the enrolment token hash.

CompanyArtificial IntelligenceCode GenerationDeveloper ToolsLLM GatewayOpenAI-CompatibleModel RoutingRomania

Properties

Name Type Description
id string
projectId string
ownerUserId string
orgId stringnull
forUserId stringnull In `vm_per_dev` projects, the developer this machine is pinned to.
for_user_id stringnull Same as `forUserId` (snake_case convenience).
isolation object
name string
slug string Globally unique preview hostname label (`https://-.preview.codai.ro`).
provider object
region stringnull
size stringnull
state object
stateReason stringnull
deviceId stringnull The daemon's device row once enrolled.
providerRef stringnull Provider-side id (server id, container id).
publicIp stringnull
idleTimeoutMinutes integer
lastActivityAt stringnull
startedAt stringnull
stoppedAt stringnull
hourlyRateMicroEur integernull Managed providers only; micro-EUR per hour.
includedHoursUsedSeconds integer
metadata object Provider/daemon facts, e.g. `daemon: { version, os, arch, enrolled_at }`, `budget_micro_eur`.
prebuild boolean True for an unclaimed prebuild pool machine (owned by the project owner); cleared when claimed.
createdAt string
updatedAt string
View JSON Schema on GitHub

JSON Schema

codai-ro-environment-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-environment-schema.json",
  "title": "Environment",
  "description": "The stored environment row (camelCase, as persisted) plus snake_case `for_user_id` and, when known, the project's `isolation`. `metadata` never contains the enrolment token hash.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-projects-environments-api-openapi.yml#/components/schemas/Environment",
  "type": "object",
  "required": [
    "id",
    "projectId",
    "ownerUserId",
    "orgId",
    "forUserId",
    "for_user_id",
    "name",
    "slug",
    "provider",
    "region",
    "size",
    "state",
    "stateReason",
    "deviceId",
    "providerRef",
    "publicIp",
    "idleTimeoutMinutes",
    "lastActivityAt",
    "startedAt",
    "stoppedAt",
    "hourlyRateMicroEur",
    "includedHoursUsedSeconds",
    "metadata",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "projectId": {
      "type": "string",
      "format": "uuid"
    },
    "ownerUserId": {
      "type": "string",
      "format": "uuid"
    },
    "orgId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "forUserId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "In `vm_per_dev` projects, the developer this machine is pinned to."
    },
    "for_user_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Same as `forUserId` (snake_case convenience)."
    },
    "isolation": {
      "$ref": "#/$defs/ProjectIsolation"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Globally unique preview hostname label (`https://<port>-<slug>.preview.codai.ro`)."
    },
    "provider": {
      "$ref": "#/$defs/EnvironmentProvider"
    },
    "region": {
      "type": [
        "string",
        "null"
      ]
    },
    "size": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "$ref": "#/$defs/EnvironmentState"
    },
    "stateReason": {
      "type": [
        "string",
        "null"
      ]
    },
    "deviceId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The daemon's device row once enrolled."
    },
    "providerRef": {
      "type": [
        "string",
        "null"
      ],
      "description": "Provider-side id (server id, container id)."
    },
    "publicIp": {
      "type": [
        "string",
        "null"
      ]
    },
    "idleTimeoutMinutes": {
      "type": "integer",
      "minimum": 5,
      "maximum": 1440,
      "default": 30
    },
    "lastActivityAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "startedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "stoppedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "hourlyRateMicroEur": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Managed providers only; micro-EUR per hour."
    },
    "includedHoursUsedSeconds": {
      "type": "integer"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "description": "Provider/daemon facts, e.g. `daemon: { version, os, arch, enrolled_at }`, `budget_micro_eur`."
    },
    "prebuild": {
      "type": "boolean",
      "default": false,
      "description": "True for an unclaimed prebuild pool machine (owned by the project owner); cleared when claimed."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "EnvironmentProvider": {
      "type": "string",
      "enum": [
        "byo",
        "openstack",
        "hetzner",
        "local",
        "gce"
      ],
      "description": "`byo` (bring your own machine; the daemon enrols with a token) is open to every key. `openstack` / `hetzner` are managed by the worker and billed hourly; `gce` (Google Cloud) offers on-demand CPU sizes `small`/`medium`/`large` (e2-standard-2/4/8) and the GPU size `gpu-l4` (Spot, 30-minute cap); it is available only where the deployment enables it AND to `super_admin` accounts (403 for everyone else); `local` is a developer convenience. Managed providers answer 403 until enabled for your key."
    },
    "EnvironmentState": {
      "type": "string",
      "enum": [
        "pending",
        "creating",
        "enrolling",
        "starting",
        "running",
        "stopping",
        "stopped",
        "archiving",
        "archived",
        "destroying",
        "destroyed",
        "error"
      ],
      "description": "Lifecycle state. `byo` starts in `pending` and reaches `enrolling` when the daemon enrols; managed providers start in `creating` and reach `running` once enrolled. `destroyed` is terminal."
    },
    "ProjectIsolation": {
      "type": "string",
      "enum": [
        "shared_vm",
        "container",
        "vm_per_dev"
      ],
      "description": "How a project's environments are shared. `shared_vm` (default) — one machine, many members; `container` — one container per member; `vm_per_dev` — one machine per developer, pinned via `for_user_id`."
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/codai-ro-environment"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.