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

# Submit Build

> Submit a container image build.

Upload a tar.gz archive containing the build context (Dockerfile and any files
needed for the build) along with image name, tag, and optional build arguments.

Maximum file size: 500MB



## OpenAPI

````yaml https://api.dev-sgp.scale.com/openapi-versions/v5/openapi.json post /v5/builds
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/builds:
    post:
      tags:
        - Agentex Cloud Build
      summary: Submit Build
      description: >-
        Submit a container image build.


        Upload a tar.gz archive containing the build context (Dockerfile and any
        files

        needed for the build) along with image name, tag, and optional build
        arguments.


        Maximum file size: 500MB
      operationId: POST-V5-/builds
      parameters:
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AgentexCloudBuildSubmitRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentexCloudBuild'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentexCloudBuildSubmitRequest:
      properties:
        context_archive:
          type: string
          title: Context Archive
          description: >-
            tar.gz archive containing the build context (Dockerfile and any
            files needed for the build)
          format: binary
        image_name:
          type: string
          title: Image Name
          description: Name for the built image
        agent_name:
          title: Agent Name
          description: Name of the brand-new agent to create from this build
          type: string
        agent_id:
          title: Agent Id
          description: ID of the existing agent this build targets
          type: string
        image_tag:
          type: string
          title: Image Tag
          description: Tag for the built image
          default: latest
        build_args:
          title: Build Args
          description: JSON string of build arguments
          type: string
        platform:
          title: Platform
          description: >-
            Target platform for the Docker build. Defaults to the build host's
            native architecture when not specified.
          type: string
          enum:
            - linux/amd64
            - linux/arm64
            - linux/arm/v7
      type: object
      required:
        - context_archive
        - image_name
      title: AgentexCloudBuildSubmitRequest
    AgentexCloudBuild:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: agentex_cloud_build
          title: Object
          default: agentex_cloud_build
        cloud_provider_build_id:
          type: string
          title: Cloud Provider Build Id
        agent_name:
          type: string
          title: Agent Name
        agent_id:
          title: Agent Id
          type: string
        image_name:
          type: string
          title: Image Name
        image_tag:
          type: string
          title: Image Tag
        image_url:
          title: Image Url
          type: string
        build_status:
          $ref: '#/components/schemas/AgentexCloudBuildStatus'
          description: The current build lifecycle status
        build_start_time:
          title: Build Start Time
          description: When the cloud provider started the build
          type: string
          format: date-time
        build_end_time:
          title: Build End Time
          description: When the cloud provider finished the build
          type: string
          format: date-time
        account_id:
          type: string
          title: Account Id
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
      type: object
      required:
        - cloud_provider_build_id
        - agent_name
        - image_name
        - image_tag
        - build_status
        - id
        - account_id
        - created_at
        - created_by
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentexCloudBuildStatus:
      type: string
      enum:
        - queued
        - running
        - success
        - failed
        - cancelling
        - cancelled
        - deleting
        - delete_failed
        - timed_out
        - error
        - unknown
      title: AgentexCloudBuildStatus
    Identity:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: identity
          title: Object
          default: identity
        type:
          $ref: '#/components/schemas/IdentityType'
      type: object
      required:
        - id
        - type
      title: Identity
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    IdentityType:
      type: string
      enum:
        - user
        - service_account
      title: IdentityType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````