> ## Documentation Index
> Fetch the complete documentation index at: https://strettch-make-section-id-optional.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Compute Instance

> Provisions a new compute instance under the team associated with the given API key.

### Request Reference

Use these slugs for the `region`, `image`, and `specification` fields in your request body.

<Tabs>
  <Tab title="Regions">
    | Slug    | Name     | Country     |
    | :------ | :------- | :---------- |
    | `KGL-1` | Kigali-1 | 🇷🇼 Rwanda |
  </Tab>

  <Tab title="Images">
    | Slug           | OS     | Version   |
    | :------------- | :----- | :-------- |
    | `UBUNTU-24.04` | Ubuntu | 24.04 LTS |
    | `UBUNTU-22.04` | Ubuntu | 22.04 LTS |
  </Tab>

  <Tab title="Specifications">
    <Note>
      The `S` prefix stands for Shared CPU. RAM in GB (512 MB for the smallest tier).
    </Note>

    | Slug        | vCPUs |   RAM  | Storage (SSD) |
    | :---------- | :---: | :----: | :-----------: |
    | `S-1C`      |   1   | 512 MB |     10 GB     |
    | `S-1C-1G`   |   1   |  1 GB  |     20 GB     |
    | `S-1C-2G`   |   1   |  2 GB  |     40 GB     |
    | `S-2C-4G`   |   2   |  4 GB  |     80 GB     |
    | `S-4C-8G`   |   4   |  8 GB  |     160 GB    |
    | `S-8C-16G`  |   8   |  16 GB |     320 GB    |
    | `S-16C-32G` |   16  |  32 GB |     640 GB    |
  </Tab>
</Tabs>

***

### Response Error Codes

If the request fails, the `code` field in the error response will contain one of the following.

<Tabs>
  <Tab title="Standard">
    | Code                    | Status | Description                                                             |
    | :---------------------- | :----: | :---------------------------------------------------------------------- |
    | `BAD_REQUEST`           |   400  | The request was invalid or malformed.                                   |
    | `UNAUTHORIZED`          |   401  | Authentication failed or was not provided.                              |
    | `FORBIDDEN`             |   403  | You do not have permission to perform this action.                      |
    | `RESOURCE_NOT_FOUND`    |   404  | The requested resource (image, region, or specification) was not found. |
    | `CONFLICT`              |   409  | A conflict with the current server state occurred.                      |
    | `UNPROCESSABLE_ENTITY`  |   422  | The request was well-formed but failed semantic validation.             |
    | `TOO_MANY_REQUESTS`     |   429  | You have exceeded the rate limit.                                       |
    | `INTERNAL_SERVER_ERROR` |   500  | An unexpected error occurred on our end.                                |
  </Tab>

  <Tab title="Billing & Team">
    <Warning>
      These errors block all resource operations. Resolve your team's billing status before retrying.
    </Warning>

    | Code                   | Status | Description                                                  |
    | :--------------------- | :----: | :----------------------------------------------------------- |
    | `INSUFFICIENT_BALANCE` |   403  | Team balance is too low to provision this instance.          |
    | `TEAM_SUSPENDED`       |   403  | Team is suspended due to an outstanding payment.             |
    | `TEAM_PAST_DUE`        |   403  | Team has an outstanding balance that must be settled first.  |
    | `TEAM_TERMINATED`      |   403  | Team has been terminated and can no longer access resources. |
  </Tab>
</Tabs>


## OpenAPI

````yaml api-reference/openapi.json POST /computes
openapi: 3.1.0
info:
  title: Strettch Cloud Public API
  description: Public API for managing Strettch Cloud resources.
  contact:
    name: API Support
    url: https://cloud.strettch.com
    email: support@strettch.cloud
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://api.strettch.cloud/api/v1
    description: Production
security: []
paths:
  /computes:
    post:
      tags:
        - Computes
      summary: Create a compute instance
      description: >-
        Provisions a new compute instance under the team associated with the
        given API key.
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: Idempotency key (UUID v4)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComputeCreateRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/APIResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/ComputeResponse'
        '400':
          description: >-
            Possible codes: BAD_REQUEST, VALIDATION_ERROR, MALFORMED_JSON,
            INVALID_IDEMPOTENCY_KEY
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 'Possible codes: UNAUTHORIZED'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            Possible codes: FORBIDDEN, TEAM_SUSPENDED, TEAM_PAST_DUE,
            TEAM_TERMINATED
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Possible codes: NOT_FOUND, RESOURCE_NOT_FOUND'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ComputeCreateRequest:
      type: object
      required:
        - hostName
        - image
        - publicKeys
        - region
        - specification
      properties:
        hostName:
          type: string
          example: my-server-01
        image:
          type: string
          example: UBUNTU-24.04
        publicKeys:
          type: array
          minItems: 1
          items:
            type: string
          example:
            - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8Z5mS1x7I6n... user@host
        region:
          type: string
          example: KGL-1
        specification:
          description: e.g. S-1C-1G or S-1C
          type: string
          example: S-1C-1G
        tags:
          type: array
          items:
            type: string
          example:
            - production
            - web
        withPublicIp:
          type: boolean
          example: true
    APIResponse:
      type: object
      properties:
        message:
          type: string
          example: Operation successful
        requestId:
          type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        success:
          type: boolean
          example: true
        timestamp:
          type: string
          example: '2024-01-15T10:00:00Z'
    ComputeResponse:
      type: object
      properties:
        id:
          type: string
          example: '325'
        hostName:
          type: string
          example: my-server-01
        state:
          type: string
          example: RUNNING
        image:
          type: string
          example: UBUNTU-24.04
        specification:
          type: string
          example: S-1C-1G
        region:
          type: string
          example: KGL-1
        ipv4:
          type: string
          example: 195.15.0.73
        privateIpv4:
          type: string
          example: 10.0.0.5
        tags:
          type: array
          items:
            type: string
          example:
            - production
            - web
        createdAt:
          type: string
          example: '2024-01-15T10:00:00Z'
        updatedAt:
          type: string
          example: '2024-01-15T10:05:00Z'
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          example: ERROR_CODE
        message:
          type: string
          example: Error message description
        requestId:
          type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        success:
          type: boolean
          example: false
        timestamp:
          type: string
          example: '2024-01-15T10:00:00Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````