# Building Block Libraries

For planning valid multi-step synthetic routes, various *building block libraries* are used to facilitate terminating different reaction subtrees. Our **Retrosynthesis** platform allows users to specify specific libraries for synthetic planning although it is recommended to select all libraries to improve the overall success rate. When submitting a query molecule for assessing synthetic accessibility, a list of libraries must be specified using respective `id` fields.

**Considerations**

* Library selection can influence the success of the retrosynthesis process. It's important to choose libraries that are well-suited for the specific synthetic routes.
* Some libraries may have limitations in terms of the reactions they can support or the average cost of available molecules. Use the latest libraries for optimal results (refer to the `available_from` field).

See [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability.

## List libraries

> Retrieve a list of libraries.

```json
{"openapi":"3.1.0","info":{"title":"PAI Retro","version":"v2"},"tags":[{"description":"\nFor planning valid multi-step synthetic routes, various *building block libraries* are\nused to facilitate terminating different reaction subtrees. Our **Retrosynthesis** \nplatform allows users to specify specific libraries for synthetic planning although it\nis recommended to select all libraries to improve the overall success rate. When \nsubmitting a query molecule for assessing synthetic accessibility, a list of libraries \nmust be specified using respective `id` fields.\n\n**Considerations**\n\n- Library selection can influence the success of the retrosynthesis process. It's \nimportant to choose libraries that are well-suited for the specific synthetic routes.\n- Some libraries may have limitations in terms of the reactions they can support or the\naverage cost of available molecules. Use the latest libraries for optimal results (refer\nto the `available_from` field).\n\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility)\nfor more information on our **Retrosynthesis** capability.\n                ","name":"Libraries"}],"servers":[{"description":"Pending AI Server","url":"https://api.pending.ai/retro/v2","variables":{"environment":{"default":"api","description":"The environment to use for the API.","enum":["api","api.dev","api.stage"]}}}],"security":[{"oauth":[""],"token":[""]}],"components":{"securitySchemes":{"oauth":{"description":"OAuth2 authentication.","flows":{"implicit":{"authorizationUrl":"https://auth.pending.ai/authorize","refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{}}},"type":"oauth2"}},"schemas":{"LibraryResource":{"description":"Libraries contain large collections of building blocks that can be\nused to construct computed synthetic routes. They contain additional\nmetadata such as source information and price to aid in reproducing\nthe synthesis process. The selection of libraries impacts the\nability to resolve a retrosynthesis target meaning that with more\nbuilding block libraries selected when submitting a query molecule,\nthe chances of finding a viable synthetic route improves.","properties":{"available_from":{"description":"The time when the library was made available. Older libraries may\ncontain out-of-date information or have changing price data. It is\nrecommended to use the latest libraries for optimal results.","format":"date-time","title":"Available From","type":"string"},"id":{"description":"The unique resource identifier.","pattern":"^\\w+$","title":"Resource Id","type":"string"},"name":{"description":"Name of the library.","title":"Name","type":"string"},"object":{"description":"The type of resource.","pattern":"^\\w+$","title":"Resource Object","type":"string"},"version":{"description":"A version tag for the library.","title":"Version","type":"string"}},"required":["id","object","name","version","available_from"],"title":"Library","type":"object"},"RequestValidationErrorContent":{"description":"A request or response encountered a validation error when enforcing field constraints. Refer to `error.details` to resolve individual errors. For any unexpected validation errors, contact Pending AI support via email at [support@pending.ai](mailto:support@pending.ai).","properties":{"error":{"$ref":"#/components/schemas/RequestValidationErrorInfo","default":null},"request_id":{"default":null,"description":"A unique ID given to each request.","title":"Request ID","type":"string"},"status":{"default":"error","description":"Status of the request.","enum":["error","success"],"title":"Request Status","type":"string"},"status_code":{"description":"Response status code received for the request.","title":"Status Code","type":"integer"}},"required":["status_code"],"title":"Request Validation Error","type":"object"},"RequestValidationErrorInfo":{"description":"Response content containing extra information for an error.","properties":{"code":{"description":"Short identifier code to classify the error.","title":"Code","type":"string"},"details":{"default":null,"description":"Validation errors with extra information.","items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"title":"Detailed Message","type":"array"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"},"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/libraries":{"get":{"description":"Retrieve a list of libraries.","operationId":"list_libraries_libraries_get","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LibraryResource"},"title":"Return","type":"array"}}},"description":"Returns a list of libraries."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}},"description":"Request validation failed."}},"summary":"List libraries","tags":["Libraries"]}}}}
```
