# StreamInput (/docs/api-reference/process/streaminput)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1534 · updated: 2026-07-30 -->
Related: [CloseStdin](/docs/api-reference/process/closestdin.md), [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

`POST /process.Process/StreamInput`

Client-streaming RPC. Client input stream ensures ordering of messages. Use the Connect protocol with streaming support.

## OpenAPI

```json
{
  "security": [
    {
      "SandboxAccessTokenAuth": []
    }
  ],
  "parameters": [
    {
      "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"
      }
    },
    {
      "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
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/connect+json": {
        "schema": {
          "type": "object",
          "oneOf": [
            {
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "object",
                      "oneOf": [
                        {
                          "properties": {
                            "pty": {
                              "type": "string",
                              "title": "pty",
                              "format": "byte"
                            }
                          },
                          "title": "pty",
                          "required": [
                            "pty"
                          ]
                        },
                        {
                          "properties": {
                            "stdin": {
                              "type": "string",
                              "title": "stdin",
                              "format": "byte"
                            }
                          },
                          "title": "stdin",
                          "required": [
                            "stdin"
                          ]
                        }
                      ],
                      "title": "ProcessInput",
                      "additionalProperties": false
                    }
                  },
                  "title": "DataEvent",
                  "additionalProperties": false
                }
              },
              "title": "data",
              "required": [
                "data"
              ]
            },
            {
              "properties": {
                "keepalive": {
                  "type": "object",
                  "title": "KeepAlive",
                  "additionalProperties": false
                }
              },
              "title": "keepalive",
              "required": [
                "keepalive"
              ]
            },
            {
              "properties": {
                "start": {
                  "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": "StartEvent",
                  "additionalProperties": false
                }
              },
              "title": "start",
              "required": [
                "start"
              ]
            }
          ],
          "title": "StreamInputRequest",
          "additionalProperties": false
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "Stream of StreamInputResponse events",
      "content": {
        "application/connect+json": {
          "schema": {
            "type": "object",
            "title": "StreamInputResponse",
            "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"
              }
            }
          }
        }
      }
    }
  }
}
```
