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

# Create an image build



## OpenAPI

````yaml openapi.json POST /api/images/builds
openapi: 3.0.1
info:
  title: Hyperbrowser API
  version: 1.0.0
servers:
  - url: https://api.hyperbrowser.ai
    description: Production server
security: []
paths:
  /api/images/builds:
    post:
      tags:
        - Images
      summary: Create an image build
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateImageBuildParams'
      responses:
        '200':
          description: Image build created with a presigned upload target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateImageBuildResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateImageBuildParams:
      type: object
      properties:
        imageName:
          type: string
          maxLength: 64
          pattern: ^[A-Za-z0-9_-]+$
          description: >-
            Name for the resulting image. Letters, numbers, dashes, and
            underscores only.
        inputSha256:
          type: string
          minLength: 64
          maxLength: 64
          pattern: ^[A-Fa-f0-9]{64}$
          description: SHA-256 of the image archive to upload.
        inputSizeBytes:
          type: integer
          minimum: 1
        inputFormat:
          type: string
          enum:
            - rootfs_export_tar_gz
          default: rootfs_export_tar_gz
          description: Archive format of the input.
        sourcePlatform:
          type: string
          enum:
            - linux/amd64
          default: linux/amd64
          description: Platform of the source image.
        imageConfigUser:
          type: string
          description: Default user from the image config.
        imageInit:
          type: object
          description: Startup defaults to attach to the image.
          properties:
            env:
              type: object
              maxProperties: 128
              description: >-
                Environment variables. Keys must match
                `^[A-Za-z_][A-Za-z0-9_]*$`.
              additionalProperties:
                type: string
                maxLength: 8192
            command:
              type: string
              minLength: 1
              maxLength: 8192
              description: Startup command.
            args:
              type: array
              maxItems: 256
              items:
                type: string
                minLength: 1
                maxLength: 8192
              description: Startup argument vector.
          additionalProperties: false
      required:
        - imageName
        - inputSha256
        - inputSizeBytes
    CreateImageBuildResponse:
      type: object
      properties:
        build:
          $ref: '#/components/schemas/ImageBuild'
        upload:
          type: object
          description: Presigned upload target for the image archive.
          properties:
            url:
              type: string
            method:
              type: string
              enum:
                - PUT
            headers:
              type: object
              additionalProperties:
                type: string
            objectKey:
              type: string
            expiresInSeconds:
              type: integer
            maxUploadBytes:
              type: integer
          required:
            - url
            - method
            - headers
            - objectKey
            - expiresInSeconds
            - maxUploadBytes
      required:
        - build
        - upload
    ImageBuild:
      type: object
      properties:
        id:
          type: string
          format: uuid
        imageName:
          type: string
        imageId:
          type: string
          format: uuid
          nullable: true
        status:
          type: string
          enum:
            - awaiting_upload
            - upload_verified
            - dispatching
            - building
            - verifying
            - completed
            - failed
            - canceled
          description: Current image-build lifecycle state.
        inputSha256:
          type: string
          nullable: true
        inputSizeBytes:
          type: integer
          nullable: true
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        completedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - imageName
        - status
        - completedAt
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````