> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Open a terminal on a sandbox

GET /api/v1/deployments/{id}/sandboxes/{name}/terminal

Opens an interactive shell in the sandbox. A sandbox that is still being set up prints a notice and connects once it is ready. When the shell can't open, the server sends the reason as output, then closes the connection. Authenticate with your access token as a bearer token, or from the dashboard with your session.

Reference: https://docs.astropods.com/api-reference/astropods-api/deployments/open-a-terminal-on-a-sandbox

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Open a terminal on a sandbox
  version: subpackage_deployments.Open a terminal on a sandbox
  description: >-
    Opens an interactive shell in the sandbox. A sandbox that is still being set
    up prints a notice and connects once it is ready. When the shell can't open,
    the server sends the reason as output, then closes the connection.
    Authenticate with your access token as a bearer token, or from the dashboard
    with your session.
channels:
  /api/v1/deployments/{id}/sandboxes/{name}/terminal:
    description: >-
      Opens an interactive shell in the sandbox. A sandbox that is still being
      set up prints a notice and connects once it is ready. When the shell can't
      open, the server sends the reason as output, then closes the connection.
      Authenticate with your access token as a bearer token, or from the
      dashboard with your session.
    publish:
      operationId: subpackage_deployments.Open a terminal on a sandbox-publish
      summary: receiveOpenATerminalOnASandbox
      description: >-
        Shell output, as a binary frame of raw terminal bytes including escape
        sequences.
      message:
        name: receiveOpenATerminalOnASandbox
        title: receiveOpenATerminalOnASandbox
        description: >-
          Shell output, as a binary frame of raw terminal bytes including escape
          sequences.
        payload:
          $ref: '#/components/schemas/openATerminalOnASandbox_output'
    subscribe:
      operationId: subpackage_deployments.Open a terminal on a sandbox-subscribe
      summary: Client messages
      message:
        oneOf:
          - $ref: >-
              #/components/messages/subpackage_deployments.Open a terminal on a
              sandbox-client-0-sendOpenATerminalOnASandbox
          - $ref: >-
              #/components/messages/subpackage_deployments.Open a terminal on a
              sandbox-client-1-sendOpenATerminalOnASandbox
servers:
  Astropods:
    url: wss://astropods.com/
    protocol: wss
    x-default: true
components:
  messages:
    subpackage_deployments.Open a terminal on a sandbox-client-0-sendOpenATerminalOnASandbox:
      name: sendOpenATerminalOnASandbox
      title: sendOpenATerminalOnASandbox
      description: >-
        Keystrokes and pasted text for the shell, as a binary frame of UTF-8
        bytes.
      payload:
        $ref: '#/components/schemas/openATerminalOnASandbox_input'
    subpackage_deployments.Open a terminal on a sandbox-client-1-sendOpenATerminalOnASandbox:
      name: sendOpenATerminalOnASandbox
      title: sendOpenATerminalOnASandbox
      description: >-
        The terminal's size in characters, as a text frame. Send it on open and
        whenever the size changes.
      payload:
        $ref: '#/components/schemas/openATerminalOnASandbox_resize'
  schemas:
    openATerminalOnASandbox_output:
      type: string
      format: binary
      title: openATerminalOnASandbox_output
    openATerminalOnASandbox_input:
      type: string
      format: binary
      title: openATerminalOnASandbox_input
    openATerminalOnASandbox_resize:
      type: object
      properties:
        cols:
          type: integer
        rows:
          type: integer
        type:
          type: string
          description: Always resize.
      title: openATerminalOnASandbox_resize

```