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 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, notably
including cargo-openvm.
To authenticate with the Axiom Proving API, run
The API key can be passed in directly or by setting the AXIOM_API_KEY environment variable in a .env file.
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:
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
Build the guest locally, then register the resulting ELF and VMEXE pair with the Axiom
Proving API under the default
VM configuration ID with config-id = .
cargo axiom build uploads artifacts produced by cargo openvm build, so run the two in
this order from the guest program directory.
This will return a program-id and display the project information. You can check the build status with:
The status output will show both the program details and which project it belongs to:
cargo axiom build already waits for the program to be ready, so this step is only needed
if you passed --detach. Alternatively, build status can poll on its own:
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 .
- Program: A specific build of your code within a project. Programs have computer-generated names like
"bulky-piculet" and program IDs like .
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:
This will return a proof-id. You can check the status of the proving job with:
Similarly using --wait polls the proving status automatically
Once the proving job is done, you can download the proof using:
Finally, verify the proof is valid using:
Installation Prerequisites
Prior to installing cargo-axiom, make sure you have the following packages installed: