> ## 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.

# Create server



## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples post /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:
    post:
      tags:
        - Servers
      summary: Create server
      operationId: create-server
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - servers
                    attributes:
                      type: object
                      properties:
                        project:
                          type: string
                          description: The project (ID or Slug) to deploy the server
                        plan:
                          type: string
                          description: >-
                            The plan slug to choose server from, defining the
                            specs the server will have
                          enum:
                            - c2-large-x86
                            - c2-medium-x86
                            - c2-small-x86
                            - c3-large-x86
                            - c3-medium-x86
                            - c3-small-x86
                            - c3-xlarge-x86
                            - g3-gh200
                            - g3-large-x86
                            - g3-medium-x86
                            - g3-small-x86
                            - g3-xlarge-x86
                            - g4-rtx6kpro-large
                            - m3-large-x86
                            - m4-metal-large
                            - m4-metal-small
                            - rs4-metal-xlarge
                            - s2-small-x86
                            - s3-large-x86
                        site:
                          type: string
                          description: The site slug to deploy the server
                          enum:
                            - ASH
                            - BUE
                            - CHI
                            - DAL
                            - FRA
                            - LAX
                            - LON
                            - MEX
                            - MEX2
                            - MIA
                            - MIA2
                            - NYC
                            - SAO
                            - SAO2
                            - SGP
                            - SYD
                            - TYO
                            - TYO2
                        operating_system:
                          type: string
                          description: The operating system slug for the new server
                          enum:
                            - centos_7_4_x64
                            - centos_8_x64
                            - debian_10
                            - debian_11
                            - debian_12
                            - ipxe
                            - rhel8
                            - rockylinux_8
                            - ubuntu22_ml_in_a_box
                            - ubuntu24_ml_in_a_box
                            - ubuntu_20_04_x64_lts
                            - ubuntu_22_04_x64_lts
                            - ubuntu_24_04_x64_lts
                            - windows_2022_std
                            - windows_server_2019_std_v1
                        hostname:
                          type: string
                          description: The server hostname
                        ssh_keys:
                          type: array
                          items:
                            type: string
                          description: SSH Keys to set on the server
                          nullable: true
                        user_data:
                          type: string
                          description: >-
                            User data ID to set on the server. This is a custom
                            script that will run after the deploy
                          nullable: true
                        raid:
                          type: string
                          description: >-
                            RAID mode for the server. Set to 'raid-0' for RAID
                            0, 'raid-1' for RAID 1, or omit/null for no RAID
                            configuration
                          enum:
                            - raid-0
                            - raid-1
                          nullable: true
                        ipxe:
                          type: string
                          description: >-
                            URL where iPXE script is stored on, OR the iPXE
                            script encoded in base64. This attribute is required
                            when iPXE is selected as operating system.
                          nullable: true
                        billing:
                          type: string
                          enum:
                            - hourly
                            - monthly
                            - yearly
                          description: >-
                            The server billing type. Accepts `hourly` and
                            `monthly` for on demand projects and `yearly` for
                            reserved projects.
                          nullable: true
                  required:
                    - type
            examples:
              Created:
                summary: Created
                value:
                  data:
                    type: servers
                    attributes:
                      project: proj_lxWpD699qm6rk
                      plan: c2-small-x86
                      site: ASH
                      operating_system: ubuntu_22_04_x64_lts
                      hostname: BRC1
          application/vnd.api+json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - servers
                    attributes:
                      type: object
                      properties:
                        project:
                          type: string
                          description: The project (ID or Slug) to deploy the server
                        plan:
                          type: string
                          description: >-
                            The plan slug to choose server from, defining the
                            specs the server will have
                          enum:
                            - c2-large-x86
                            - c2-medium-x86
                            - c2-small-x86
                            - c3-large-x86
                            - c3-medium-x86
                            - c3-small-x86
                            - c3-xlarge-x86
                            - g3-gh200
                            - g3-large-x86
                            - g3-medium-x86
                            - g3-small-x86
                            - g3-xlarge-x86
                            - g4-rtx6kpro-large
                            - m3-large-x86
                            - m4-metal-large
                            - m4-metal-small
                            - rs4-metal-xlarge
                            - s2-small-x86
                            - s3-large-x86
                        site:
                          type: string
                          description: The site slug to deploy the server
                          enum:
                            - ASH
                            - BUE
                            - CHI
                            - DAL
                            - FRA
                            - LAX
                            - LON
                            - MEX
                            - MEX2
                            - MIA
                            - MIA2
                            - NYC
                            - SAO
                            - SAO2
                            - SGP
                            - SYD
                            - TYO
                            - TYO2
                        operating_system:
                          type: string
                          description: The operating system slug for the new server
                          enum:
                            - centos_7_4_x64
                            - centos_8_x64
                            - debian_10
                            - debian_11
                            - debian_12
                            - ipxe
                            - rhel8
                            - rockylinux_8
                            - ubuntu22_ml_in_a_box
                            - ubuntu24_ml_in_a_box
                            - ubuntu_20_04_x64_lts
                            - ubuntu_22_04_x64_lts
                            - ubuntu_24_04_x64_lts
                            - windows_2022_std
                            - windows_server_2019_std_v1
                        hostname:
                          type: string
                          description: The server hostname
                        ssh_keys:
                          type: array
                          items:
                            type: string
                          description: SSH Keys to set on the server
                          nullable: true
                        user_data:
                          type: string
                          description: >-
                            User data ID to set on the server. This is a custom
                            script that will run after the deploy
                          nullable: true
                        raid:
                          type: string
                          description: >-
                            RAID mode for the server. Set to 'raid-0' for RAID
                            0, 'raid-1' for RAID 1, or omit/null for no RAID
                            configuration
                          enum:
                            - raid-0
                            - raid-1
                          nullable: true
                        ipxe:
                          type: string
                          description: >-
                            URL where iPXE script is stored on, OR the iPXE
                            script encoded in base64. This attribute is required
                            when iPXE is selected as operating system.
                          nullable: true
                        billing:
                          type: string
                          enum:
                            - hourly
                            - monthly
                            - yearly
                          description: >-
                            The server billing type. Accepts `hourly` and
                            `monthly` for on demand projects and `yearly` for
                            reserved projects.
                          nullable: true
                  required:
                    - type
            examples:
              Created:
                summary: Created
                value:
                  data:
                    type: servers
                    attributes:
                      project: proj_lxWpD699qm6rk
                      plan: c2-small-x86
                      site: ASH
                      operating_system: ubuntu_22_04_x64_lts
                      hostname: BRC1
        required: true
      responses:
        '201':
          description: Created
          content:
            application/vnd.api+json:
              examples:
                Created:
                  value:
                    data:
                      type: servers
                      id: sv_W6Q2D9xGqKLpr
                      attributes:
                        hostname: BRC1
                        label: 846419NODEME
                        role: Bare Metal
                        status: 'off'
                        primary_ipv4: 171.189.35.253
                        primary_ipv6: 7d69:748d:26cc:796a:1248:b6be:a658:96a4
                        specs:
                          cpu: Xeon E-2186G CPU @ 3.80GHz (6 cores)
                          disk: 500 GB SSD
                          ram: 32 GB
                          nic: ''
                        plan:
                          id: plan_8NkvdyMKdeLpx
                          name: c2.small.x86
                          slug: c2-small-x86
                          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
                    meta: {}
              schema:
                $ref: '#/components/schemas/server'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            import latitudesh_python_sdk
            from latitudesh_python_sdk import Latitudesh
            import os


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

                res = latitudesh.servers.create(data={
                    "type": latitudesh_python_sdk.CreateServerServersType.SERVERS,
                    "attributes": {
                        "project": "proj_lxWpD699qm6rk",
                        "plan": latitudesh_python_sdk.CreateServerServersPlan.C2_SMALL_X86,
                        "site": latitudesh_python_sdk.CreateServerServersSite.ASH,
                        "operating_system": latitudesh_python_sdk.CreateServerServersOperatingSystem.UBUNTU_22_04_X64_LTS,
                        "hostname": "BRC1",
                    },
                })

                # Handle response
                print(res)
        - 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.Create(ctx, operations.CreateServerServersRequestBody{\n        Data: &operations.CreateServerServersData{\n            Type: operations.CreateServerServersTypeServers,\n            Attributes: &operations.CreateServerServersAttributes{\n                Project: latitudeshgosdk.Pointer(\"proj_lxWpD699qm6rk\"),\n                Plan: operations.CreateServerPlanC2SmallX86.ToPointer(),\n                Site: operations.CreateServerSiteAsh.ToPointer(),\n                OperatingSystem: operations.CreateServerOperatingSystemUbuntu2204X64Lts.ToPointer(),\n                Hostname: latitudeshgosdk.Pointer(\"BRC1\"),\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.Server != nil {\n        // handle response\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.create({
                data: {
                  type: "servers",
                  attributes: {
                    project: "proj_lxWpD699qm6rk",
                    plan: "c2-small-x86",
                    site: "ASH",
                    operatingSystem: "ubuntu_22_04_x64_lts",
                    hostname: "BRC1",
                  },
                },
              });

              console.log(result);
            }

            run();
components:
  schemas:
    server:
      type: object
      properties:
        data:
          $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

````