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

# Get virtual machine container

> Returns container details for the selected virtual machine and container



## OpenAPI

````yaml /api-reference/costgraph/openapi.json get /api/v1/tenant/virtual-machines/{id}/containers/{container_id}
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: infracost
    x-group: Infracost
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: service-map
    x-group: Service map
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /api/v1/tenant/virtual-machines/{id}/containers/{container_id}:
    get:
      tags:
        - virtual-machines
      summary: Get virtual machine container
      description: Returns container details for the selected virtual machine and container
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: Virtual machine ID
          name: id
          in: path
          required: true
          schema:
            type: string
        - description: Container ID
          name: container_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/costgraph_agent.ContainerDetail'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    costgraph_agent.ContainerDetail:
      type: object
      required:
        - binds
        - container_id
        - created_at
        - created_unix
        - image
        - labels
        - last_seen_at
        - name
        - networks
        - ports
        - restarts
        - runtime_name
        - state
        - status
        - tags
        - uptime_seconds
        - volumes
      properties:
        binds:
          type: array
          items:
            $ref: '#/components/schemas/costgraph_agent.AgentContainerMount'
        container_id:
          type: string
          x-semantic: resourceId
        created_at:
          type: string
        created_unix:
          type: integer
        image:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        last_seen_at:
          type: string
        name:
          type: string
        networks:
          type: array
          items:
            $ref: '#/components/schemas/costgraph_agent.AgentContainerNetwork'
        ports:
          type: array
          items:
            $ref: '#/components/schemas/costgraph_agent.AgentContainerPort'
        restarts:
          type: integer
        runtime_name:
          enum:
            - unknown
            - containerd
            - docker
          allOf:
            - $ref: '#/components/schemas/costgraph_agent.ContainerRuntime'
        state:
          type: string
          enum:
            - created
            - restarting
            - running
            - removing
            - paused
            - exited
            - dead
        status:
          type: string
          enum:
            - created
            - restarting
            - running
            - removing
            - paused
            - exited
            - dead
            - unknown
        tags:
          type: object
          additionalProperties:
            type: string
        uptime_seconds:
          type: integer
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/costgraph_agent.AgentContainerMount'
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    costgraph_agent.AgentContainerMount:
      type: object
      properties:
        destination:
          type: string
        driver:
          type: string
        mode:
          type: string
        name:
          type: string
        options:
          type: array
          items:
            type: string
        propagation:
          type: string
        rw:
          type: boolean
        source:
          type: string
        type:
          type: string
    costgraph_agent.AgentContainerNetwork:
      type: object
      required:
        - name
      properties:
        gateway:
          type: string
        ip_address:
          type: string
        mac_address:
          type: string
        name:
          type: string
        network_id:
          type: string
    costgraph_agent.AgentContainerPort:
      type: object
      required:
        - private_port
        - type
      properties:
        ip:
          type: string
        private_port:
          type: integer
        public_port:
          type: integer
        type:
          type: string
    costgraph_agent.ContainerRuntime:
      type: string
      enum:
        - unknown
        - containerd
        - docker
      x-enum-varnames:
        - ContainerRuntimeUnknown
        - ContainerRuntimeContainerd
        - ContainerRuntimeDocker
  securitySchemes:
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.