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

# List servers

> Returns a list of all servers belonging to the team.




## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples get /servers
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Billing
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: IP Addresses
  - name: Kubernetes Clusters
  - name: Operating Systems
  - name: Plans
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: VPN Sessions
  - name: Virtual machines
paths:
  /servers:
    get:
      tags:
        - Servers
      summary: List servers
      description: |
        Returns a list of all servers belonging to the team.
      operationId: get-servers
      parameters:
        - name: filter[project]
          in: query
          required: false
          description: The project ID or Slug to filter by
          schema:
            type: string
        - name: filter[region]
          in: query
          required: false
          description: The region Slug to filter by
          schema:
            type: string
        - name: filter[hostname]
          in: query
          required: false
          description: The hostname of server to filter by
          schema:
            type: string
        - name: filter[created_at_gte]
          in: query
          required: false
          description: The created at greater than equal date to filter by
          schema:
            type: string
        - name: filter[created_at_lte]
          in: query
          required: false
          description: The created at less than equal date to filter by
          schema:
            type: string
        - name: filter[label]
          in: query
          required: false
          description: The label of server to filter by
          schema:
            type: string
        - name: filter[status]
          in: query
          required: false
          description: The status of server to filter by
          schema:
            type: string
        - name: filter[plan]
          in: query
          required: false
          description: The platform/plan name of the server to filter by
          schema:
            type: string
        - name: filter[gpu]
          in: query
          required: false
          description: Filter by the existence of an associated GPU
          schema:
            type: boolean
        - name: filter[ram][eql]
          in: query
          required: false
          description: Filter servers with RAM size (in GB) equals the provided value.
          schema:
            type: integer
        - name: filter[ram][gte]
          in: query
          required: false
          description: >-
            Filter servers with RAM size (in GB) greater than or equal the
            provided value.
          schema:
            type: integer
        - name: filter[ram][lte]
          in: query
          required: false
          description: >-
            Filter servers with RAM size (in GB) less than or equal the provided
            value.
          schema:
            type: integer
        - name: filter[disk]
          in: query
          required: false
          description: >-
            The disk size in Gigabytes to filter by, should be used with the
            following options:
                                          [eql] to filter for values equal to the provided value.
                                          [gte] to filter for values greater than or equal to the provided value.
                                          [lte] to filter by values lower than or equal to the provided value.
          schema:
            type: integer
        - name: filter[tags]
          in: query
          required: false
          description: >-
            The tags IDs to filter by, separated by comma, e.g.
            `filter[tags]=tag_1,tag_2`will return servers with `tag_1` AND
            `tag_2`
          examples:
            Success:
              value: tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e
          schema:
            type: string
        - name: extra_fields[servers]
          in: query
          required: false
          description: >-
            The `credentials` are provided as extra attributes that are lazy
            loaded. To request it, just set `extra_fields[servers]=credentials`
            in the query string.
          schema:
            type: string
        - name: page[size]
          in: query
          schema:
            type: integer
            minimum: 1
            default: 20
          required: false
          description: Number of items to return per page
        - name: page[number]
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
          required: false
          description: Page number to return (starts at 1)
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              examples:
                Success:
                  value:
                    data:
                      - id: sv_WeGoqAanqP7nz
                        type: servers
                        attributes:
                          tags:
                            - id: tag_pjAkRjVzw0tlYBA2WX1eHzW7w79
                              name: tag1
                              description: Autem tempora est aperiam.
                              color: '#160303'
                            - id: tag_yARk1KLJAvslWY7k5wNBCaKEV7e
                              name: tag2
                              description: Vitae cupiditate doloribus optio.
                              color: '#ee6dee'
                          hostname: Hostname
                          label: 832845NODEKG
                          price: 599
                          role: Bare Metal
                          primary_ipv4: 19.98.98.65
                          primary_ipv6: 49e5:fef3:7891:16df:ccf6:93bb:a930:4dc0
                          status: 'on'
                          ipmi_status: Normal
                          created_at: null
                          scheduled_deletion_at: null
                          locked: false
                          rescue_allowed: false
                          region:
                            city: São Paulo 74
                            country: Singapore 66
                            site:
                              id: loc_695BdKjrOevVo
                              name: São Paulo 74
                              slug: SAO
                              facility: São Paulo 74
                              rack_id: rack_VLMmAD8EOwop2
                          team:
                            id: team_Ygapr2KkrMur4QneZ00yUEGl4W2
                            name: 292 Team
                            slug: 292-team
                            description: 292 Team
                            address: Apt. 180 27016 Chi Prairie, Kenyaport, CA 12866
                            currency:
                              id: cur_AW6Q2D9lqKLpr
                              code: BRL
                              name: Brazilian Real
                              currency_id: null
                            status: verified
                            feature_flags: []
                            limits:
                              bare_metal: null
                              bare_metal_gpu: 1
                              virtual_machine: 5
                              virtual_machine_gpu: 3
                              database: null
                              filesystem: null
                              block_storage: null
                          project:
                            id: proj_Z8rodmnGq1jLB
                            name: Incredible Linen Car
                            slug: incredible-linen-car
                            description: Lightweight Iron Chair
                            provisioning_type: on_demand
                            billing_type: Normal
                            billing_method: Normal
                            bandwidth_alert: false
                            environment: null
                            billing: {}
                            stats:
                              databases: 1
                              ip_addresses: 8
                              prefixes: 0
                              servers: 3
                              storages: 0
                              virtual_machines: 0
                              vlans: 0
                          plan:
                            id: plan_pbV0Dg1Rd4AWz
                            name: g3.h100.small-51
                            slug: plan-slug
                            billing: hourly
                          interfaces:
                            - role: ipmi
                              name: IPMI
                              mac_address: '00:11:22:33:44:55'
                              description: IPMI Interface
                            - role: internal
                              name: PXE
                              mac_address: 66:77:88:99:aa:bb
                              description: PXE Interface
                          operating_system:
                            name: Ubuntu (18.04 x64 LTS)
                            slug: ubuntu_18_04_x64_lts
                            version: 18.04 x64 LTS
                            features:
                              raid: true
                              ssh_keys: true
                            distro:
                              name: Ubuntu
                              slug: ubuntu
                              series: bionic
                          specs:
                            cpu: Xeon E-2186G CPU @ 3.80GHz (6 cores)
                            disk: 500 GB SSD
                            ram: 32 GB
                            nic: ''
                            gpu: null
                    meta: {}
              schema:
                $ref: '#/components/schemas/servers'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from latitudesh_python_sdk import Latitudesh
            import os


            with Latitudesh(
                bearer=os.getenv("LATITUDESH_BEARER", ""),
            ) as latitudesh:

                res = latitudesh.servers.list(filter_project="proj_g1mbDwrZqLv5B", filter_region="SAO", filter_ram_eql=32, filter_ram_gte=40, filter_ram_lte=40, filter_tags="tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e", page_size=20, page_number=1)

                while res is not None:
                    # Handle items

                    res = res.next()
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.Servers.List(ctx, operations.GetServersRequest{\n        FilterProject: latitudeshgosdk.Pointer(\"proj_g1mbDwrZqLv5B\"),\n        FilterRegion: latitudeshgosdk.Pointer(\"SAO\"),\n        FilterRAMEql: latitudeshgosdk.Pointer[int64](32),\n        FilterRAMGte: latitudeshgosdk.Pointer[int64](40),\n        FilterRAMLte: latitudeshgosdk.Pointer[int64](40),\n        FilterTags: latitudeshgosdk.Pointer(\"tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e\"),\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Servers != nil {\n        for {\n            // handle items\n\n            res, err = res.Next()\n\n            if err != nil {\n                // handle error\n            }\n\n            if res == nil {\n                break\n            }\n        }\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Latitudesh } from "latitudesh-typescript-sdk";

            const latitudesh = new Latitudesh({
              bearer: process.env["LATITUDESH_BEARER"] ?? "",
            });

            async function run() {
              const result = await latitudesh.servers.list({
                filterTags: "tag_pjAkRjVzw0tlYBA2WX1eHzW7w79,tag_yARk1KLJAvslWY7k5wNBCaKEV7e",
              });

              for await (const page of result) {
                console.log(page);
              }
            }

            run();
components:
  schemas:
    servers:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/server_data'
        meta:
          type: object
    server_data:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        attributes:
          type: object
          properties:
            hostname:
              type: string
            label:
              type: string
              description: The server label
            status:
              type: string
              enum:
                - 'on'
                - 'off'
                - unknown
                - disk_erasing
                - deploying
                - failed_deployment
                - rescue_mode
              description: >
                `on` - The server is powered ON

                `off` - The server is powered OFF

                `unknown` - The server power status is unknown

                `disk_erasing` - The server is in reinstalling state
                `disk_erasing`

                `deploying` - The server is deploying or reinstalling

                `failed_deployment` - The server has failed deployment or
                reinstall

                `rescue_mode` - The server is in rescue mode
            ipmi_status:
              type: string
              enum:
                - Unavailable
                - Intermittent
                - Normal
            role:
              type: string
              description: The server role (e.g. Bare Metal)
            site:
              type: string
            locked:
              type: boolean
            rescue_allowed:
              type: boolean
            primary_ipv4:
              type: string
              nullable: true
            primary_ipv6:
              type: string
              nullable: true
            created_at:
              type: string
              nullable: true
            scheduled_deletion_at:
              type: string
              nullable: true
            plan:
              type: object
              properties:
                id:
                  type: string
                  description: The plan ID
                name:
                  type: string
                  description: The plan name
                slug:
                  type: string
                  description: The plan slug
                billing:
                  type: string
                  description: >-
                    hourly/monthly pricing. Defaults to `hourly`. Appliable for
                    `on_demand` projects only.
                  nullable: true
            operating_system:
              type: object
              properties:
                name:
                  type: string
                  description: The OS name
                slug:
                  type: string
                  description: The OS slug
                version:
                  type: string
                  description: The OS description
                features:
                  type: object
                  properties:
                    raid:
                      type: boolean
                    ssh_keys:
                      type: boolean
                    user_data:
                      type: boolean
                distro:
                  type: object
                  properties:
                    name:
                      type: string
                      description: The OS Distro name
                    slug:
                      type: string
                      description: The OS Distro slug
                    series:
                      type: string
                      description: The OS Distro Series
            region:
              $ref: '#/components/schemas/server_region_resource_data'
            specs:
              type: object
              properties:
                cpu:
                  type: string
                  description: CPU model
                disk:
                  type: string
                  description: Disk quantity and size in GB (e.g. 2 x 500GB)
                ram:
                  type: string
                  description: RAM size in GB
                nic:
                  type: string
                  description: NIC quantity and speed
                gpu:
                  type: string
                  description: GPU model and quantity, if present
                  nullable: true
            interfaces:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - external
                      - internal
                      - ipmi
                      - unknown
                  name:
                    type: string
                  mac_address:
                    type: string
                    nullable: true
                  description:
                    type: string
            project:
              $ref: '#/components/schemas/project_include'
            team:
              $ref: '#/components/schemas/team_include'
    server_region_resource_data:
      type: object
      properties:
        city:
          type: string
        country:
          type: string
        site:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
            facility:
              type: string
            rack_id:
              type: string
    project_include:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        billing_type:
          type: string
          nullable: true
        provisioning_type:
          type: string
          nullable: true
        billing_method:
          type: string
          nullable: true
        bandwidth_alert:
          type: boolean
        environment:
          type: string
          nullable: true
        billing:
          type: object
          properties:
            subscription_id:
              type: string
              nullable: true
            type:
              type: string
            method:
              type: string
        stats:
          type: object
          properties:
            ip_addresses:
              type: integer
            prefixes:
              type: integer
            servers:
              type: integer
            vlans:
              type: integer
    team_include:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          nullable: true
        address:
          type: string
        currency:
          type: object
        status:
          type: string
        feature_flags:
          type: array
          items:
            type: string
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````