> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runaether.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Workspace

> Create a new workspace in a project

Creates a new workspace in the specified project. The workspace will be provisioned with the given hardware configuration or your default settings.

## Authentication

Requires a valid Bearer token.

## Path Parameters

<ParamField path="id" type="string" required>
  Project ID (UUID).
</ParamField>

## Request Body

<ParamField body="hardware" type="object">
  Hardware configuration. Uses your default hardware settings if omitted.

  <Expandable title="Hardware object">
    <ParamField body="cpu_kind" type="string">
      CPU type. Default: `"shared"`.
    </ParamField>

    <ParamField body="cpus" type="integer">
      Number of CPUs. Default: `2`.
    </ParamField>

    <ParamField body="memory_mb" type="integer">
      Memory in megabytes. Default: `2048`.
    </ParamField>

    <ParamField body="volume_size_gb" type="integer">
      Volume size in gigabytes. Default: `10`.
    </ParamField>

    <ParamField body="gpu_kind" type="string">
      GPU type. Default: `null` (no GPU).
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="keep_active" type="boolean">
  Whether the workspace should stay running when idle. Default: `false`.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "hardware": {
      "cpu_kind": "shared",
      "cpus": 2,
      "memory_mb": 2048,
      "volume_size_gb": 10,
      "gpu_kind": null
    },
    "keep_active": false
  }
  ```
</RequestExample>

## Response

Returns the created workspace object.

<ResponseField name="id" type="string" required>
  Unique workspace identifier (UUID).
</ResponseField>

<ResponseField name="project_id" type="string" required>
  ID of the parent project.
</ResponseField>

<ResponseField name="status" type="string" required>
  Initial status, typically `"creating"`.
</ResponseField>

<ResponseField name="hardware" type="object" required>
  Hardware configuration.
</ResponseField>

<ResponseField name="keep_active" type="boolean" required>
  Whether the workspace stays running when idle.
</ResponseField>

<ResponseField name="machine_id" type="string">
  Machine ID (null until provisioned).
</ResponseField>

<ResponseField name="private_ip" type="string">
  Private IP address (null until provisioned).
</ResponseField>

<ResponseField name="git_ref" type="string">
  Current git reference.
</ResponseField>

<ResponseField name="preview_token" type="string">
  Token for accessing workspace preview URLs.
</ResponseField>

<ResponseField name="error_message" type="string">
  Error details if provisioning fails.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  ISO 8601 timestamp.
</ResponseField>

<ResponseField name="updated_at" type="string" required>
  ISO 8601 timestamp.
</ResponseField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "b2c3d4e5-6789-01ab-cdef-234567890abc",
    "project_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "status": "creating",
    "hardware": {
      "cpu_kind": "shared",
      "cpus": 2,
      "memory_mb": 2048,
      "volume_size_gb": 10,
      "gpu_kind": null
    },
    "keep_active": false,
    "machine_id": null,
    "private_ip": null,
    "git_ref": null,
    "preview_token": "ptk_abc123",
    "error_message": null,
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z"
  }
  ```
</ResponseExample>

## Errors

| Status | Description                                                  |
| ------ | ------------------------------------------------------------ |
| `400`  | Bad Request — invalid hardware configuration                 |
| `401`  | Unauthorized — missing or invalid token                      |
| `404`  | Not Found — project does not exist or you do not have access |
