# Get sandbox quotas and network capabilities

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

Read managed sandbox usage and limits for a Workspace. Explicitly request unrestricted network capability when needed.

```text
GET https://api.moi.matrixorigin.cn/v5/agent-sandboxes/quota
```

## Before you call this API

Prepare a personal access token and operation privileges for the target Workspace. Keep environment, token, Workspace, and sandbox IDs consistent. [Shared objects and result confirmation](objects.md) explains resource identities, fields, and states. Replace example resource values with actual values.

## Request

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

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

### Include network capabilities

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

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `include_network_capabilities` | boolean | No | Query parameter; defaults to false. true additionally returns unrestricted_network_allowed. |

The parameter may appear only once. Invalid booleans or duplicates return 400. current includes service-observed remote allocations and allocations whose persistence is incomplete; it is not visible-list length. This GET does not return complete ephemeral sandbox configuration.

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

## Successful response

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

The following example uses include_network_capabilities=true. Default requests omit unrestricted_network_allowed.

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "current": 1,
    "limit": 3,
    "default_egress_endpoints": [],
    "unrestricted_network_allowed": false
  }
}
```

:::::
:::::{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 description. |
| `data.current` | integer | Managed allocation usage. |
| `data.limit` | integer | Managed allocation limit. |
| `data.default_egress_endpoints` | object (array of objects) | Deployment-provided default outbound endpoints. |
| `data.unrestricted_network_allowed` | boolean | Returned only for explicit include_network_capabilities=true. Absence does not mean false. |

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

## Confirm the result

Compare current with limit, but creation still rechecks quotas and authorization. unrestricted cannot be created when its capability field is false.

## 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.
