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

# Register new program

> Upload and register a new OpenVM program for compilation.

    The program must be uploaded as a tar.gz archive containing the guest program source code and dependencies.
    You can either provide a config_id for an existing configuration or upload a new config file.

    ## Example Usage

    ```bash
    curl -X POST "https://api.axiom.xyz/v1/programs" \
      -H "Axiom-API-Key: your-api-key" \
      -F "program=@my_program.tar.gz" \
      -F "config_id=cfg_xxxx" \
      -F "program_path=." \
      -F "cargo_root_path=." \
      -F "project_name=My Project"
    ```



## OpenAPI

````yaml POST /v1/programs
openapi: 3.1.0
info:
  title: Axiom Proving API
  description: |-
    ## Axiom Cloud Proving API

        The Axiom Proving API allows you to compile, execute, and prove OpenVM programs on Axiom's cloud infrastructure.

        All endpoints require an API key passed in the `Axiom-API-Key` header.
        
  version: 1.0.0
servers:
  - url: https://api.axiom.xyz
    description: Production API
  - url: https://api.staging.app.axiom.xyz
    description: Staging API
security: []
paths:
  /v1/programs:
    post:
      tags:
        - programs
      summary: Register Program
      description: |-
        Upload and register a new OpenVM program for compilation.

            The program must be uploaded as a tar.gz archive containing the guest program source code and dependencies.
            You can either provide a config_id for an existing configuration or upload a new config file.

            ## Example Usage

            ```bash
            curl -X POST "https://api.axiom.xyz/v1/programs" \
              -H "Axiom-API-Key: your-api-key" \
              -F "program=@my_program.tar.gz" \
              -F "config_id=cfg_xxxx" \
              -F "program_path=." \
              -F "cargo_root_path=." \
              -F "project_name=My Project"
            ```
      operationId: register_program_v1_programs_post
      parameters:
        - name: config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The UUID of the config to use
            title: Config Id
          description: The UUID of the config to use
        - name: program_path
          in: query
          required: false
          schema:
            type: string
            description: >-
              The relative path from the uploaded directory root to the guest
              program
            default: .
            title: Program Path
          description: >-
            The relative path from the uploaded directory root to the guest
            program
        - name: cargo_root_path
          in: query
          required: false
          schema:
            type: string
            description: >-
              The relative path from the uploaded directory root to the cargo
              workspace root
            default: .
            title: Cargo Root Path
          description: >-
            The relative path from the uploaded directory root to the cargo
            workspace root
        - name: bin_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The name of the binary to build. If not provided, the build will
              succeed only if there is one binary in the workspace.
            title: Bin Name
          description: >-
            The name of the binary to build. If not provided, the build will
            succeed only if there is one binary in the workspace.
        - name: commit_sha
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: If applicable, the commit sha of the guest program
            title: Commit Sha
          description: If applicable, the commit sha of the guest program
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The ID of the project to associate this program with. If not
              provided, a new project will be created.
            title: Project Id
          description: >-
            The ID of the project to associate this program with. If not
            provided, a new project will be created.
        - name: project_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Name for new project if project_id is not provided
            title: Project Name
          description: Name for new project if project_id is not provided
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_register_program_v1_programs_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
        '201':
          description: Program registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
        '400':
          description: Invalid program file or parameters
        '404':
          description: Not found
        '413':
          description: Program file too large
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Body_register_program_v1_programs_post:
      properties:
        program:
          type: string
          format: binary
          title: Program
          description: >-
            A tar.gz archive of a directory containing the guest program and its
            dependencies
        config:
          anyOf:
            - type: string
              format: binary
            - type: 'null'
          title: Config
          description: A toml file with all the parameters to configure the proving system
      type: object
      required:
        - program
      title: Body_register_program_v1_programs_post
    PostResponse:
      properties:
        id:
          type: string
          title: Id
      type: object
      required:
        - id
      title: PostResponse
      description: Generic response for POST operations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Axiom-API-Key

````