> For the complete documentation index, see [llms.txt](https://docs.pending.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pending.ai/developer-tools/cli.md).

# CLI

Documentation for the Pending AI platform CLI

## Overview

The Pending AI CLI (`pendingai` on [PyPI](https://pypi.org/project/pendingai/)) runs the Pending AI services from your terminal. It wraps the APIs, handling authentication for you:

* `pendingai generator`: [PAI Generator](/api-reference/pai-generator.md)
* `pendingai retro`: [PAI Retro](/api-reference/pai-retro.md)
* `pendingai synth`: [PAI Synth](/api-reference/pai-synth.md)

This page documents **version 0.18.0**. See [Installation](/getting-started/installation.md) to install it.

### Authentication

`pendingai auth login` opens a browser to sign in, then asks which **team** (organization) to sign in to, if you belong to more than one. Everything you run is billed to that team's plan. To switch team, log in again.

```bash
pendingai auth login                 # sign in in a browser, then pick a team
pendingai auth login --org my-team   # sign in to a team without being asked
pendingai auth login --device        # sign in with a code, e.g. over SSH (the team can't be chosen)
pendingai auth status                # show the signed-in account and team
pendingai auth refresh               # refresh the session
```

See [Setting up authentication](/developer-tools/guides/setting-up-a-authentication.md) for more.

### Long-running commands

* **`pendingai generator sample`** generates up to 500 molecules as one sample, polling until they're ready. For more than 500 it creates a [sample batch](/api-reference/pai-generator.md) instead, which stays on your account (see `list-batches` and `export-batch`) if the command is interrupted. If the model has to be started first, it says so (this takes about 10-15 s), and it reports the sampling time separately.
* **`pendingai synth search`** queues the search as a Plan and waits for its result. If the search takes too long, it prints the Plan's ID so you can fetch the result later with `pendingai synth plan`. `--legacy` runs the search as one direct request instead.

### When a request is refused for your team's plan

If your team's plan doesn't cover a request (HTTP `402`), the CLI prints the service's reason: for example, that the team has no plan, or that its monthly allowance and overage limit are used up and how much is still available. Nothing is run or billed. A team admin can check the plan and overage limit on the account portal's Billing page. See [Accounts, teams and billing](https://github.com/pendingai/gitbook/tree/main/getting-started/accounts-and-billing.md).

***

## Command reference

The reference below is the `--help` output of every command in `pendingai==0.18.0`. Run any command with `--help` to see it for the version you have installed.

## `pendingai`

```
 Usage: pendingai [OPTIONS] COMMAND [ARGS]...

 Pending AI Command-Line Interface.

 Cheminformatics services offered by this CLI are accessible through an API integration with the Pending AI platform. An authenticated
 session is required for use; see <pendingai auth>. Documentation is available with <pendingai docs>.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version          Show the application version and exit.                                                                                │
│ --help             Show this message and exit.                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ docs       Open documentation in a web browser.                                                                                          │
│ auth       Authenticate with the Pending AI platform.                                                                                    │
│ retro      High-throughput deep-learning retrosynthesis service.                                                                         │
│ generator  Generative solution for molecules.                                                                                            │
│ synth      Run a retrosynthetic tree search on a target molecule.                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 For support, issues, or feature requests, please email support@pending.ai.
```

### `pendingai docs`

```
 Usage: pendingai docs [OPTIONS]

 Open documentation in a web browser.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### `pendingai auth`

```
 Usage: pendingai auth [OPTIONS] COMMAND [ARGS]...

 Manage an authenticated session with the Pending AI platform.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ login    Login to a Pending AI account.                                                                                                  │
│ logout   Logout of a Pending AI account.                                                                                                 │
│ refresh  Refresh an authenticated session.                                                                                               │
│ status   Show active session information.                                                                                                │
│ token    Get the access token of the current session.                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai auth login`

```
 Usage: pendingai auth login [OPTIONS]

 Login to a Pending AI account.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --org           <str>  Organization (team) ID or name to log in to; asked for if not given.                                              │
│ --device               Log in with a code instead of a browser on this machine (e.g. over SSH). The organization can't be chosen this    │
│                        way.                                                                                                              │
│ --help                 Show this message and exit.                                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai auth logout`

```
 Usage: pendingai auth logout [OPTIONS]

 Logout of a Pending AI account.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai auth refresh`

```
 Usage: pendingai auth refresh [OPTIONS]

 Refresh an authenticated session.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai auth status`

```
 Usage: pendingai auth status [OPTIONS]

 Show active session information.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai auth token`

```
 Usage: pendingai auth token [OPTIONS]

 Get the access token of the current session.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### `pendingai retro`

```
 Usage: pendingai retro [OPTIONS] COMMAND [ARGS]...

 High-throughput deep-learning retrosynthesis service.

 Retrosynthesis predictions are generated by submitting a batch of jobs to an engine, monitoring its status, and retrieving completed
 results. For more information refer to the documentation with <pendingai docs>.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ list-engines    Retrieve a list of selectable Engines.                                                                                   │
│ list-libraries  Retrieve a list of selectable Libraries.                                                                                 │
│ version         Retrieve the deployed retrosynthesis API version.                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Retrosynthesis Operations ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ create          Create a retrosynthesis Job for a query SMILES structure.                                                                │
│ status          Retrieve status information for a retrosynthesis Job.                                                                    │
│ delete          Delete a retrosynthesis Job and any calculated results.                                                                  │
│ export          Export results for one or more retrosynthesis Jobs to file.                                                              │
│ list            Retrieve a list of retrosynthesis Jobs.                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Batch Operations ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ create-batch    Create a retrosynthesis Batch.                                                                                           │
│ create-batches  Create multiple retrosynthesis Batches from one large SMILES file.                                                       │
│ delete-batch    Delete a retrosynthesis Batch.                                                                                           │
│ export-batch    Export results from a retrosynthesis Batch to file.                                                                      │
│ list-batches    Retrieve a list of retrosynthesis Batches.                                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro list-engines`

```
 Usage: pendingai retro list-engines [OPTIONS]

 Retrieve a list of selectable Engines.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro list-libraries`

```
 Usage: pendingai retro list-libraries [OPTIONS]

 Retrieve a list of selectable Libraries.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro version`

```
 Usage: pendingai retro version [OPTIONS]

 Retrieve the deployed retrosynthesis API version.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro create`

```
 Usage: pendingai retro create [OPTIONS] {SMILES}

 Create a retrosynthesis Job for a query SMILES structure.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES      <str>  A SMILES molecule to perform retrosynthesis on. [required]                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Retrosynthesis Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --engine          -e      <str>                     An Engine ID to use for retrosynthesis.                                              │
│ --library         -l      LIST                      One or more Library IDs to use for retrosynthesis.                                   │
│ --num-routes              <int range> [1<=x<=50]    Max number of retrosynthesis routes to generate. [default: 1]                        │
│ --time-limit              <int range> [60<=x<=600]  Max allowed time in seconds for a retrosynthesis Job. [default: 60]                  │
│ --reaction-limit          <int range> [1<=x<=25]    Max times a reaction can be used in retrosynthesis routes. [default: 10]             │
│ --block-limit             <int range> [1<=x<=25]    Max times a building block can be used in retrosynthesis routes. [default: 10]       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro status`

```
 Usage: pendingai retro status [OPTIONS] {JOB_ID}

 Retrieve status information for a retrosynthesis Job.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    JOB_ID      <str>  A retrosynthesis Job ID. [required]                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro delete`

```
 Usage: pendingai retro delete [OPTIONS] {JOB_ID}

 Delete a retrosynthesis Job and any calculated results.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    JOB_ID      <str>  A retrosynthesis Job ID. [required]                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro export`

```
 Usage: pendingai retro export [OPTIONS] {JOB_IDS}

 Export results for one or more retrosynthesis Jobs to file.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    JOB_IDS      <str>  One or more retrosynthesis Job IDs. [required]                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output  -o      <directory>       A directory to save any command results to.                                                          │
│                                     [default:                                                                                            │
│                                     ./out]                                                                                               │
│ --format          <json|yaml|html>  Result format to use for exporting retrosynthesis results. [default: json]                           │
│ --depict                            Whether to open route depictions in HTML reports in the webbrowser.                                  │
│ --help                              Show this message and exit.                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro list`

```
 Usage: pendingai retro list [OPTIONS]

 Retrieve a list of retrosynthesis Jobs.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Pagination Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --page    -p      <int range> [1<=x<=1000000]  Page number being fetched. [default: 1]                                                   │
│ --limit   -l      <int range> [1<=x<=100]      Number of results per page. [default: 10]                                                 │
│ --after           <str>                        Cursor for results after a specific resource ID.                                          │
│ --before          <str>                        Cursor for results before a specific resource ID.                                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro create-batch`

```
 Usage: pendingai retro create-batch [OPTIONS] {SMILES_FILE}

 Create a retrosynthesis Batch.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES_FILE      <file>  A filepath containing line-delimited SMILES molecules. [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --name         -n      <str>  An optional name for a retrosynthesis Batch.                                                               │
│ --description  -d      <str>  An optional description for a retrosynthesis Batch.                                                        │
│ --skip-errors                 Skip any errors encountered during command execution.                                                      │
│ --help                        Show this message and exit.                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Retrosynthesis Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --engine          -e      <str>                     An Engine ID to use for retrosynthesis.                                              │
│ --library         -l      LIST                      One or more Library IDs to use for retrosynthesis.                                   │
│ --num-routes              <int range> [1<=x<=50]    Max number of retrosynthesis routes to generate. [default: 1]                        │
│ --time-limit              <int range> [60<=x<=600]  Max allowed time in seconds for a retrosynthesis Job. [default: 60]                  │
│ --reaction-limit          <int range> [1<=x<=25]    Max times a reaction can be used in retrosynthesis routes. [default: 10]             │
│ --block-limit             <int range> [1<=x<=25]    Max times a building block can be used in retrosynthesis routes. [default: 10]       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro create-batches`

```
 Usage: pendingai retro create-batches [OPTIONS] {SMILES_FILE}

 Create multiple retrosynthesis Batches from one large SMILES file.

 The file is automatically split into as many Batches as needed to
 respect the per-batch size limit -- each chunk is created as its own,
 independently billed Batch resource. Use 'create-batch' instead for
 a file that already fits in a single Batch.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES_FILE      <file>  A filepath containing line-delimited SMILES molecules. [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --name         -n      <str>  An optional name for a retrosynthesis Batch.                                                               │
│ --description  -d      <str>  An optional description for a retrosynthesis Batch.                                                        │
│ --skip-errors                 Skip any errors encountered during command execution.                                                      │
│ --help                        Show this message and exit.                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Retrosynthesis Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --engine          -e      <str>                     An Engine ID to use for retrosynthesis.                                              │
│ --library         -l      LIST                      One or more Library IDs to use for retrosynthesis.                                   │
│ --num-routes              <int range> [1<=x<=50]    Max number of retrosynthesis routes to generate. [default: 1]                        │
│ --time-limit              <int range> [60<=x<=600]  Max allowed time in seconds for a retrosynthesis Job. [default: 60]                  │
│ --reaction-limit          <int range> [1<=x<=25]    Max times a reaction can be used in retrosynthesis routes. [default: 10]             │
│ --block-limit             <int range> [1<=x<=25]    Max times a building block can be used in retrosynthesis routes. [default: 10]       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro delete-batch`

```
 Usage: pendingai retro delete-batch [OPTIONS] {BATCH_ID}

 Delete a retrosynthesis Batch.

 This operation is not reversible.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    BATCH_ID      <str>  A retrosynthesis Batch ID. [required]                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --force  -f        Force the command to run, skip confirmation prompts.                                                                  │
│ --help             Show this message and exit.                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro export-batch`

```
 Usage: pendingai retro export-batch [OPTIONS] {BATCH_ID}

 Export results from a retrosynthesis Batch to file.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    BATCH_ID      <str>  A retrosynthesis Batch ID. [required]                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output  -o      <file>               A filepath to save any command results to.                                                        │
│ --format          <json|yaml|csv|tsv>  Result format to use for exporting retrosynthesis batch results. [default: json]                  │
│ --force   -f                           Force the command to run, skip confirmation prompts.                                              │
│ --help                                 Show this message and exit.                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai retro list-batches`

```
 Usage: pendingai retro list-batches [OPTIONS]

 Retrieve a list of retrosynthesis Batches.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Pagination Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --page    -p      <int range> [1<=x<=1000000]  Page number being fetched. [default: 1]                                                   │
│ --limit   -l      <int range> [1<=x<=100]      Number of results per page. [default: 10]                                                 │
│ --after           <str>                        Cursor for results after a specific resource ID.                                          │
│ --before          <str>                        Cursor for results before a specific resource ID.                                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### `pendingai generator`

```
 Usage: pendingai generator [OPTIONS] COMMAND [ARGS]...

 Powerful and efficient solution for creating novel, diverse, drug-like molecules. For more information refer to the documentation with
 <pendingai docs>.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ list-models   List molecule generator models.                                                                                            │
│ version       Retrieve the deployed generator API version.                                                                               │
│ sample        Sample molecules from a generator model and save as SMILES to file.                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Batch Operations ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ create-batch  Create a Sample Batch, splitting one large sampling request into                                                           │
│               independently-processed chunks.                                                                                            │
│ batch         Retrieve a Sample Batch and its live processing status.                                                                    │
│ list-batches  List Sample Batches.                                                                                                       │
│ export-batch  Export every completed chunk's generated SMILES from a Sample Batch to                                                     │
│               a file, one SMILES per line.                                                                                               │
│ delete-batch  Delete a Sample Batch.                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator list-models`

```
 Usage: pendingai generator list-models [OPTIONS]

 List molecule generator models.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator version`

```
 Usage: pendingai generator version [OPTIONS]

 Retrieve the deployed generator API version.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator sample`

```
 Usage: pendingai generator sample [OPTIONS]

 Sample molecules from a generator model and save as SMILES to file.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output       -o      <file>              A filepath to save any command results to.                                                    │
│ --num-samples  -n      <int range> [x>=1]  Number of molecules to sample. [default: 500]                                                 │
│ --model        -m      <str>               Model ID to use for molecule sampling.                                                        │
│ --append                                   Append to the output file without prompting.                                                  │
│ --force        -f                          Force the command to run, skip confirmation prompts.                                          │
│ --help                                     Show this message and exit.                                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator create-batch`

```
 Usage: pendingai generator create-batch [OPTIONS]

 Create a Sample Batch, splitting one large sampling request into independently-processed chunks.

 Unlike 'sample', chunks are generated asynchronously in the background
 -- check on them with 'list-batches' and 'batch', and retrieve results
 with 'export-batch' once complete.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --num-samples  -n      <int range> [x>=1]  Number of molecules to sample. [default: 500]                                                 │
│ --model        -m      <str>               Model ID to use for molecule sampling.                                                        │
│ --help                                     Show this message and exit.                                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator batch`

```
 Usage: pendingai generator batch [OPTIONS] {batch_id}

 Retrieve a Sample Batch and its live processing status.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator list-batches`

```
 Usage: pendingai generator list-batches [OPTIONS]

 List Sample Batches.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Pagination Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --limit   -l      <int range> [1<=x<=100]  Number of results per page. [default: 10]                                                     │
│ --after           <str>                    Cursor for results after a specific resource ID.                                              │
│ --before          <str>                    Cursor for results before a specific resource ID.                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator export-batch`

```
 Usage: pendingai generator export-batch [OPTIONS] {batch_id}

 Export every completed chunk's generated SMILES from a Sample Batch to a file, one SMILES per line.

 Chunks that haven't completed yet (or failed) are skipped -- check
 'batch' first to see how many chunks are still outstanding.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output  -o      <file>  A filepath to save any command results to.                                                                     │
│ --force   -f              Force the command to run, skip confirmation prompts.                                                           │
│ --help                    Show this message and exit.                                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai generator delete-batch`

```
 Usage: pendingai generator delete-batch [OPTIONS] {batch_id}

 Delete a Sample Batch.

 The batch stops appearing in 'list-batches'/'batch' immediately, but
 archiving its chunks happens in the background afterward. This
 operation is not reversible.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --force  -f        Force the command to run, skip confirmation prompts.                                                                  │
│ --help             Show this message and exit.                                                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### `pendingai synth`

```
 Usage: pendingai synth [OPTIONS] COMMAND [ARGS]...

 High-throughput retrosynthetic tree search service.

 A search runs a complete tree search for one target molecule and returns every validated route found within the requested time budget,
 along with vendor pricing for the building blocks involved. 'search' queues it as a Plan and waits for the result; batches of Plans run
 separately, so a large batch never delays a single search.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ list-engines    List retrosynthesis engines available for a Plan's tree search, along with                                               │
│                 each engine's current queue length.                                                                                      │
│ list-libraries  List building-block libraries available for a Plan's tree search.                                                        │
│ version         Retrieve the deployed synth API version.                                                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Search Operations ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ search          Run a retrosynthetic tree search for a target SMILES molecule.                                                           │
│ plan            Retrieve a single Plan by its ID, including its tree search result.                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Batch Operations ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ create-batch    Create a Batch of retrosynthetic tree search Plans from a SMILES file.                                                   │
│ create-batches  Create multiple Batches of retrosynthetic tree search Plans from one                                                     │
│                 large SMILES file.                                                                                                       │
│ batch           Retrieve a Batch and a page of the Plans it contains.                                                                    │
│ list-batches    List Batches of retrosynthetic tree search Plans.                                                                        │
│ export-batch    Export every Plan from a Batch of retrosynthetic tree search Plans to file.                                              │
│ delete-batch    Delete a Batch of retrosynthetic tree search Plans.                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth list-engines`

```
 Usage: pendingai synth list-engines [OPTIONS]

 List retrosynthesis engines available for a Plan's tree search, along with each engine's current queue length.

 Unlike 'retro list-engines', this is a fixed set of engines -- only the
 queue length is read live. Pass --watch to keep refreshing and see each
 engine's queue rate of change instead of a single snapshot.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --watch                                   Keep refreshing and show each engine's queue rate of change (messages/second), computed from   │
│                                           consecutive samples.                                                                           │
│ --interval        <float range> [x>=1.0]  Seconds between refreshes when using --watch. [default: 3.0]                                   │
│ --help                                    Show this message and exit.                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth list-libraries`

```
 Usage: pendingai synth list-libraries [OPTIONS]

 List building-block libraries available for a Plan's tree search.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth version`

```
 Usage: pendingai synth version [OPTIONS]

 Retrieve the deployed synth API version.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth search`

```
 Usage: pendingai synth search [OPTIONS] {SMILES}

 Run a retrosynthetic tree search for a target SMILES molecule.

 The search is queued as a Plan on its engine's interactive queue and the
 command waits for its result, as a single retrosynthesis job does. If it
 takes too long, the Plan's ID is printed so the result can be fetched later
 with 'synth plan'. Against a server that can't queue single searches yet,
 it runs the search directly instead.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES      <str>  A SMILES molecule to perform retrosynthesis on. [required]                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --legacy          Run the search as one direct request instead of as a queued Plan. Kept as a fallback; the result is the same.          │
│ --help            Show this message and exit.                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Search Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --early-exit                             --no-early-exit                                     Stop as soon as one validated solution      │
│                                                                                              route is found, rather than searching for   │
│                                                                                              the full time budget.                       │
│                                                                                              [default: early-exit]                       │
│ --max-seconds                                                        <float range> [x>=0.1]  Maximum wall-clock time in seconds to run   │
│                                                                                              the tree search.                            │
│                                                                                              [default: 4.0]                              │
│ --max-depth                                                          <int range> [1<=x<=50]  Maximum number of reaction steps (tree      │
│                                                                                              depth) to search.                           │
│                                                                                              [default: 5]                                │
│ --mask-trivial-solution                  --allow-trivial-solution                            Exclude the trivial zero-step solution      │
│                                                                                              where the target molecule is itself a       │
│                                                                                              purchasable building block.                 │
│                                                                                              [default: mask-trivial-solution]            │
│ --mask-bblocks-mw-gte                                                <float>                 Exclude building blocks with molecular      │
│                                                                                              weight (daltons) greater than or equal to   │
│                                                                                              this value.                                 │
│ --mask-usd-pricing-gte                                               <float>                 Exclude building blocks priced at or above  │
│                                                                                              this normalised USD-per-gram cost.          │
│                                                                                              [default: 10000.0]                          │
│ --ships-to                                                           <str>                   ISO country code used to scope pricing and  │
│                                                                                              lead-time annotations to a specific         │
│                                                                                              delivery region.                            │
│                                                                                              [default: US]                               │
│ --mask-lead-times-gte                                                <float>                 Exclude building blocks with a lead time    │
│                                                                                              (days) to the --ships-to region greater     │
│                                                                                              than or equal to this value.                │
│ --max-backbone-groups                                                <int range> [x>=1]      Maximum number of distinct synthetic route  │
│                                                                                              backbones to return.                        │
│                                                                                              [default: 5]                                │
│ --max-backbone-group-size                                            <int range> [x>=1]      Maximum number of building-block variations │
│                                                                                              to keep per backbone.                       │
│                                                                                              [default: 10]                               │
│ --limit-backbone-group-size-by-cost                                                          Keep the cheapest building-block variations │
│                                                                                              first when truncating to                    │
│                                                                                              --max-backbone-group-size.                  │
│ --engine                             -e                              <thieme|pistachio>      Retrosynthesis engine to run the tree       │
│                                                                                              search on.                                  │
│                                                                                              [default: thieme]                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth plan`

```
 Usage: pendingai synth plan [OPTIONS] {plan_id}

 Retrieve a single Plan by its ID, including its tree search result.

 The result is only populated once the plan's status is 'completed' --
 check 'batch' first if you're not sure it's done yet.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    plan_id      <str>  [required]                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth create-batch`

```
 Usage: pendingai synth create-batch [OPTIONS] {SMILES_FILE}

 Create a Batch of retrosynthetic tree search Plans from a SMILES file.

 Each SMILES structure in the file is created as its own, independently
 trackable Plan, sharing the same tree search parameters. Unlike 'search',
 plans run asynchronously in the background -- check on them with
 'list-batches' and 'batch'.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES_FILE      <file>  A filepath containing line-delimited SMILES molecules. [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --name         -n      <str>  An optional name for a retrosynthesis Batch.                                                               │
│ --description  -d      <str>  An optional description for a retrosynthesis Batch.                                                        │
│ --skip-errors                 Skip any errors encountered during command execution.                                                      │
│ --help                        Show this message and exit.                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Search Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --early-exit                             --no-early-exit                                     Stop as soon as one validated solution      │
│                                                                                              route is found, rather than searching for   │
│                                                                                              the full time budget.                       │
│                                                                                              [default: early-exit]                       │
│ --max-seconds                                                        <float range> [x>=0.1]  Maximum wall-clock time in seconds to run   │
│                                                                                              the tree search.                            │
│                                                                                              [default: 4.0]                              │
│ --max-depth                                                          <int range> [1<=x<=50]  Maximum number of reaction steps (tree      │
│                                                                                              depth) to search.                           │
│                                                                                              [default: 5]                                │
│ --mask-trivial-solution                  --allow-trivial-solution                            Exclude the trivial zero-step solution      │
│                                                                                              where the target molecule is itself a       │
│                                                                                              purchasable building block.                 │
│                                                                                              [default: mask-trivial-solution]            │
│ --mask-bblocks-mw-gte                                                <float>                 Exclude building blocks with molecular      │
│                                                                                              weight (daltons) greater than or equal to   │
│                                                                                              this value.                                 │
│ --mask-usd-pricing-gte                                               <float>                 Exclude building blocks priced at or above  │
│                                                                                              this normalised USD-per-gram cost.          │
│                                                                                              [default: 10000.0]                          │
│ --ships-to                                                           <str>                   ISO country code used to scope pricing and  │
│                                                                                              lead-time annotations to a specific         │
│                                                                                              delivery region.                            │
│                                                                                              [default: US]                               │
│ --mask-lead-times-gte                                                <float>                 Exclude building blocks with a lead time    │
│                                                                                              (days) to the --ships-to region greater     │
│                                                                                              than or equal to this value.                │
│ --max-backbone-groups                                                <int range> [x>=1]      Maximum number of distinct synthetic route  │
│                                                                                              backbones to return.                        │
│                                                                                              [default: 5]                                │
│ --max-backbone-group-size                                            <int range> [x>=1]      Maximum number of building-block variations │
│                                                                                              to keep per backbone.                       │
│                                                                                              [default: 10]                               │
│ --limit-backbone-group-size-by-cost                                                          Keep the cheapest building-block variations │
│                                                                                              first when truncating to                    │
│                                                                                              --max-backbone-group-size.                  │
│ --engine                             -e                              <thieme|pistachio>      Retrosynthesis engine to run the tree       │
│                                                                                              search on.                                  │
│                                                                                              [default: thieme]                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth create-batches`

```
 Usage: pendingai synth create-batches [OPTIONS] {SMILES_FILE}

 Create multiple Batches of retrosynthetic tree search Plans from one large SMILES file.

 The file is automatically split into as many Batches as needed to
 respect the per-batch size limit -- each chunk is created as its own,
 independently trackable Batch resource. Use 'create-batch' instead for
 a file that already fits in a single Batch.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    SMILES_FILE      <file>  A filepath containing line-delimited SMILES molecules. [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --name         -n      <str>  An optional name for a retrosynthesis Batch.                                                               │
│ --description  -d      <str>  An optional description for a retrosynthesis Batch.                                                        │
│ --skip-errors                 Skip any errors encountered during command execution.                                                      │
│ --help                        Show this message and exit.                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Search Parameters ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --early-exit                             --no-early-exit                                     Stop as soon as one validated solution      │
│                                                                                              route is found, rather than searching for   │
│                                                                                              the full time budget.                       │
│                                                                                              [default: early-exit]                       │
│ --max-seconds                                                        <float range> [x>=0.1]  Maximum wall-clock time in seconds to run   │
│                                                                                              the tree search.                            │
│                                                                                              [default: 4.0]                              │
│ --max-depth                                                          <int range> [1<=x<=50]  Maximum number of reaction steps (tree      │
│                                                                                              depth) to search.                           │
│                                                                                              [default: 5]                                │
│ --mask-trivial-solution                  --allow-trivial-solution                            Exclude the trivial zero-step solution      │
│                                                                                              where the target molecule is itself a       │
│                                                                                              purchasable building block.                 │
│                                                                                              [default: mask-trivial-solution]            │
│ --mask-bblocks-mw-gte                                                <float>                 Exclude building blocks with molecular      │
│                                                                                              weight (daltons) greater than or equal to   │
│                                                                                              this value.                                 │
│ --mask-usd-pricing-gte                                               <float>                 Exclude building blocks priced at or above  │
│                                                                                              this normalised USD-per-gram cost.          │
│                                                                                              [default: 10000.0]                          │
│ --ships-to                                                           <str>                   ISO country code used to scope pricing and  │
│                                                                                              lead-time annotations to a specific         │
│                                                                                              delivery region.                            │
│                                                                                              [default: US]                               │
│ --mask-lead-times-gte                                                <float>                 Exclude building blocks with a lead time    │
│                                                                                              (days) to the --ships-to region greater     │
│                                                                                              than or equal to this value.                │
│ --max-backbone-groups                                                <int range> [x>=1]      Maximum number of distinct synthetic route  │
│                                                                                              backbones to return.                        │
│                                                                                              [default: 5]                                │
│ --max-backbone-group-size                                            <int range> [x>=1]      Maximum number of building-block variations │
│                                                                                              to keep per backbone.                       │
│                                                                                              [default: 10]                               │
│ --limit-backbone-group-size-by-cost                                                          Keep the cheapest building-block variations │
│                                                                                              first when truncating to                    │
│                                                                                              --max-backbone-group-size.                  │
│ --engine                             -e                              <thieme|pistachio>      Retrosynthesis engine to run the tree       │
│                                                                                              search on.                                  │
│                                                                                              [default: thieme]                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth batch`

```
 Usage: pendingai synth batch [OPTIONS] {batch_id}

 Retrieve a Batch and a page of the Plans it contains.

 A batch can have up to 100,000 plans, so this only shows one page at a
 time (most recently created first) -- use --limit/--after/--before to
 page through the rest.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Pagination Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --limit   -l      <int range> [1<=x<=100]  Number of results per page. [default: 10]                                                     │
│ --after           <str>                    Cursor for results after a specific resource ID.                                              │
│ --before          <str>                    Cursor for results before a specific resource ID.                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth list-batches`

```
 Usage: pendingai synth list-batches [OPTIONS]

 List Batches of retrosynthetic tree search Plans.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Pagination Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --limit   -l      <int range> [1<=x<=100]  Number of results per page. [default: 10]                                                     │
│ --after           <str>                    Cursor for results after a specific resource ID.                                              │
│ --before          <str>                    Cursor for results before a specific resource ID.                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth export-batch`

```
 Usage: pendingai synth export-batch [OPTIONS] {batch_id}

 Export every Plan from a Batch of retrosynthetic tree search Plans to file.

 A batch can have up to 100,000 plans, fetched 100 at a time -- this can
 take a while for a very large batch.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output  -o      <file>               A filepath to save any command results to.                                                        │
│ --format          <json|yaml|csv|tsv>  Result format to use for exporting synth batch results. [default: json]                           │
│ --force   -f                           Force the command to run, skip confirmation prompts.                                              │
│ --help                                 Show this message and exit.                                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

#### `pendingai synth delete-batch`

```
 Usage: pendingai synth delete-batch [OPTIONS] {batch_id}

 Delete a Batch of retrosynthetic tree search Plans.

 The batch stops appearing in 'list-batches'/'batch' immediately, but
 archiving its plans happens in the background afterward -- a large
 batch's plans can take a while to finish archiving.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    batch_id      <str>  [required]                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
