Get sandbox quotas and network capabilities

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

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 explains resource identities, fields, and states. Replace example resource values with actual values.

Request

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

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"

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

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

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

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 distinguishes parameter, permission, quota, provider, and unknown-result cases. Errors do not prove that no resource was created or that retry/cleanup completed.

Last updated on