> 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/api-reference/pai-retro/batch-screening.md).

# Batch Screening

Screen large batches of molecules using our high-throughput retrosynthesis

A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved. Batch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field. See [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability.

## Retrieve a Batch

> Retrieve a Batch resource by its ID. Additional object metadata and shared\
> Job parameters are included. Status and results are not included; use the\
> dedicated routes for those operations.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches/{batch_id}":{"get":{"tags":["Batches"],"summary":"Retrieve a Batch","description":"Retrieve a Batch resource by its ID. Additional object metadata and shared\nJob parameters are included. Status and results are not included; use the\ndedicated routes for those operations.","operationId":"retrieve_batch_batches__batch_id__get","parameters":[{"description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations.","required":true,"schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","title":"Batch Id","description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations."},"name":"batch_id","in":"path"}],"responses":{"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Update a Batch

> Update a Batch and submit extra retrosynthesis Job resources. The number of\
> jobs must not exceed the batch size limit of 100000. SMILES structures\
> are not checked for duplicates against existing jobs in the batch, so care\
> must be taken to avoid adding the same molecule multiple times.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateBatch":{"properties":{"smiles":{"items":{"type":"string","maxLength":10000,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","description":"A SMILES string representing a molecule. For more information, refer to the OpenSMILES specification available online [here](http://opensmiles.org/opensmiles.html)."},"type":"array","maxItems":100000,"minItems":1,"title":"Smiles","description":"List of SMILES structures representing molecules to be submitted\nfor retrosynthesis. Each query structure shares the same parameters\ndefined for the batch. Duplicates and empty structures are removed."}},"type":"object","required":["smiles"],"title":"UpdateBatch","description":"Request body for updating a Batch."},"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches/{batch_id}":{"put":{"tags":["Batches"],"summary":"Update a Batch","description":"Update a Batch and submit extra retrosynthesis Job resources. The number of\njobs must not exceed the batch size limit of 100000. SMILES structures\nare not checked for duplicates against existing jobs in the batch, so care\nmust be taken to avoid adding the same molecule multiple times.","operationId":"update_batch_batches__batch_id__put","parameters":[{"description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations.","required":true,"schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","title":"Batch Id","description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations."},"name":"batch_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBatch"}}},"required":true},"responses":{"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"402":{"description":"Payment gateway operation failed","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"413":{"description":"Batch request exceeded size limit","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Delete a Batch

> Delete a Batch and each attached retrosynthesis Job resource. All remaining\
> queued jobs are cancelled even if the batch is currently being processed.\
> The customer metered usage is updated to reflect any incomplete jobs.\
> \
> Note that the operation is non-reversible and all resources are no longer\
> accessible after deletion.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches/{batch_id}":{"delete":{"tags":["Batches"],"summary":"Delete a Batch","description":"Delete a Batch and each attached retrosynthesis Job resource. All remaining\nqueued jobs are cancelled even if the batch is currently being processed.\nThe customer metered usage is updated to reflect any incomplete jobs.\n\nNote that the operation is non-reversible and all resources are no longer\naccessible after deletion.","operationId":"delete_batch_batches__batch_id__delete","parameters":[{"description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations.","required":true,"schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","title":"Batch Id","description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations."},"name":"batch_id","in":"path"}],"responses":{"402":{"description":"Payment gateway operation failed","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Retrieve a Batch status

> Retrieve the current status of a Batch. The status relies on the individual\
> status of all Job resources making it a computationally expensive operation.\
> Poll the route with spaced requests to reduce the load on the server.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches/{batch_id}/status":{"get":{"tags":["Batches"],"summary":"Retrieve a Batch status","description":"Retrieve the current status of a Batch. The status relies on the individual\nstatus of all Job resources making it a computationally expensive operation.\nPoll the route with spaced requests to reduce the load on the server.","operationId":"retrieve_batch_status_batches__batch_id__status_get","parameters":[{"description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations.","required":true,"schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","title":"Batch Id","description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations."},"name":"batch_id","in":"path"}],"responses":{"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Retrieve a Batch result

> Retrieve the collection of results from all Job resources for the Batch. The\
> list contains each job ID to use for retrieving synthetic routes and whether\
> a query molecule was synthesizable. Incomplete jobs are marked as such.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches/{batch_id}/result":{"get":{"tags":["Batches"],"summary":"Retrieve a Batch result","description":"Retrieve the collection of results from all Job resources for the Batch. The\nlist contains each job ID to use for retrieving synthetic routes and whether\na query molecule was synthesizable. Incomplete jobs are marked as such.","operationId":"retrieve_batch_result_batches__batch_id__result_get","parameters":[{"description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations.","required":true,"schema":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","title":"Batch Id","description":"Unique identifier for a `Batch` object. The IDs\n        for objects are used to perform different operations."},"name":"batch_id","in":"path"},{"description":"Providing a value for the header will request\n        that the response be converted into the specified format. If\n        omitted, the response will be in the default JSON format. Most\n        client libraries can automatically handle various compression\n        communication formats.","required":false,"schema":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Accept-Encoding","description":"Providing a value for the header will request\n        that the response be converted into the specified format. If\n        omitted, the response will be in the default JSON format. Most\n        client libraries can automatically handle various compression\n        communication formats."},"name":"accept-encoding","in":"header"}],"responses":{"404":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## List Batches

> Retrieve a list of Batch resources using cursor-based pagination. See the\
> returned \`data\` field for more information about the Batch resources. Use\
> additional \`metadata\` and \`links\` fields to navigate the paginated\
> resources.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches":{"get":{"tags":["Batches"],"summary":"List Batches","description":"Retrieve a list of Batch resources using cursor-based pagination. See the\nreturned `data` field for more information about the Batch resources. Use\nadditional `metadata` and `links` fields to navigate the paginated\nresources.","operationId":"retrieve_batch_list_batches_get","parameters":[{"description":"\n            An *optional* cursor used to indicate the item after which\n            results should be returned. When provided, results that come\n            after the specified cursor are returned. Cannot be used\n            together with the `before` parameter.\n\n            Note that results are returned in descending order so the\n            `after` cursor returns older items that appear in pages that\n            are *after* the current page.\n            ","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After","description":"\n            An *optional* cursor used to indicate the item after which\n            results should be returned. When provided, results that come\n            after the specified cursor are returned. Cannot be used\n            together with the `before` parameter.\n\n            Note that results are returned in descending order so the\n            `after` cursor returns older items that appear in pages that\n            are *after* the current page.\n            "},"name":"after","in":"query"},{"description":"\n            An *optional* cursor used to indicate the item before which\n            results should be returned. When provided, results that come\n            before the specified cursor are returned. Cannot be used\n            together with the `after` parameter.\n\n            Note that results are returned in descending order so the\n            `before` cursor returns newer items that appear in pages\n            that are *before* the current page.\n            ","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before","description":"\n            An *optional* cursor used to indicate the item before which\n            results should be returned. When provided, results that come\n            before the specified cursor are returned. Cannot be used\n            together with the `after` parameter.\n\n            Note that results are returned in descending order so the\n            `before` cursor returns newer items that appear in pages\n            that are *before* the current page.\n            "},"name":"before","in":"query"},{"description":"\n                The **maximum** number of results to return for a single page\n                of items. The value can adversely affect offset-based pagination\n                when using the `page` parameter. Fewer results can be returned\n                than the value specified.\n                ","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"title":"Limit","description":"\n                The **maximum** number of results to return for a single page\n                of items. The value can adversely affect offset-based pagination\n                when using the `page` parameter. Fewer results can be returned\n                than the value specified.\n                ","default":25},"name":"limit","in":"query"},{"description":"Providing a value for the header will request\n        that the response be converted into the specified format. If\n        omitted, the response will be in the default JSON format. Most\n        client libraries can automatically handle various compression\n        communication formats.","required":false,"schema":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Accept-Encoding","description":"Providing a value for the header will request\n        that the response be converted into the specified format. If\n        omitted, the response will be in the default JSON format. Most\n        client libraries can automatically handle various compression\n        communication formats."},"name":"accept-encoding","in":"header"}],"responses":{"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Create a Batch

> Create a new Batch resource to manage a collection of retrosynthesis Job\
> resources. Individual jobs are provided as a collection of SMILES structures\
> and share a set of parameters.\
> \
> \- Provide additional metadata to tag and identify the batch.\
> \- The batch size limit is 100000 jobs; for larger batches, split query\
> molecules into manageable batches or update an initial Batch resource after\
> creation.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"0.0.0"},"tags":[{"name":"Batches","description":"A high-throughput screening campaign for large-scale chemical libraries can be achieved through submitting *batches* of **Retrosynthesis** jobs with shared `parameters`. Pending AI offers batch sizes of up to 00 jobs which can be created and then appended to with additional API requests. Batch progress can be tracked with live updates to the number of completed jobs and a high-level screening overview can be retrieved.\nBatch synthesis jobs impact the overall queue size for a given engine. Larger batches may lead to a longer wait time for it to complete. Additional metadata data can also be added to the batch submission to help distinguish results beyond an arbitrary batch `id` field.\nSee [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability."}],"servers":[{"url":"https://api.pending.ai/retro/v2","description":"Pending AI API Server"}],"security":[{"oauth":[]},{"token":[]}],"components":{"securitySchemes":{"oauth":{"type":"oauth2","description":"Pending AI OAuth2 authentication.","flows":{"authorizationCode":{"refreshUrl":"https://auth.pending.ai/oauth/token","scopes":{"openid":"Required for OpenID Connect sign-in","profile":"Access to the user's basic profile information","email":"Access to the user's email address","offline_access":"Request a refresh token"},"authorizationUrl":"https://auth.pending.ai/authorize","tokenUrl":"https://auth.pending.ai/oauth/token"}}},"token":{"type":"http","description":"Pending AI authentication access token.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateBatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":512,"pattern":"^.*\\S.*$","description":"Name of the resource. The name is a human-readable identifier and\nis not required to be unique. The value can be used for display\npurposes."},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2048,"pattern":"^.*\\S.*$","description":"Description for a batch. Any text is allowed to provide additional\ncontext but must contain at least one non-whitespace character."},{"type":"null"}],"title":"Description"},"filename":{"anyOf":[{"type":"string","maxLength":2048,"pattern":"^[^/\\\\<>:\"|?*]+$","description":"Filename used for when a batch is submitted via file. This helps\nidentify the batch and provides context for its retrosynthesis jobs."},{"type":"null"}],"title":"Filename"},"smiles":{"items":{"type":"string","maxLength":10000,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","description":"A SMILES string representing a molecule. For more information, refer to the OpenSMILES specification available online [here](http://opensmiles.org/opensmiles.html)."},"type":"array","maxItems":100000,"minItems":1,"title":"Smiles","description":"List of SMILES structures representing molecules to be submitted\nfor retrosynthesis. Each query structure shares the same parameters\ndefined for the batch. Duplicates and empty structures are removed."},"parameters":{"$ref":"#/components/schemas/CreateJobParameters","title":"Parameters"}},"type":"object","required":["smiles"],"title":"CreateBatch","description":"Request body for creating a new Batch."},"CreateJobParameters":{"properties":{"retrosynthesis_engine":{"anyOf":[{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","description":"An ID belonging to a selected retrosynthesis engine to execute\nthe synthesis planning procedure. The value can be omitted to\nuse a default engine."},{"type":"null"}],"title":"Retrosynthesis Engine"},"building_block_libraries":{"anyOf":[{"items":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_-]+$","description":"Unique identifier for a resource."},"type":"array","maxItems":100,"minItems":1,"description":"A list of IDs belonging to selected library resources used\nfor controlling synthetic route termination. The value can be\nomitted to use all libraries. At least one must be provided."},{"type":"null"}],"title":"Building Block Libraries"},"number_of_routes":{"type":"integer","maximum":50,"minimum":1,"title":"Number Of Routes","description":"The maximum number of routes to be generated during retrosynthesis\ncalculations. Found synthesis routes can be limited by the amount\nrequested, building block libraries, and other control parameters.","default":1},"processing_time":{"type":"integer","maximum":720,"minimum":60,"title":"Processing Time","description":"The maximum allowable processing time to complete retrosynthesis\nfor a target molecule. Calculations stop and exit once the time\nlimit is reached.","default":60},"reaction_limit":{"type":"integer","maximum":25,"minimum":1,"title":"Reaction Limit","description":"The maximum number of times a single reaction step SMILES can\nappear within computed synthesis routes.","default":10},"building_block_limit":{"type":"integer","maximum":25,"minimum":1,"title":"Building Block Limit","description":"The maximum number of times a single SMILES building block can\nappear within computed synthesis routes.","default":10}},"type":"object","title":"CreateJobParameters","description":"Retrosynthesis configuration parameters for creating a Job resource.\n\nThe `retrosynthesis_engine` and `building_block_libraries` fields are\noptional and can be omitted to use default values. If provided, they\nmust be valid resource IDs.\n\n- `retrosynthesis_engine`: An ID belonging to a selected retrosynthesis\nengine to execute the synthesis planning procedure. The value can be\nomitted to use a default engine.\n\n- `building_block_libraries`: A list of ID values belonging to selected\nlibrary resources used for controlling synthetic route termination. The\nvalue can be omitted to use all building block libraries."},"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":{"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"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"A unique ID given to each request.","title":"Request ID"},"error":{"anyOf":[{"$ref":"#/components/schemas/RequestValidationErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"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"},"timestamp":{"description":"Timestamp of when the error occurred.","format":"date-time","title":"Timestamp","type":"string"},"path":{"description":"Request path for where the error occurred.","title":"Request Path","type":"string"},"message":{"default":null,"description":"Message associated with the encountered error.","title":"Message"},"details":{"anyOf":[{"items":{"$ref":"#/components/schemas/RequestValidationErrorInfoDetails"},"type":"array"},{"type":"null"}],"default":null,"description":"Validation errors with extra information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","type":"object"},"RequestValidationErrorInfoDetails":{"description":"An individual validation error with extra information.","properties":{"location":{"default":null,"description":"One or more parameters for where the validation failed.","title":"Validation Location"},"error_type":{"default":null,"description":"A description of the validation constraint that was broken.","title":"Constraint Type"}},"title":"Detailed Error Content","type":"object"}}},"paths":{"/batches":{"post":{"tags":["Batches"],"summary":"Create a Batch","description":"Create a new Batch resource to manage a collection of retrosynthesis Job\nresources. Individual jobs are provided as a collection of SMILES structures\nand share a set of parameters.\n\n- Provide additional metadata to tag and identify the batch.\n- The batch size limit is 100000 jobs; for larger batches, split query\nmolecules into manageable batches or update an initial Batch resource after\ncreation.","operationId":"create_batch_batches_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatch"}}},"required":true},"responses":{"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"402":{"description":"Payment gateway operation failed","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"413":{"description":"Batch request exceeded size limit","content":{"application/json":{"schema":{"type":"null","title":"Return"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```
