> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the environment variables



## OpenAPI

````yaml /openapi-public.yml get /envs
openapi: 3.1.0
info:
  title: E2B API
  version: 0.1.0
  description: >-
    Complete E2B developer API. Platform endpoints are served on api.e2b.app.
    Sandbox endpoints (envd) are served on the shared sandbox host
    (sandbox.e2b.app); target a specific sandbox with the E2b-Sandbox-Id and
    E2b-Sandbox-Port headers.
servers:
  - url: https://api.e2b.app
    description: E2B Platform API
security: []
tags:
  - name: Sandboxes
  - name: Templates
  - name: Tags
  - name: Volumes
  - name: Envd
  - name: Filesystem
  - name: Process
  - name: Teams
paths:
  /envs:
    servers:
      - url: https://sandbox.{domain}
        description: Sandbox API (envd) - runs inside each sandbox
        variables:
          domain:
            default: e2b.app
            description: E2B domain
    get:
      tags:
        - Envd
      summary: Get the environment variables
      operationId: getEnvVars
      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: Environment variables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvVars'
        '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
      security:
        - SandboxAccessTokenAuth: []
components:
  schemas:
    EnvVars:
      additionalProperties:
        type: string
        description: Environment variables for the sandbox
      type: object
  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).

````