# List compute resources as an administrator

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

List compute resources across Workspaces in the current administration directory. Filter by Workspace, status, name, or keyword.

```text
GET https://api.moi.matrixorigin.cn/v5/admin/compute-resources
```

## Before you call this API

Prepare an identity configured as a compute specification administrator in this deployment and an accessible authentication Workspace. Workspace Owner status or a Genesis administration scope is insufficient. Replace example IDs with targets you are authorized to read or operate on. See [Compute Instances](../../../../../developer/cli/tasks/compute-resources.md).

Pagination sorts by created_at descending, then id descending. It is not a stable snapshot during concurrent changes. DELETED and IAM_CREATE_PENDING resources are excluded, so this list cannot show the DELETED terminal state. Administration items include workspace and omit allowed_actions.

## Query parameters

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --get "https://api.moi.matrixorigin.cn/v5/admin/compute-resources" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $AUTH_WORKSPACE_ID" \
  --data-urlencode "workspace_id=target-workspace" \
  --data-urlencode "limit=50" \
  --data-urlencode "offset=0"
```

:::::
:::::{tab-item} Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `X-API-Key` | string | Yes (in this example) | A valid personal access token for an identity configured as a compute specification administrator in this deployment. |
| `X-Workspace-ID` | string | Yes | One nonempty authentication Workspace, separate from the resource's Workspace and the workspace_id list filter. |
| `workspace_id` | string | No | An exact target Workspace filter; this is not the authentication header. |
| `status` | string | No | A valid status enum. DELETED and IAM_CREATE_PENDING cannot be selected and are always excluded. |
| `name` | string | No | An exact resource name match. |
| `keyword` | string | No | After trimming whitespace, performs a case-insensitive substring search on resource name/description/Workspace ID and Workspace name/account/Owner. Resource IDs are excluded; % and _ are treated literally. |
| `limit` | integer | No | Defaults to 50; accepts 1–200. An explicit 0 is rejected. |
| `offset` | integer | No | Defaults to 0; must be nonnegative. |

:::::
::::::
:::::::

## Successful response

HTTP 200。

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "id": "cr-example",
        "workspace_id": "target-workspace",
        "name": "示例实例",
        "description": "",
        "kind": "task",
        "spec_id": "spec-example",
        "cpu": 1,
        "memory_gib": 4,
        "gpu": 0,
        "cpu_milli": 1000,
        "memory_mib": 4096,
        "gpu_count": 0,
        "gpu_memory_mib": 0,
        "gpu_cores": 0,
        "min_replicas": 0,
        "max_replicas": 2,
        "current_replicas": 0,
        "desired_replicas": 0,
        "go_worker_image_id": "",
        "python_worker_image_id": "",
        "worker_images": [
          {
            "worker_type": "python-worker",
            "image_id": "image-example",
            "platform": "linux/amd64"
          }
        ],
        "platform": "linux/amd64",
        "auto_suspend_minutes": 30,
        "scale_reason": "",
        "is_default": false,
        "status": "IDLE",
        "status_message": "",
        "created_by": "creator-example",
        "created_at": "2026-11-12T07:00:00Z",
        "updated_at": "2026-11-12T07:00:00Z",
        "workspace": {
          "id": "target-workspace",
          "name": "示例工作区",
          "owner_id": "owner-example",
          "account_name": "account-example"
        }
      }
    ],
    "total": 1,
    "limit": 50,
    "offset": 0
  }
}
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | OK on success. |
| `data` | object | Data returned by this API; see the fields below. |
| `data.items` | object (array of objects) | Administration resources. Each item includes workspace and omits allowed_actions. |
| `data.total` | integer | Total matches for this filter, not the number of items on this page. |
| `data.limit` | integer | Page size for this request. |
| `data.offset` | integer | Offset for this request. |
| `data.items[].id` | string | Compute instance ID. |
| `data.items[].workspace_id` | string | The instance's actual Workspace, separate from the authentication header. |
| `data.items[].name` | string | Instance name. |
| `data.items[].description` | string | Instance description; may be an empty string. |
| `data.items[].kind` | string | task or query. |
| `data.items[].spec_id` | string | Associated specification ID. |
| `data.items[].cpu` | integer | Legacy CPU specification field, in cores; do not confuse it with cpu_milli. |
| `data.items[].memory_gib` | integer | Legacy memory specification field, in GiB. |
| `data.items[].gpu` | integer | Legacy GPU specification field. |
| `data.items[].cpu_milli` | integer | Specification CPU, in millicores. |
| `data.items[].memory_mib` | integer | Specification memory, in MiB. |
| `data.items[].gpu_count` | integer | Specification GPU count. |
| `data.items[].gpu_memory_mib` | integer | Specification GPU memory, in MiB. |
| `data.items[].gpu_cores` | integer | Specification GPU core field. |
| `data.items[].min_replicas` | integer | Configured minimum replica field; not the currently observed replica count. |
| `data.items[].max_replicas` | integer | Replica limit for each Worker type, not a combined limit across all types. |
| `data.items[].current_replicas` | integer | Aggregate current instance replica field; separate from per-type observations. |
| `data.items[].desired_replicas` | integer | Target instance replica field; does not indicate readiness. |
| `data.items[].go_worker_image_id` | string | Legacy Go Worker image ID; may be empty. |
| `data.items[].python_worker_image_id` | string | Legacy Python Worker image ID; may be empty. |
| `data.items[].worker_images` | object (array of objects), optional | Optional images selected by Worker type. See the item fields below. |
| `data.items[].platform` | string | Worker platform configuration. |
| `data.items[].auto_suspend_minutes` | integer | Configured automatic suspension delay in minutes; not a duration guarantee for this operation. |
| `data.items[].scale_reason` | string | Most recent scaling or lifecycle reason. |
| `data.items[].is_default` | boolean | Whether this is the default instance; may be false. |
| `data.items[].status` | string | Parent instance state. Current models include IDLE, DEPLOYING, SCALING, ACTIVE, DRAINING, SUSPENDED, TERMINATING, ERROR, and others. Do not conflate this with Worker states. |
| `data.items[].status_message` | string | Status text; may be empty. |
| `data.items[].py_requirements_txt` | string, optional | Echoes normalized dependency text when nonempty; not declared in current typed SDK models. |
| `data.items[].py_requirements_sha` | string, optional | Echoes the text's SHA256 when nonempty; not declared in current typed SDK models. |
| `data.items[].py_deps` | object, optional | Declared optional observation object. Current list/update converters do not populate it, so it does not guarantee installation progress information. |
| `data.items[].created_by` | string | Creating principal. |
| `data.items[].last_activation_at` | string, optional | Most recent activation time in RFC3339; omitted when unrecorded. |
| `data.items[].last_active_at` | string, optional | Most recent activity time in RFC3339; omitted when unrecorded. |
| `data.items[].created_at` | string | Creation time in RFC3339. |
| `data.items[].updated_at` | string | Update time in RFC3339; not a caller-supplied concurrency version. |
| `data.items[].workspace` | object | Administration Workspace projection. See the four fields in the shared objects page. |

See [Shared objects](compute-admin-crud-objects.md) for nested objects and omission rules.
:::::
::::::
:::::::

## Error responses

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{"code": "INVALID_PARAMS", "msg": "workspace is required", "data": null}
```

:::::
:::::{tab-item} Fields

| HTTP / code | Conditions and handling |
| --- | --- |
| 400 / INVALID_PARAMS | Missing identity/authentication Workspace, or invalid pagination/status filter. |
| 403 / ErrForbidden | A classified rejection of administrator eligibility, principal, or Workspace access. |
| 503 / ErrServiceUnavailable | A classified shared authorization unavailability error; does not cover every directory/configuration error. |
| 500 / ErrServer | An unclassified service, directory, or storage error. |

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Classified by the specific failure stage. |
| `msg` | string | Error text; shared errors may be localized. |
| `data` | null or omitted | Direct compute errors use null. See error recovery for shared error formats. |

:::::
::::::
:::::::

An error does not mean every stage was rolled back. See [Errors and recovery](compute-admin-crud-errors-recovery.md).
