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

# CloseStdin (/docs/api-reference/process/closestdin)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1123 · updated: 2026-07-30 -->
Related: [Connect](/docs/api-reference/process/connect.md), [List](/docs/api-reference/process/list.md), [SendInput](/docs/api-reference/process/sendinput.md), [SendSignal](/docs/api-reference/process/sendsignal.md), [Start](/docs/api-reference/process/start.md), [StreamInput](/docs/api-reference/process/streaminput.md)

# CloseStdin

`POST /process.Process/CloseStdin`

> Close stdin to signal EOF to the process.
>  Only works for non-PTY processes. For PTY, send Ctrl+D (0x04) instead.

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
      }
    },
    {
      "name": "Connect-Protocol-Version",
      "in": "header",
      "required": true,
      "schema": {
        "type": "number",
        "title": "Connect-Protocol-Version",
        "description": "Define the version of the Connect protocol",
        "const": 1
      }
    },
    {
      "name": "Connect-Timeout-Ms",
      "in": "header",
      "schema": {
        "type": "number",
        "title": "Connect-Timeout-Ms",
        "description": "Define the timeout, in ms"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "process": {
              "type": "object",
              "oneOf": [
                {
                  "properties": {
                    "pid": {
                      "type": "integer",
                      "title": "pid"
                    }
                  },
                  "title": "pid",
                  "required": [
                    "pid"
                  ]
                },
                {
                  "properties": {
                    "tag": {
                      "type": "string",
                      "title": "tag"
                    }
                  },
                  "title": "tag",
                  "required": [
                    "tag"
                  ]
                }
              ],
              "title": "ProcessSelector",
              "additionalProperties": false
            }
          },
          "title": "CloseStdinRequest",
          "additionalProperties": false
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "title": "CloseStdinResponse",
            "additionalProperties": false
          }
        }
      }
    },
    "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"
              }
            }
          }
        }
      }
    }
  }
}
```
