# Get compute resource runtime state as an administrator

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

Read a target instance's Worker types, states, and replica records separately from the parent instance state.

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

## Before you call this API

Prepare a valid identity for this deployment, configured compute specification administrator privileges, 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).

There are no pagination or Worker type filters. Distinguish a missing resource from an existing resource with empty runtimes. These are stored runtime projections; they are not guaranteed to match external Pod, process, or service readiness timing.

## Request parameters

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

```bash
curl -X GET "https://api.moi.matrixorigin.cn/v5/admin/compute-resources/cr-example/runtime" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $AUTH_WORKSPACE_ID"
```

:::::
:::::{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 accessible to the current principal; not a target instance Workspace filter. |
| `id` | string | Yes | Target instance ID. The service resolves its actual Workspace from this ID. |

This API does not read a business request body. Do not submit the target Workspace or state through the body.
:::::
::::::
:::::::

## Successful response

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "runtimes": [
      {
        "compute_resource_id": "cr-example",
        "worker_type": "python-worker",
        "status": "IDLE",
        "desired_replicas": 0,
        "current_replicas": 0,
        "created_at": "2026-11-12T07:00:00Z",
        "updated_at": "2026-11-12T07:00:00Z"
      }
    ]
  }
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | OK on success. |
| `data` | object | Data read now or after the operation. |
| `data.runtimes` | object (array of objects) | Returned by Worker type. An existing parent resource without records returns []; this does not establish that it is callable. |
| `data.runtimes[].compute_resource_id` | string | Associated parent compute instance ID. |
| `data.runtimes[].worker_type` | string | Worker type identifier. Do not reduce arbitrary types to a Go/Python choice. |
| `data.runtimes[].status` | string | Lifecycle state of this Worker type record. Check it separately from the parent instance state. |
| `data.runtimes[].desired_replicas` | integer | Target replica field for this Worker type. |
| `data.runtimes[].current_replicas` | integer | Current replica field for this Worker type. |
| `data.runtimes[].last_activation_at` | string, optional | Most recent activation time in RFC3339; omitted when unrecorded. |
| `data.runtimes[].last_active_at` | string, optional | Most recent activity time in RFC3339; omitted when unrecorded. |
| `data.runtimes[].created_at` | string | Creation time in RFC3339. |
| `data.runtimes[].updated_at` | string | Update time in RFC3339; not a caller-supplied concurrency version. |

See [Shared objects](compute-runtime-admin-objects.md) for nested images, declared observation objects, and parent/Worker state relationships.
:::::
::::::
:::::::

## Error responses

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

```json
{"code":"INVALID_PARAMS","msg":"invalid compute resource request","data":null}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Distinguished by failure stage and operation. |
| `msg` | string | Error text; some branches are localized and do not expose unclassified underlying errors. |
| `data` | null | This example uses null; shared authentication error branches may omit it. |

| HTTP / code | Conditions and handling |
| --- | --- |
| 400 / INVALID_PARAMS | Missing authentication Workspace, principal, or resource ID. |
| 403 / ErrForbidden | The authorization boundary rejects administrator eligibility, the current principal, or Workspace access. |
| 503 / ErrServiceUnavailable | Classified shared authorization unavailability; does not apply to every directory failure. |
| 404 / NOT_FOUND | The parent resource is missing or outside the currently readable set. |
| 500 / ErrServer | An unclassified directory, storage, or internal failure. |

See [Errors and recovery](compute-runtime-admin-errors-recovery.md) for differences between handlers, identities, and recovery stages.
:::::
::::::
:::::::
