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

# Resolve live environment by id (external)

> Resolve live-environment connection details (proxied CDP URL / CUA) by env id. External-owned envs only; access is gated on the env's agent belonging to the caller's organisation. Returns 404 if either gate fails.



## OpenAPI

````yaml https://odyssey.asteroid.ai/agents/v2/openapi.yaml get /environments/{environmentId}/live-environment
openapi: 3.1.0
info:
  title: Agent Service
  version: v1
servers:
  - description: V2 API
    url: https://odyssey.asteroid.ai/agents/v2
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
  - name: Environments
  - name: Execution
  - name: Files
  - name: Agent Profiles
  - name: Agent Profile Pools
  - name: Workflows
  - name: Schema
  - name: Documentation
  - name: Context
  - name: Admin Customer Activity
paths:
  /environments/{environmentId}/live-environment:
    get:
      tags:
        - Environments
      summary: Resolve live environment by id (external)
      description: >-
        Resolve live-environment connection details (proxied CDP URL / CUA) by
        env id. External-owned envs only; access is gated on the env's agent
        belonging to the caller's organisation. Returns 404 if either gate
        fails.
      operationId: EnvironmentLiveEnvironment
      parameters:
        - description: The environment whose connection details to resolve.
          in: path
          name: environmentId
          required: true
          schema:
            $ref: '#/components/schemas/Common.uuid'
        - description: >-
            Optional assertion that the env belongs to this agent; resolution
            fails (404) on mismatch. Omit it — access is already gated on the
            env's own agent and organisation.
          explode: false
          in: query
          name: expectedAgentId
          schema:
            $ref: '#/components/schemas/Common.uuid'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agents.Environment.LiveEnvironmentDetails'
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.BadRequestErrorBody'
          description: The server could not understand the request due to invalid syntax.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.UnauthorizedErrorBody'
          description: Access is unauthorized.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.ForbiddenErrorBody'
          description: Access is forbidden.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.NotFoundErrorBody'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Common.InternalServerErrorBody'
          description: Server error
components:
  schemas:
    Common.uuid:
      format: uuid
      type: string
    Agents.Environment.LiveEnvironmentDetails:
      description: >-
        Connection details for a running environment, returned by the env-id
        attach endpoint. All fields are optional: an env that's still
        bootstrapping (no CDP URL yet) returns an empty response so the caller
        can proceed without browser tools.
      properties:
        cdpUrl:
          description: >-
            Chrome DevTools Protocol websocket URL. Present only for browser
            environments with a ready CDP endpoint.
          type: string
        credentials:
          description: >-
            Decrypted credential placeholders for the env's stamped agent
            profile, keyed by ##NAME## placeholder. Present only when the env
            has an attached profile with credentials. Internal-only.
          type: object
          unevaluatedProperties:
            type: string
        cua:
          allOf:
            - $ref: >-
                #/components/schemas/Agents.Workflow.LiveEnvironmentCuaConnection
          description: >-
            Provider-specific CUA connection details. Present for Anchor
            browsers and Daytona OS environments.
      type: object
    Common.BadRequestErrorBody:
      properties:
        code:
          enum:
            - 400
          type: number
          x-enum-varnames:
            - BadRequest
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.UnauthorizedErrorBody:
      properties:
        code:
          enum:
            - 401
          type: number
          x-enum-varnames:
            - Unauthorized
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.ForbiddenErrorBody:
      properties:
        code:
          enum:
            - 403
          type: number
          x-enum-varnames:
            - Forbidden
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.NotFoundErrorBody:
      properties:
        code:
          enum:
            - 404
          type: number
          x-enum-varnames:
            - NotFound
        message:
          type: string
      required:
        - code
        - message
      type: object
    Common.InternalServerErrorBody:
      properties:
        code:
          enum:
            - 500
          type: number
          x-enum-varnames:
            - InternalServerError
        message:
          type: string
      required:
        - code
        - message
      type: object
    Agents.Workflow.LiveEnvironmentCuaConnection:
      description: >-
        CUA provider connection metadata returned alongside a live environment.
        Credentials are NOT included — the caller resolves API keys from its own
        local config keyed by provider.
      properties:
        anchorBaseUrl:
          description: >-
            Base URL for the Anchor control plane. Optional; defaults to the
            Anchor SDK default. Set only when provider is anchor.
          type: string
        daytonaOsType:
          allOf:
            - $ref: '#/components/schemas/Agents.Workflow.OsType'
          description: >-
            Operating system of the Daytona sandbox. Set only when provider is
            daytona.
        daytonaToolboxBaseUrl:
          description: >-
            Per-sandbox base URL for the Daytona toolbox HTTP API. Set only when
            provider is daytona.
          type: string
        provider:
          allOf:
            - $ref: '#/components/schemas/Agents.Workflow.LiveEnvironmentCuaProvider'
          description: The CUA provider backing this session.
        sessionId:
          description: >-
            Provider session ID. Anchor: browser session id. Daytona: sandbox
            id.
          type: string
      required:
        - provider
        - sessionId
      type: object
    Agents.Workflow.OsType:
      description: Operating system the environment sandbox runs
      enum:
        - linux
        - windows
      type: string
    Agents.Workflow.LiveEnvironmentCuaProvider:
      description: CUA provider identifier.
      enum:
        - anchor
        - daytona
      type: string
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: X-Asteroid-Agents-Api-Key
      type: apiKey

````