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 toolcargo-axiom using the following command. You should first make sure
you have installed the necessary Prerequisites, notably
including cargo-openvm.
AXIOM_API_KEY environment variable in a .env file.
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: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 withconfig-id = cfg_01kyqp0f663pf2n4er2p4fyd6d.
cargo axiom build uploads artifacts produced by cargo openvm build, so run the two in
this order from the guest program directory.program-id and display the project information. You can check the build status with:
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 likeprj_01k3r5vxwn4f1r3ekna6vs7ppd. - Program: A specific build of your code within a project. Programs have computer-generated names like
"bulky-piculet"and program IDs likeprg_01k3r5vx20szgmn225k11hw8ez.
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:proof-id. You can check the status of the proving job with:
--wait polls the proving status automatically
Installation Prerequisites
Prior to installingcargo-axiom, make sure you have the following packages installed:
Ubuntu
macOS