CLI Manual
Command-line interface for accessing Pending AI's retrosynthesis service.
Getting Started
Usage of the Pending AI CLI requires
an account for the Pending AI Platform and
a locally installed Python version
>=3.9.
The Pending AI CLI is available from the Python Package Index, the official third-party software repository for Python and can thus be easily installed using the package management system pip:
pip install pendingaiSuccessful installation can be verified with
pendingai --versionwhich is expected to output the name and version of the Pending AI CLI.

Jobs including their results will automatically be deleted 30 days after completion. It is your responsibility to retrieve any results before this time.
Authentication
Using the Pending AI services via the CLI requires an authenticated session. The pendingai auth command provides several subcommands to manage your authentication status.
Logging In
To initiate the login process, use the login subcommand:
This command uses device authorization, which will automatically open a web browser window. Follow the prompts in your browser to enter your Pending AI Platform credentials and authorize the CLI session.
For any account problems, contact Pending AI via email at [email protected].
Checking Session Status
You can check the status of your current authenticated session, including details like the associated user and expiry time:
Refreshing a Session
Authenticated sessions have a limited lifetime for security reasons. If your session is close to expiring or has already expired, you can attempt to refresh it without needing to fully log in again:
This will extend the lifetime of your current session if it's still valid for refreshing.
Retrieving the Access Token
Successful authentication stores an access token locally on your machine. You can retrieve the current access token using:
The access token retrieved via pendingai auth token can be used as a Bearer token for direct API access by including it in the Authorization header of each API request (e.g., Authorization: Bearer <your_token>).
Logging Out
To end your authenticated session and remove the locally cached authentication details, use the logout subcommand:
This ensures that your credentials are no longer stored by the CLI on the current machine.

Explore Available Engines and Libraries
Before submitting compounds, you might want to know which retrosynthesis engines and building block libraries are available to your account. You can list them using these commands:
The specific engines and libraries available depend on your Pending AI Platform account configuration. Please contact support at [email protected] if you want discuss generally available and customized engines and building block libraries.
Guide: Submitting Batch Retrosynthesis Jobs
The CLI supports submitting multiple retrosynthesis queries together as a single batch. This is ideal for running large-scale synthetic feasibility campaigns efficiently. Each query molecule within the batch is processed as an individual job, but all jobs within a batch share the same search parameters.
A synthetic accessibility summary can be obtained for all queries of a batch with a single command. The summary also contains Job IDs of individual queries of the batch. These Job IDs can then be used to retrieve detailed results including route information in JSON format and route depictions in PDF format for select queries of interest.
1. Prepare Input File & Submit Batch
Input files for batch jobs require line-delimited query molecules encoded as SMILES. Each line should contain a single valid SMILES string. Any repeated SMILES strings within the file will be automatically removed (deduplicated) before submission.
Here is an exemplary input file, molecules_batch_1.smi :
To submit the batch, use the pendingai retro batch submit command, providing the path to your SMILES file as an argument:
Upon successful submission, the command will output a unique Batch ID (e.g., bat_aa512a2). You will need this ID to track the batch status and retrieve results.
You can customize the search parameters (like engine, libraries, time limits) for all jobs in the batch using options with the submit command. See the Batch Submission Parameters section below for details. If no options are provided, sensible defaults will be used.

2. Track Batch Status
You can monitor the overall progress of the batch using the pendingai retro batch status command and the Batch ID obtained in the previous step:
This command reports the status of the batch as a whole (e.g., PENDING, RUNNING, COMPLETED, FAILED). The batch is considered completed only when all individual jobs within it have finished processing.
3. Retrieve Batch Results
Once the batch status is COMPLETED, you can retrieve the results for all jobs within that batch using the pendingai retro batch result command:
Results are saved to a file in JSON format. If the --output-file option is not provided, a default filename is generated that starts with the Batch ID and includes a timestamp (e.g., bat_aa512a2_results_2025-05-04T16-31-47.json) in the current directory.
Use the -o or --output-file option to specify a filename:
The results include synthesizability assessments and individual job IDs which can be used with other CLI commands for more detailed route analysis.

4. Retrieve Detailed Job Results
Taking the Job IDs of compounds of interest from the batch detailed results for multiple jobs can be retrieved by providing a file containing one Job ID per line using the -i or --input-file option:
Results are returned in JSON format and by default saved to an automatically generated timestamped filename in the current working directory. Use the -o or --output-file option to optionally specify a path and filename:
5. Depict Routes
Routes can be depicted for multiple jobs listed in an input file:
By default, PDF files named job_<job_id>.pdf are created in the current directory. You can optionally specify a different output directory using -o or --output-dir:
Use --force to overwrite existing PDF files without prompting.
Route depiction is an experimental feature. Feedback is welcome via [email protected]. This command can also be used effectively with Job IDs extracted from a batch result output to visualize routes for specific molecules of interest within a large campaign.
6. List Submitted Batches
To view a list of batches you have previously submitted, use the pendingai retro batch list command:
This provides a paginated overview including Batch IDs, creation times, and the number of jobs in each batch.
You can navigate through the list using the --page and --page-size options:
7. Delete a Batch
If you no longer need a batch and its associated job data, you can delete it using the pendingai retro batch delete command, provided it has completed processing:
Batches that are still PENDING or PROCESSING cannot be deleted. Deleting a batch permanently removes all associated job results from the platform. This action cannot be undone.

Batch Submission Parameters
The command pendingai retro batch submit SMILES_FILE is used to submit a batch of retrosynthesis jobs, where SMILES_FILE is the mandatory path to your input file.
If no other options are provided, sensible default values are used for the job parameters applied to all jobs within the batch.
For most use cases, the default parameter values are expected to yield good results. We encourage users to start with these defaults.
Customizable parameters for the submit command are explained below. A concise description of all options can also be printed to the terminal with:
Input File (Positional Argument)
Argument: SMILES_FILE
This is a mandatory positional argument specifying the path to the input file. The file must contain one molecule SMILES per line. SMARTS features are not supported.
Engine
Option: --engine TEXT
Specifies the identifier (TEXT) of the retrosynthesis engine to be used for executing all jobs in the batch.
You can list the names and identifiers of available retrosynthesis engines using:
If there is only one engine available for your Pending AI Platform account it will automatically be used if the --engine option is not specified during batch submission. If your account has access to more than one engine this option is mandatory.
Building Block Library
Option: --library TEXT
Specifies the identifier (TEXT) of a building block library to be used for the jobs in this batch. This option can be repeated to include multiple specific libraries.
If no --library option is provided, all building block libraries available to the user will be used by default.
Number of Routes
Option: --num-routes INTEGER
Default: 20
Range: [1, 50]
Controls the maximum number of potential retrosynthetic routes the software will attempt to generate for each job in the batch. The actual number of returned routes for any given job might be lower due to factors like target molecule complexity, building block availability, processing time limits, etc.
Processing Time Limit
Option: --time-limit INTEGER
Default: 300
Range: [60, 600]
Specifies the maximum processing time in seconds that the retrosynthesis engine will spend on each individual job within the batch. The actual time spent might be lower, even if fewer routes than requested are found.
Reaction Limit
Option: --reaction-limit INTEGER
Default: 3
Range: [1, 20]
Specifies the maximum number of times a particular reaction template can appear across all generated retrosynthetic routes for a single job in the batch.
Building Block Limit
Option: --block-limit INTEGER
Default: 3
Range: [1, 20]
Specifies the maximum number of times a particular building block molecule can appear within a single generated retrosynthetic route for any job in the batch.
Guide: Managing Individual Retrosynthesis Jobs
While batch submission (pendingai retro batch) is recommended for synthetic accessibility campaigns, the CLI also provides commands under pendingai retro job to operate on individual retrosynthesis jobs.
These job commands are primarily intended for testing, demonstration purposes, or retrieving detailed results for specific jobs identified from a batch analysis. For processing multiple molecules, using the batch commands is strongly recommended.
1. Submit a Single Job
To submit a single molecule for retrosynthesis, use the pendingai retro job submit command, providing the molecule's SMILES string as a mandatory argument.
Upon successful submission, the command will output a unique Job ID (e.g., 6800a125c14660367f058a90). You need this ID for subsequent steps like checking status or retrieving results.
You can customize the search parameters (engine, libraries, limits, etc.) using options. See the Single Job Submission Parameters section below for details. If only the SMILES is provided, sensible defaults are used.
Remember that jobs and their results are automatically deleted 30 days after completion.
2. Check Job Status
Use the pendingai retro job status command along with the Job ID to track the progress of an individual job:
This will display the current status (e.g., SUBMITTED, PROCESSING, COMPLETED, FAILED). You can also request the output in JSON format using the --json flag.
3. Retrieve Detailed Job Results
Once a job's status is COMPLETED, you can retrieve its detailed results, including the generated retrosynthetic routes, using the pendingai retro job result command.
You can retrieve results for a single job by providing its ID:
Alternatively, you can retrieve results for multiple jobs by providing a file containing one Job ID per line using the -i or --input-file option:
Results are returned in JSON format. Use the -o or --output-file option to save them directly to a file:
The pendingai retro job result command is particularly useful for getting detailed route information for specific jobs identified from a batch result file by their Job ID.
4. Depict Routes
For completed jobs, you can generate visual depictions of the found retrosynthetic routes as PDF files using the pendingai retro job depict command.
Similar to retrieving detailed results, you can depict routes for a single Job ID:
Or for multiple jobs listed in an input file:
By default, PDF files named job_<job_id>.pdf are created in the current directory. You can specify a different output directory using -o or --output-dir:
Use --force to overwrite existing PDF files without prompting.
Route depiction is an experimental feature. Feedback is welcome via [email protected]. This command can also be used effectively with Job IDs extracted from a batch result output to visualize routes for specific molecules of interest within a large campaign.
5. List Submitted Jobs
To view a paginated list of your individual job submissions, use pendingai retro job list:
This command displays key information, including Job ID, status, and basic parameters. You can filter by status and control pagination:
Use pendingai retro job result to get the full route details for completed jobs.
6. Delete a Job
If you no longer need an individual job and its results, you can delete it using pendingai retro job delete and its Job ID:
Deleting a job permanently removes it and its results from the platform. This action cannot be undone.
Single Job Submission Parameters
The command pendingai retro job submit SMILES is used to submit a single retrosynthesis job, where SMILES is the mandatory SMILES string of the query molecule.
If no other options are provided, sensible default values are used for the job parameters.
For most single job tests or demonstrations, the default parameter values are suitable.
Customizable parameters for the submit command are explained below. A concise description of all options can also be printed to the terminal with:
Query Molecule (Positional Argument)
Argument: SMILES
This is a mandatory positional argument specifying the SMILES string of the single query molecule for the job. SMARTS features are not supported.
Engine
Option: --engine TEXT
Specifies the identifier of the retrosynthesis engine to execute this job. If only one engine is available for your account, it will be used automatically, making this parameter optional. You can list available engine IDs using pendingai retro engines.
Building Block Library
Option: --library TEXT
Specifies the identifier (TEXT) of a building block library to be used for this job. This option can be repeated to include multiple specific libraries. Defaults to using all available libraries if not specified. See pendingai retro libraries for available IDs.
Number of Routes
Option: --num-routes INTEGER
Default: 20
Range: [1, 50]
Controls the maximum number of potential retrosynthetic routes the software will attempt to generate for this job.
Processing Time Limit
Option: --time-limit INTEGER
Default: 300
Range: [60, 600]
Specifies the maximum processing time in seconds that the retrosynthesis engine will spend on this job.
Reaction Limit
Option: --reaction-limit INTEGER
Default: 3
Range: [1, 20]
Specifies the maximum number of times a particular reaction template can appear across all generated retrosynthetic routes for this job.
Building Block Limit
Option: --block-limit INTEGER
Default: 3
Range: [1, 20]
Specifies the maximum number of times a particular building block molecule can appear within a single generated retrosynthetic route for this job.
JSON Output
Option: --json
When submitting a job, using this flag will render the confirmation output (including the Job ID) in JSON format instead of the default text format.
FAQs
I set --num-routes 50 when submitting a job or batch, but get significantly fewer than 50 routes in my results. Why?
--num-routes 50 when submitting a job or batch, but get significantly fewer than 50 routes in my results. Why?The --num-routes option sets the maximum number of retrosynthetic routes the engine will attempt to generate per job. It acts as an upper limit. The actual number of routes found can be lower due to several factors, including:
The complexity of the target molecule (some molecules are inherently harder to find routes for).
The contents of the selected building block library/libraries.
The processing time limit (
--time-limit) being reached before the maximum number of routes is found.Internal algorithm constraints or heuristics designed to prioritize diverse or high-quality routes.
What's the difference between a Batch ID (bat_...) and a Job ID ?
bat_...) and a Job ID ?A Batch ID refers to the entire collection of jobs submitted together using
pendingai retro batch submit. You use the Batch ID to check the overall status (batch status), retrieve summarized results for all jobs in the batch (batch result), list batches (batch list), or delete the entire batch (batch delete).A Job ID refers to a single retrosynthesis calculation for one specific molecule, whether submitted individually (
retro job submit) or as part of a batch. You typically obtain Job IDs from the output ofpendingai retro batch result. These Job IDs are then used to get detailed results including route information (job result) or route depictions (job depict) for that specific molecule.
How do I get the detailed routes for specific molecules after running a batch?
Run
pendingai retro batch result <your_batch_id> -o batch_results.jsonto get the results for the entire batch, saving them to a file.Inspect the
batch_results.jsonfile. Each entry will contain information about a specific molecule from your input file, including its corresponding Job ID<job_id>.Identify the Job IDs for the molecules you are interested in.
Use
pendingai retro job result <job_id>(for one job) orpendingai retro job result -i <file_with_job_ids>(for multiple jobs) to retrieve the detailed results, including the routes, for those specific jobs.Alternatively, use
pendingai retro job depict <job_id>orpendingai retro job depict -i <file_with_job_ids>to generate PDF depictions of the routes.
What happens if one job fails within a batch?
The batch processing system is designed to be robust. If an individual job within a batch fails (e.g., due to an invalid input SMILES or an unexpected engine error for that specific molecule), it typically does not stop the entire batch. Other jobs in the batch will continue to process.
When you retrieve the batch results using pendingai retro batch result, the status or result entry for the failed job should indicate the failure. The overall batch status might still eventually become COMPLETED if all other jobs finish, but you should check the individual job statuses within the batch result file for any failures.
My batch submission failed immediately. What should I check?
Common reasons for immediate batch submission failure include:
Authentication: Ensure you are logged in (
pendingai auth status). Try refreshing your session (pendingai auth refresh) or logging in again (pendingai auth login).Input File: Verify the path to your SMILES file is correct and that the file exists and is readable. Check that the file contains valid SMILES strings, one per line. Invalid characters or formatting can cause errors.
Invalid Parameters: Double-check any options you provided (e.g.,
--engine,--library, numeric limits) to ensure the values are valid and available to your account. Usependingai retro enginesandpendingai retro librariesto confirm IDs.Permissions: Ensure your account has permission to use the selected engine and libraries. Contact support if you suspect a permissions issue.
How many SMILES can my input file contain for a batch submission?
The number of SMILES per input file is limited to 100,000. Please reach out to our support at [email protected] to discuss options to increase this limit.
Last updated
Was this helpful?

