<span id="查询沙箱详情"></span>

# Get sandbox details

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

Use the actual ID returned by listing/creation to read sandbox phase, specification, and network settings.

```text
GET https://api.moi.matrixorigin.cn/v5/agent-sandboxes/{sandbox_id}
```

<span id="调用前准备"></span>

## Before you call this API

Prepare a personal access token and the required privileges for the target workspace. Keep environment, token, workspace, and sandbox ID consistent. [Common objects and result confirmation](objects.md) explains identities, fields, and states. Replace example resource values with actual ones.

<span id="请求"></span>

## Request

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

```bash
curl "https://api.moi.matrixorigin.cn/v5/agent-sandboxes/$SANDBOX_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

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

sandbox_id is a required path string from data[].id or creation data.id. The object must belong to the same workspace and be visible to the current identity. Display name, edge_agent_id, and ephemeral-session identities are not substitutes.

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

<span id="成功响应"></span>

## Successful response

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "sbx-example",
    "workspace_id": "workspace-example",
    "user_id": "user-example",
    "name": "audit-runner",
    "phase": "ready",
    "edge_agent_id": "sbx-example",
    "network_mode": "limited",
    "network_tools": [
      "git",
      "curl"
    ],
    "egress_endpoints": [
      {
        "host": "example.com",
        "ports": [
          443
        ]
      }
    ],
    "spec": "medium",
    "disk_gi": 10,
    "created_at": "2026-11-11T08:00:00Z",
    "updated_at": "2026-11-11T08:00:00Z",
    "update_available": null
  }
}
```

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

Meaning of HTTP 200 data below. Example values are not default configuration.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | OK on success. |
| `msg` | string | Response explanation. |
| `data` | object | Current sandbox; see common objects for all fields. |

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

<span id="结果确认"></span>

## Confirm the result

After phase:ready, verify the target terminal/job. provisioning means preparation continues. Handle unknown/error using actual errors; GET success does not establish healthy execution. update_available:null is unknown, not no update.

<span id="错误处理"></span>

## Error handling

Check HTTP status and response code. [Shared errors and recovery](objects.md#错误与恢复) distinguishes parameter, permission, quota, provider, and unknown-result cases. Errors do not prove that no resource was created or that retry/cleanup completed.
