> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://e2b.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://e2b.manicule.dev/api/mcp.
> Every agent surface: https://e2b.manicule.dev/.well-known/llms-manifest.json

# Get the stats of the service (/docs/api-reference/envd/get-the-stats-of-the-service)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1091 · updated: 2026-07-30 -->
Related: [Check the health of the service](/docs/api-reference/envd/check-the-health-of-the-service.md), [Get the environment variables](/docs/api-reference/envd/get-the-environment-variables.md)

# Get the stats of the service

`GET /metrics`

> Get the stats of the service

Base URL: `https://sandbox.{domain}` (`domain`: any value, default `e2b.app`)

## OpenAPI

```json
{
  "servers": [
    {
      "url": "https://sandbox.{domain}",
      "variables": {
        "domain": {
          "default": "e2b.app",
          "description": "E2B domain"
        }
      },
      "description": "Sandbox API (envd) - runs inside each sandbox"
    }
  ],
  "security": [
    {
      "SandboxAccessTokenAuth": []
    }
  ],
  "securitySchemes": {
    "SandboxAccessTokenAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "X-Access-Token",
      "description": "Sandbox access token (`envdAccessToken`) for authenticating requests to a running sandbox. Returned by: [POST /sandboxes](/docs/api-reference/sandboxes/create-a-sandbox) (on create), [POST /sandboxes/{sandboxID}/connect](/docs/api-reference/sandboxes/connect-to-a-sandbox) (on connect), [POST /sandboxes/{sandboxID}/resume](/docs/api-reference/sandboxes/resume-a-sandbox) (on resume), and [GET /sandboxes/{sandboxID}](/docs/api-reference/sandboxes/get-a-sandbox) (for running or paused sandboxes)."
    }
  },
  "parameters": [
    {
      "name": "E2b-Sandbox-Id",
      "in": "header",
      "required": true,
      "description": "Identifier of the target sandbox. Routes the request to that sandbox's envd over the shared sandbox host.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "E2b-Sandbox-Port",
      "in": "header",
      "required": true,
      "description": "Port envd listens on inside the sandbox (default 49983).",
      "schema": {
        "type": "integer",
        "default": 49983
      }
    }
  ],
  "responses": {
    "200": {
      "description": "The resource usage metrics of the service",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "description": "Resource usage metrics",
            "properties": {
              "ts": {
                "type": "integer",
                "format": "int64",
                "description": "Unix timestamp in UTC for current sandbox time"
              },
              "cpu_count": {
                "type": "integer",
                "description": "Number of CPU cores"
              },
              "cpu_used_pct": {
                "type": "number",
                "format": "float",
                "description": "CPU usage percentage"
              },
              "mem_total": {
                "type": "integer",
                "description": "Total virtual memory in bytes",
                "format": "int64"
              },
              "mem_used": {
                "type": "integer",
                "description": "Used virtual memory in bytes",
                "format": "int64"
              },
              "disk_used": {
                "type": "integer",
                "description": "Used disk space in bytes",
                "format": "int64"
              },
              "disk_total": {
                "type": "integer",
                "description": "Total disk space in bytes",
                "format": "int64"
              },
              "mem_used_mib": {
                "type": "integer",
                "description": "Used virtual memory in MiB",
                "format": "int64"
              },
              "mem_total_mib": {
                "type": "integer",
                "description": "Total virtual memory in MiB",
                "format": "int64"
              }
            }
          }
        }
      }
    },
    "502": {
      "description": "Sandbox not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "sandboxID",
              "message",
              "code"
            ],
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message"
              },
              "code": {
                "type": "integer",
                "description": "Error code"
              },
              "sandboxID": {
                "type": "string",
                "description": "Identifier of the sandbox"
              }
            }
          }
        }
      }
    }
  }
}
```
