For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tree Search

Search for synthetic routes to a target molecule

Run a retrosynthetic tree search for a single target molecule and receive every validated route found within the requested time budget, along with vendor pricing for the building blocks involved.

Create a tree search

post

Run a synchronous retrosynthetic tree search for a target molecule. The search runs for up to max_seconds, exploring reaction steps to the configured max_depth, and the response contains every validated route found together with pricing/lead-time annotations for the building blocks used.

Authorizations
OAuth2authorizationCodeRequired

OAuth2 authentication.

Authenticate using the Pending AI authorization server through an OAuth2 authorization code flow. You will be redirected to a Pending AI login page to authenticate and authorize access to your account. After authorization, you will be redirected back to the original application with an access token. Ensure that the application is registered with Pending AI and/or that the correct redirect URI is configured. Contact Pending AI support for more information if the application is not registered.

Authorization URL: Token URL: Refresh URL:
Body

Request data for creating a tree search.

search_smilesstringRequired

The SMILES string representing the target molecule to search for synthetic routes to.

Example: CC[C@H](C)[C@H](NC(=O)[C@H](Cc1ccc(O)cc1)NC(=O)CC(C)C)C(=O)N[C@H](CO)CCSC
early_exit_first_solutionbooleanOptional

If true, stop the search as soon as one validated solution route is found, rather than continuing to search for the full time budget.

Default: true
max_secondsnumberOptional

Maximum wall-clock time in seconds to run the tree search.

Default: 4Example: 10
max_depthinteger · min: 1 · max: 50Optional

Maximum number of reaction steps (tree depth) to search.

Default: 5Example: 6
mask_trivial_solutionbooleanOptional

Exclude the trivial zero-step solution where the target molecule is itself a purchasable building block.

Default: trueExample: true
mask_bblocks_mw_gtenumber · nullableOptional

Exclude building blocks with a molecular weight (daltons) greater than or equal to this value. Omit or set to null for no molecular weight limit.

Default: null
mask_usd_pricing_gtenumber · nullableOptional

Exclude building blocks priced at or above this normalised USD-per-gram cost. Omit or set to null for no price limit.

Default: 10000Example: 10000
ships_tostring · nullableOptional

ISO country code used to scope pricing and lead-time annotations to a specific delivery region.

Default: USExample: US
mask_lead_times_gtenumber · nullableOptional

Exclude building blocks with a lead time (days) to the ships_to region greater than or equal to this value. Omit or set to null for no lead-time limit.

Default: null
max_backbone_groupsintegerOptional

Maximum number of distinct synthetic route backbones to return.

Default: 5Example: 5
max_backbone_group_sizeintegerOptional

Maximum number of building-block variations to keep per backbone.

Default: 10Example: 10
limit_backbone_group_size_by_costbooleanOptional

When true, keep the cheapest building-block variations first when truncating to max_backbone_group_size.

Default: false
Responses
200

Returns the tree search result.

application/json

The result of a completed tree search.

search_smilesstringOptional

Canonicalised SMILES of the target molecule that was searched for.

Example: CC(=O)Oc1ccccc1C(=O)O
post/treesearch
POST /synth/v1/treesearch HTTP/1.1
Host: api.pending.ai
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 381

{
  "search_smiles": "CC[C@H](C)[C@H](NC(=O)[C@H](Cc1ccc(O)cc1)NC(=O)CC(C)C)C(=O)N[C@H](CO)CCSC",
  "early_exit_first_solution": false,
  "max_seconds": 10,
  "max_depth": 6,
  "mask_trivial_solution": true,
  "mask_bblocks_mw_gte": null,
  "mask_usd_pricing_gte": 10000,
  "ships_to": "US",
  "mask_lead_times_gte": null,
  "max_backbone_groups": 5,
  "max_backbone_group_size": 10,
  "limit_backbone_group_size_by_cost": false
}
{
  "search_smiles": "CC(=O)Oc1ccccc1C(=O)O",
  "metadata": {
    "tree_search_elapsed": 10.065487623214722,
    "routes_extracted_elapsed": 0.033852338790893555,
    "routes_validated_elapsed": 0.0072100162506103516,
    "bblock_annotations_elapsed": 0.04003763198852539,
    "total_elapsed": 10.289523124694824,
    "total_graph_nodes": 36131,
    "unvalidated_routes": 159,
    "validated_routes": 136,
    "total_bblocks": 12
  },
  "route_hierarchy": {
    "ANY_ADDITIONAL_PROPERTY": {
      "ANY_ADDITIONAL_PROPERTY": [
        [
          {
            "directed": true,
            "multigraph": false,
            "nodes": [
              {
                "id": "5f1cb78e-e7ec-40f7-9ccb-aa0f6ae2d2ab",
                "data": {
                  "smiles": "CC(=O)Oc1ccccc1C(=O)O",
                  "mw": 180.042258736,
                  "is_building_block": false,
                  "building_block_idx": null,
                  "closest_building_block": 0.1475452184677124,
                  "depth": 0,
                  "expanded": true,
                  "in_solution_path": false
                }
              }
            ],
            "edges": [
              {
                "source": "5f1cb78e-e7ec-40f7-9ccb-aa0f6ae2d2ab",
                "target": "bf75215f-f22f-4940-89d6-a27b3c5a8e75"
              }
            ]
          }
        ]
      ]
    }
  },
  "pricing_annotations": [
    {
      "major_component_id": 378698,
      "full_canonical": "CC(=O)[O-].O.[Na+]",
      "major_component": "CC(=O)[O-]",
      "minor_components": "O.[Na+]",
      "mw": 59.01385291591001,
      "vendor_name": "Angene International Limited",
      "cs_id": "CSSB00015343762",
      "cs_prefix": "CSSB",
      "cs_url": "https://chem-space.com/CSSB00015343762",
      "pack": 5,
      "uom": "kg",
      "price_usd": 17,
      "normalised_usd": 0.0034,
      "api_timestamp": "2026-03-12T20:14:46.438000Z",
      "lead_time_days_to_US": 12,
      "lead_time_days_to_CA": 10,
      "lead_time_days_to_GB": 12,
      "lead_time_days_to_FR": 12,
      "lead_time_days_to_CH": 12,
      "lead_time_days_to_DE": 12,
      "lead_time_days_to_CN": 10,
      "lead_time_days_to_AU": 10
    }
  ],
  "reagent_results": {
    "reaction_to_edges": {
      "CCOC(=O)c1ccccc1OC(C)=O>>CC(=O)Oc1ccccc1C(=O)O": [
        "bf75215f-f22f-4940-89d6-a27b3c5a8e75"
      ]
    }
  }
}

Last updated

Was this helpful?