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

# Create machine



## OpenAPI

````yaml /dcs-openapi.json post /v1/machines
openapi: 3.1.0
info:
  description: Controlplane API for Dedalus Cloud Services (DCS).
  title: Dedalus Cloud Services API
  version: v1
servers:
  - description: Official DCS API
    url: https://dcs.dedaluslabs.ai
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /v1/machines:
    post:
      tags:
        - Machine Lifecycle
      summary: Create machine
      operationId: createMachine
      parameters:
        - in: header
          name: X-Dedalus-Org-Id
          schema:
            type: string
        - in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMachineRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LifecycleResponse'
          description: Create converged inline
          headers:
            ETag:
              schema:
                type: string
            X-Dedalus-Storage-Operation-Id:
              schema:
                type:
                  - string
                  - 'null'
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LifecycleResponse'
          description: Create accepted and pending convergence
          headers:
            ETag:
              schema:
                type: string
            X-Dedalus-Storage-Operation-Id:
              schema:
                type:
                  - string
                  - 'null'
        '401':
          content:
            application/json:
              examples:
                invalid_key:
                  value:
                    error_code: AUTH_INVALID
                    message: invalid Dedalus API key
                    retryable: false
                missing_key:
                  value:
                    error_code: AUTH_REQUIRED
                    message: missing Dedalus API key
                    retryable: false
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Authentication required
        '403':
          content:
            application/json:
              examples:
                org_mismatch:
                  value:
                    error_code: AUTH_ORG_MISMATCH
                    message: org scope does not match API key ownership
                    retryable: false
                scope_forbidden:
                  value:
                    error_code: AUTH_SCOPE_FORBIDDEN
                    message: internal service authorization is required
                    retryable: false
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Forbidden
        '409':
          content:
            application/json:
              examples:
                idempotency_key_reused:
                  value:
                    error_code: IDEMPOTENCY_KEY_REUSED
                    message: idempotency key reused with different request parameters
                    retryable: false
                    details:
                      expected_request_hash: 9ad5f2ad
                      provided_request_hash: a2b7e8d4
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Create conflict
        '429':
          content:
            application/json:
              examples:
                idempotency_in_flight:
                  value:
                    error_code: RATE_LIMITED
                    message: idempotency key is already in-flight
                    retryable: true
                    retry_after_ms: 250
                mutation_rate_limited:
                  value:
                    error_code: RATE_LIMITED
                    message: mutation rate limit exceeded
                    retryable: true
                    retry_after_ms: 84
                    details:
                      rate_limit_scope: mutating_lifecycle_routes
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Rate limited
        '503':
          content:
            application/json:
              examples:
                mutation_limiter_unavailable:
                  value:
                    error_code: DEPENDENCY_UNAVAILABLE
                    message: mutation rate limiter unavailable
                    retryable: true
                    details:
                      rate_limit_backend: redis
                      rate_limit_scope: mutating_lifecycle_routes
                runtime_unavailable:
                  value:
                    error_code: DEPENDENCY_UNAVAILABLE
                    message: runtime unavailable
                    retryable: true
              schema:
                additionalProperties: false
                properties:
                  details:
                    additionalProperties:
                      type: string
                    type: object
                  error_code:
                    type: string
                  message:
                    type: string
                  retry_after_ms:
                    format: int64
                    type: integer
                  retryable:
                    type: boolean
                required:
                  - error_code
                  - message
                  - retryable
                type: object
          description: Dependency unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
components:
  schemas:
    CreateMachineRequest:
      additionalProperties: false
      properties:
        autosleep:
          description: >-
            Idle window before autosleep. Accepts fixed duration units like 30s,
            30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable.
          type: string
        memory_mib:
          description: Memory in MiB.
          format: int64
          type: integer
        storage_gib:
          description: Storage in GiB.
          format: int64
          type: integer
        vcpu:
          description: CPU in vCPUs.
          format: double
          type: number
      required:
        - vcpu
        - memory_mib
        - storage_gib
      type: object
    LifecycleResponse:
      additionalProperties: false
      properties:
        autosleep_seconds:
          description: Seconds of inactivity before autosleep. 0 disables autosleep.
          format: int64
          maximum: 9223372036
          minimum: 0
          type: integer
        desired_state:
          enum:
            - running
            - sleeping
            - destroyed
          type: string
        machine_id:
          type: string
        memory_mib:
          description: Memory in MiB.
          format: int64
          type: integer
        status:
          $ref: '#/components/schemas/LifecycleStatus'
        storage_gib:
          format: int64
          type: integer
        vcpu:
          description: CPU in vCPUs.
          format: double
          type: number
      required:
        - machine_id
        - vcpu
        - memory_mib
        - storage_gib
        - autosleep_seconds
        - desired_state
        - status
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    LifecycleStatus:
      additionalProperties: false
      properties:
        last_error:
          type: string
        last_progress_at:
          format: date-time
          type: string
        last_transition_at:
          format: date-time
          type: string
        phase:
          enum:
            - accepted
            - placement_pending
            - starting
            - running
            - stopping
            - sleeping
            - destroying
            - destroyed
            - failed
          type: string
        reason:
          type: string
        retryable:
          type: boolean
        revision:
          type: string
      required:
        - phase
        - reason
        - retryable
        - revision
        - last_transition_at
        - last_progress_at
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: Dedalus API key. Alternative to Bearer token.
      in: header
      name: x-api-key
      type: apiKey
    BearerAuth:
      bearerFormat: Dedalus API key
      description: 'Dedalus API key in Authorization: Bearer <key>.'
      scheme: bearer
      type: http

````