> ## 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.

# Quickstart

> Generate your first proof with the Axiom Proving API in under 5 minutes

export const EXAMPLE_PROGRAM_ID = "prg_01k3r5vx20szgmn225k11hw8ez";

export const EXAMPLE_PROJECT_ID = "prj_01k3r5vxwn4f1r3ekna6vs7ppd";

export const DEFAULT_CONFIG_ID = "cfg_01kh1zjac9n284k9tbrcnp986b";

export const RUST_NIGHTLY = "nightly-2025-08-02";

export const CARGO_TOOLCHAIN = "1.90";

export const AXIOM_CLI_VERSION = "v1.1.0";

export const OPENVM_VERSION = "v1.5.0";

## Setup API Access

### Get an API Key

The API is currently available to invited users only. To get an API key, get an invitation to the [API console](https://prove.axiom.xyz) from the Axiom team and create a new key using your account.

### Install the Axiom CLI and Initialize with your API Key

To use the Axiom Proving API from CLI, you must install the Axiom command line tool
`cargo-axiom` using the following command. You should first make sure
you have installed the necessary [Prerequisites](#installation-prerequisites), notably
including `cargo-openvm`.

<CodeBlock language="bash">
  {`cargo +${CARGO_TOOLCHAIN} install --locked --git https://github.com/axiom-crypto/axiom-api-cli.git --tag ${AXIOM_CLI_VERSION} cargo-axiom`}
</CodeBlock>

To authenticate with the Axiom Proving API, run

```bash theme={null}
cargo axiom register --api-key <API_KEY>
```

The API key can be passed in directly or by setting the `AXIOM_API_KEY` environment variable in a `.env` file.

```bash theme={null}
AXIOM_API_KEY=<API_KEY>
```

Note that `cargo axiom register` should be run in the directory containing the `.env` file.

## Register a Program

We will now walk through an example of generating a proof on the Axiom Proving API for an example
Fibonacci guest program. First, initialize a new project:

```bash theme={null}
cargo axiom init fibonacci
```

Note that this creates the `Cargo.toml` and adds `openvm` dependencies for you.
The `openvm` version used depends on your local `cargo openvm` version, so make sure `cargo openvm` is up to date.

### Building Your Program

Register your program with the Axiom Proving API to be reproducibly built with the default
[VM configuration ID](/user-guides/openvm/configuration#supported-configurations) with <code>config-id = {DEFAULT_CONFIG_ID}</code>.

<CodeBlock language="bash">
  {`cargo axiom build --config-id ${DEFAULT_CONFIG_ID}`}
</CodeBlock>

This will return a `program-id` and display the project information. You can check the build status with:

```bash theme={null}
cargo axiom build status --program-id [program-id]
```

The status output will show both the program details and which project it belongs to:

<CodeBlock>
  {`Build Status:
    ID: ${EXAMPLE_PROGRAM_ID}
    Name: bulky-piculet
    Project ID: ${EXAMPLE_PROJECT_ID}
    Project Name: abiding-magpie
    Status: ready
    ...`}
</CodeBlock>

Alternatively, passing in `--wait` will poll the status automatically.

<CodeBlock language="bash">
  {`cargo axiom build --config-id ${DEFAULT_CONFIG_ID} --wait`}
</CodeBlock>

### Understanding Projects vs Programs

The Axiom Proving API organizes your code into **Projects** and **Programs**:

* **Project**: A logical container that groups related programs together. Projects have human-readable names like `"fibonacci"` and unique project IDs like <code>{EXAMPLE_PROJECT_ID}</code>.
* **Program**: A specific build of your code within a project. Programs have computer-generated names like `"bulky-piculet"` and program IDs like <code>{EXAMPLE_PROGRAM_ID}</code>.

The first time you run `cargo axiom build`, the CLI will prompt you for a project name and create the project accordingly.
The `project-id` is stored locally at `.axiom/project-id`. On subsequent runs in the same directory, the CLI will reuse this `project-id` so new programs are added to the same project.

To add a program to an existing project, add `--project-id <ID>` to your build command.

## Generate a Proof

Next, request a proof from the Axiom Proving API:

```bash theme={null}
cargo axiom prove --program-id [program-id] --type stark --input "0x010A00000000000000"
```

This will return a `proof-id`. You can check the status of the proving job with:

```bash theme={null}
cargo axiom prove status --proof-id [proof-id]
```

Similarly using `--wait` polls the proving status automatically

```bash theme={null}
cargo axiom prove --program-id [program-id] --type stark --input "0x010A00000000000000" --wait
```

Once the proving job is done, you can download the proof using:

```bash theme={null}
cargo axiom prove download --proof-id [proof-id] --type stark --output proof.json
```

Finally, verify the proof is valid using:

```bash theme={null}
cargo axiom verify stark --program-id [program-id] --proof proof.json
```

## Installation Prerequisites

Prior to installing `cargo-axiom`, make sure you have the following packages installed:

<CodeGroup>
  <CodeBlock language="bash" filename="Ubuntu">
    {`# install Rust
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
        . "$HOME/.cargo/env"

        # install nightly Rust toolchain for binary builds
        rustup install ${RUST_NIGHTLY}
        rustup component add rust-src --toolchain ${RUST_NIGHTLY}

        # install build tools for Ubuntu
        sudo apt update
        sudo apt install -y build-essential libssl-dev pkg-config   # gcc, g++, make, libc headers

        # install cargo-openvm
        cargo +${CARGO_TOOLCHAIN} install --locked --git https://github.com/openvm-org/openvm.git --tag ${OPENVM_VERSION} cargo-openvm`}
  </CodeBlock>

  <CodeBlock language="bash" filename="macOS">
    {`# install Rust
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
        . "$HOME/.cargo/env"

        # install nightly Rust toolchain for binary builds
        rustup install ${RUST_NIGHTLY}
        rustup component add rust-src --toolchain ${RUST_NIGHTLY}

        # install build tools for macOS
        xcode-select --install
        brew install cmake git curl

        # install cargo-openvm
        cargo +${CARGO_TOOLCHAIN} install --locked --git https://github.com/openvm-org/openvm.git --tag ${OPENVM_VERSION} cargo-openvm`}
  </CodeBlock>
</CodeGroup>
