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

# Create stack

> Create a new stack within a rental



## OpenAPI

````yaml https://console.gputrader.io/assets/gputrader-api.json post /rentals/{rentalId}/stacks
openapi: 3.1.1
info:
  title: GPU Trader API
  version: 0.4.16
  description: This is the Swagger/OpenAPI-compatible GPUTrader API documentation
servers:
  - url: https://api.gputrader.io/v1
security: []
tags: []
paths:
  /rentals/{rentalId}/stacks:
    post:
      tags:
        - Rentals
      summary: Create stack
      description: Create a new stack within a rental
      parameters:
        - in: path
          name: rentalId
          required: true
          schema:
            type: string
          description: Rental ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - template
              properties:
                template:
                  type: object
                  required:
                    - content
                    - environmentVariables
                    - name
                    - description
                  properties:
                    name:
                      type: string
                      description: Stack template name
                    description:
                      type: string
                      description: Stack template description
                    content:
                      type: string
                      description: Stack template content
                    environmentVariables:
                      type: object
                      additionalProperties:
                        type: string
                      description: Environment variables for the stack
                    insecure:
                      type: boolean
                      description: Tunnel insecure flag
                      default: false
                    isBasicAuthEnabled:
                      type: boolean
                      description: Tunnel basic auth flag
                      default: false
                    isSSHEnabled:
                      type: boolean
                      description: Enable SSH connection flag
                      default: false
      responses:
        '201':
          description: Stack successfully created
          content:
            application/json:
              schema:
                type: string
                format: uuid
        '400':
          description: Invalid request body
        '404':
          description: Rental not found
        '500':
          description: Internal server error
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````