> 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/synthesis-jobs.md). Agents can also search and read this documentation through its [MCP server](https://docs.pending.ai/~gitbook/mcp).

# Synthesis Jobs

Submit target molecules for retrosynthesis and explore novel synthetic routes

For low-throughput screening or synthetic route exploration, a **Retrosynthesis** *job* can be submitted for a single `query` target molecule. The molecule, represented in [SMILES](http://opensmiles.org/opensmiles.html) format, is provided alongside a set of guiding `parameters` impacting route diversity and results.

* **Fast synthetic accessibility** can be assessed by reducing the time requirement for planning to `processing_time=60` and yield only a single route `number_of_routes=1`. - **Novel route exploration** can be achieved by increasing the time and resource allocation, allowing for multiple routes to be generated and evaluated. Additionally, decreasing `building_block_limit` and `reaction_limit` forces the engine to consider more diverse reaction pathways, potentially leading to more novel synthetic routes. Each job requires specifying a `retrosynthesis_engine` and `building_block_libraries` list corresponding to respective resource `id` fields of the engine and libraries. Our unique representation of synthetic routes provides a detailed reaction tree overview. See our [examples](https://docs.pending.ai/libraries/guides) for handling results for detailed analysis. See [here](https://docs.pending.ai/capabilities/synthetic-accessibility) for more information on our **Retrosynthesis** capability.

## List Jobs

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

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"v1.11.4"},"tags":[{"name":"Jobs","description":"For low-throughput screening or synthetic route exploration, a **Retrosynthesis** *job* can be submitted for a single `query` target molecule. The molecule, represented in [SMILES](http://opensmiles.org/opensmiles.html) format, is provided alongside a set of guiding `parameters` impacting route diversity and results.\n- **Fast synthetic accessibility** can be assessed by reducing the time requirement for planning to `processing_time=60` and yield only a single route `number_of_routes=1`. - **Novel route exploration** can be achieved by increasing the time and resource allocation, allowing for multiple routes to be generated and evaluated. Additionally, decreasing `building_block_limit` and `reaction_limit` forces the engine to consider more diverse reaction pathways, potentially leading to more novel synthetic routes.\nEach job requires specifying a `retrosynthesis_engine` and `building_block_libraries` list corresponding to respective resource `id` fields of the engine and libraries. Our unique representation of synthetic routes provides a detailed reaction tree overview. See our [examples](https://docs.pending.ai/libraries/guides) for handling results for detailed analysis.\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":{"CursorPage_Job_":{"properties":{"object":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z_-]+$","title":"Object","description":"The named type for the resource.","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Job"},"type":"array","maxItems":100,"minItems":0,"title":"Data","description":"List of items for the current page. The number of items is not guaranteed\nto match the requested `limit` as fewer items may be available."},"metadata":{"$ref":"#/components/schemas/CursorPageMetadata","title":"Metadata"},"links":{"$ref":"#/components/schemas/PageLinks","title":"Links"}},"type":"object","required":["metadata","links"],"title":"CursorPage[Job]"},"Job":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Id","description":"Unique identifier for a resource."},"object":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z_-]+$","title":"Object","description":"The named type for the resource.","default":"job"},"query":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Query","description":"A SMILES molecule to perform retrosynthesis on."},"status":{"$ref":"#/components/schemas/JobStatus","title":"Status","description":"The current status of the retrosynthesis job."},"created":{"type":"string","format":"date-time","title":"Created","description":"A timestamp for when the resource was created."},"updated":{"type":"string","format":"date-time","title":"Updated","description":"A timestamp for when the resource was last updated."},"parameters":{"$ref":"#/components/schemas/JobParameters","title":"Parameters"},"routes":{"items":{"$ref":"#/components/schemas/Route"},"type":"array","title":"Routes"},"query_is_building_block":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Query Is Building Block"},"ai_disclaimer":{"type":"string","maxLength":100000,"minLength":1,"title":"Ai Disclaimer","description":"Required EU AI Act compliance field. Provides a disclaimer about\nthe use of AI in generating retrosynthesis synthetic results.","default":"Pending AI's Retrosynthesis Engine is powered by artificial intelligence which is an experimental technology and may occasionally be misleading or incorrect."}},"type":"object","required":["id","query","status","parameters","routes"],"title":"Job","description":"A retrosynthesis Job for a single SMILES query molecule.\n\nJobs provide an interface for controlling the synthesis process and\nretrieving the detailed results from the retrosynthesis engine. The\nparameters provide more information about the job configuration."},"JobStatus":{"type":"string","enum":["submitted","processing","failed","completed"],"title":"JobStatus","description":"Job status enumeration."},"JobParameters":{"properties":{"retrosynthesis_engine":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Retrosynthesis Engine","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."},"building_block_libraries":{"items":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"Unique identifier for a resource."},"type":"array","maxItems":100,"title":"Building Block Libraries","description":"The building block libraries the job's routes end in. Empty on a TwinOracle (`synth-`) engine, which prices its own building blocks."},"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},"synth_options":{"anyOf":[{"$ref":"#/components/schemas/SynthOptions"},{"type":"null"}],"title":"Synth Options"}},"type":"object","required":["retrosynthesis_engine","building_block_libraries"],"title":"JobParameters","description":"Retrosynthesis procedure configuration parameters."},"SynthOptions":{"properties":{"max_price":{"type":"number","maximum":50000,"minimum":1,"title":"Max Price","description":"Leave out building blocks dearer than this, in USD per gram.","default":10000},"max_depth":{"type":"integer","maximum":20,"minimum":1,"title":"Max Depth","description":"Most steps a route may have.","default":12},"timeout":{"type":"integer","maximum":15,"minimum":2,"title":"Timeout","description":"Each search's time limit, in seconds.","default":10},"early_exit":{"type":"boolean","title":"Early Exit","description":"Stop each search at the first route.","default":true},"max_routes":{"anyOf":[{"type":"integer","maximum":50,"minimum":1},{"type":"null"}],"title":"Max Routes","description":"Most routes to keep for each molecule; every route found if omitted. Different ways to make the molecule are kept before other building blocks for the same route."}},"type":"object","title":"SynthOptions","description":"TwinOracle (PAI Synth) search options, for a job or batch on a `synth-` engine.\n\nThe same options, with the same limits, as a single fast search in the web\napp (retro-api-webapp's `SynthOptions`, stored on each job as its camel-cased\n`synthOptions`). Ignored on a Mentor engine."},"Route":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A SMILES representation of a synthetically accessible\nretrosynthetic route reaction tree. Reactants are purchasable\nbuilding blocks, and the product is the target molecule."},"building_blocks":{"items":{"$ref":"#/components/schemas/BuildingBlock"},"type":"array","title":"Building Blocks"},"steps":{"items":{"$ref":"#/components/schemas/ReactionStep"},"type":"array","title":"Steps"},"stereocenters_mapped":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stereocenters Mapped","description":"Whether the target molecule's stereocentres were traced through\nevery reaction step of the route to its building blocks, so the\nroute makes the stereoisomer that was asked for. `null` when the\nretrosynthesis engine did not report it."}},"type":"object","required":["smiles","building_blocks","steps"],"title":"Route","description":"A retrosynthesis route computed using a retrosynthesis engine.\n\nContains a collection of building blocks and single-step reactions that represent\na complete synthesis route for a target molecule through individual reactions that\nbuild bottom-up to the target molecule."},"BuildingBlock":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Smiles","description":"A SMILES representation of a building block."},"metadata":{"items":{"$ref":"#/components/schemas/BuildingBlockMetadata"},"type":"array","title":"Metadata"}},"type":"object","required":["smiles","metadata"],"title":"BuildingBlock","description":"A building block molecule represented by a SMILES structure."},"BuildingBlockMetadata":{"properties":{"identifier":{"type":"string","maxLength":100000,"minLength":1,"title":"Identifier","description":"An identifier used for annotating building block molecules.\nDifferent annotation styles can be used to distinguish against\ndataset providers.","default":"unknown"},"dataset_provider":{"type":"string","maxLength":100000,"minLength":1,"title":"Dataset Provider","description":"Name of the dataset provider that owns and distributes a specified\nbuilding block molecule.","default":"unknown"},"availability":{"type":"string","maxLength":100000,"minLength":1,"title":"Availability","description":"The availability status of the building block molecule. A\nmolecule is `in stock` if it is available for purchase and\n`unavailable` otherwise.","default":"unavailable"},"price":{"type":"number","title":"Price","description":"Price of the building block molecule for a specific\n`dataset_provider`. A molecule can have different prices\ndepending on the provider. Prices are subject to change over\ntime depending on the sourced building block library.","default":0}},"type":"object","title":"BuildingBlockMetadata","description":"Metadata associated with a building block molecule."},"ReactionStep":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A single-step chemical reaction denoted using a SMILES\nrepresentation. Reactants are guaranteed to be either a\npurchasable building block or synthetically synthesizable\nmolecule."},"order":{"type":"integer","title":"Order","description":"Post-order position of the reaction step in the synthetic\nroute. Note that this field is not required to reproduce\nthe retrosynthesis pathway."}},"type":"object","required":["smiles","order"],"title":"ReactionStep","description":"A single-step reaction representing a synthesis step in a reaction tree."},"CursorPageMetadata":{"properties":{"has_next":{"type":"boolean","title":"Has Next","description":"Indicates if there is a next page of results. If true, the next set of\nresults can be fetched using `next_cursor` to populate the `after`\nfield in the next request, or requesting the next page.","default":false},"has_prev":{"type":"boolean","title":"Has Prev","description":"Indicates if there is a previous page of results. If true, the previous\nset of results can be fetched using `prev_cursor` to populate the\n`before` field in the next request, or requesting the previous page.","default":false},"next_cursor":{"anyOf":[{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"If provided, matches the cursor to be used for fetching the page of\nresults after the current one. See specific resource documentation for\ndetails on the sort order of results."},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"If provided, matches the cursor to be used for fetching the page of\nresults before the current one. See specific resource documentation for\ndetails on the sort order of results."},{"type":"null"}],"title":"Prev Cursor"}},"type":"object","title":"CursorPageMetadata","description":"Metadata that contains state information for cursor-based pages."},"PageLinks":{"properties":{"self":{"type":"string","maxLength":100000,"minLength":1,"title":"Self","description":"Relative URL path for the current page of results. This can be used to\nfetch the same page of results again from the API."},"next":{"anyOf":[{"type":"string","maxLength":100000,"minLength":1,"description":"Relative URL path for the next page of results. This can be used to\nfetch the next page of results from the API."},{"type":"null"}],"title":"Next"},"prev":{"anyOf":[{"type":"string","maxLength":100000,"minLength":1,"description":"Relative URL path for the previous page of results. This can be used to\nfetch the previous page of results from the API."},{"type":"null"}],"title":"Prev"}},"type":"object","required":["self"],"title":"PageLinks","description":"Links that contain information about the pagination state."},"BaseErrorContent":{"description":"An error occurred while handling the request. Refer to the `error` data for more information. For any further issues or enquiries about an error, contact support at [support@pending.ai](mailto:support@pending.ai) with details about your request including your `request_id`.","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/BaseErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"required":["status_code"],"title":"Request Error","type":"object"},"BaseErrorInfo":{"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":{"default":null,"description":"Longer message describing an error wtih more information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","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":{"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":{"/jobs":{"get":{"tags":["Jobs"],"summary":"List Jobs","description":"Retrieve a list of Job resources using either cursor-based pagination.\nSee the returned `data` field for more information about the Job\nresources. Use additional `metadata` and `links` fields to navigate\nthe paginated resources.","operationId":"retrieve_job_list_jobs_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":{"200":{"description":"Returns a list of Jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPage_Job_"}}}},"400":{"description":"Malformed request data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","description":"Not `BaseErrorContent`: see the examples."}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Create a Job

> Create a new Job resource for a retrosynthesis query molecule. The job is\
> queued for processing and the response contains the initial job metadata.\
> The retrosynthesis process is performed asynchronously and the job status\
> can be polled using the job retrieval endpoint, or waited on with \`wait\`.\
> \
> \- A TwinOracle engine (\`synth-\<id>\`, on the PAI Synth API) runs the query as\
> a fast search: its job takes \`synth\_options\` (defaults if omitted) and no\
> building block libraries, since TwinOracle prices its own.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"v1.11.4"},"tags":[{"name":"Jobs","description":"For low-throughput screening or synthetic route exploration, a **Retrosynthesis** *job* can be submitted for a single `query` target molecule. The molecule, represented in [SMILES](http://opensmiles.org/opensmiles.html) format, is provided alongside a set of guiding `parameters` impacting route diversity and results.\n- **Fast synthetic accessibility** can be assessed by reducing the time requirement for planning to `processing_time=60` and yield only a single route `number_of_routes=1`. - **Novel route exploration** can be achieved by increasing the time and resource allocation, allowing for multiple routes to be generated and evaluated. Additionally, decreasing `building_block_limit` and `reaction_limit` forces the engine to consider more diverse reaction pathways, potentially leading to more novel synthetic routes.\nEach job requires specifying a `retrosynthesis_engine` and `building_block_libraries` list corresponding to respective resource `id` fields of the engine and libraries. Our unique representation of synthetic routes provides a detailed reaction tree overview. See our [examples](https://docs.pending.ai/libraries/guides) for handling results for detailed analysis.\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":{"CreateJob":{"properties":{"query":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Query","description":"A SMILES molecule to perform retrosynthesis on."},"parameters":{"$ref":"#/components/schemas/CreateJobParameters","title":"Parameters"}},"type":"object","required":["query"],"title":"CreateJob","description":"Request data for creating a Job resource."},"CreateJobParameters":{"properties":{"retrosynthesis_engine":{"anyOf":[{"type":"string","maxLength":128,"minLength":1,"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,"minLength":1,"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},"synth_options":{"anyOf":[{"$ref":"#/components/schemas/SynthOptions"},{"type":"null"}],"title":"Synth Options"}},"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.\n\n- `synth_options`: TwinOracle's search options, for a `synth-` engine only;\ndefaults if omitted."},"SynthOptions":{"properties":{"max_price":{"type":"number","maximum":50000,"minimum":1,"title":"Max Price","description":"Leave out building blocks dearer than this, in USD per gram.","default":10000},"max_depth":{"type":"integer","maximum":20,"minimum":1,"title":"Max Depth","description":"Most steps a route may have.","default":12},"timeout":{"type":"integer","maximum":15,"minimum":2,"title":"Timeout","description":"Each search's time limit, in seconds.","default":10},"early_exit":{"type":"boolean","title":"Early Exit","description":"Stop each search at the first route.","default":true},"max_routes":{"anyOf":[{"type":"integer","maximum":50,"minimum":1},{"type":"null"}],"title":"Max Routes","description":"Most routes to keep for each molecule; every route found if omitted. Different ways to make the molecule are kept before other building blocks for the same route."}},"type":"object","title":"SynthOptions","description":"TwinOracle (PAI Synth) search options, for a job or batch on a `synth-` engine.\n\nThe same options, with the same limits, as a single fast search in the web\napp (retro-api-webapp's `SynthOptions`, stored on each job as its camel-cased\n`synthOptions`). Ignored on a Mentor engine."},"Job":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Id","description":"Unique identifier for a resource."},"object":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z_-]+$","title":"Object","description":"The named type for the resource.","default":"job"},"query":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Query","description":"A SMILES molecule to perform retrosynthesis on."},"status":{"$ref":"#/components/schemas/JobStatus","title":"Status","description":"The current status of the retrosynthesis job."},"created":{"type":"string","format":"date-time","title":"Created","description":"A timestamp for when the resource was created."},"updated":{"type":"string","format":"date-time","title":"Updated","description":"A timestamp for when the resource was last updated."},"parameters":{"$ref":"#/components/schemas/JobParameters","title":"Parameters"},"routes":{"items":{"$ref":"#/components/schemas/Route"},"type":"array","title":"Routes"},"query_is_building_block":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Query Is Building Block"},"ai_disclaimer":{"type":"string","maxLength":100000,"minLength":1,"title":"Ai Disclaimer","description":"Required EU AI Act compliance field. Provides a disclaimer about\nthe use of AI in generating retrosynthesis synthetic results.","default":"Pending AI's Retrosynthesis Engine is powered by artificial intelligence which is an experimental technology and may occasionally be misleading or incorrect."}},"type":"object","required":["id","query","status","parameters","routes"],"title":"Job","description":"A retrosynthesis Job for a single SMILES query molecule.\n\nJobs provide an interface for controlling the synthesis process and\nretrieving the detailed results from the retrosynthesis engine. The\nparameters provide more information about the job configuration."},"JobStatus":{"type":"string","enum":["submitted","processing","failed","completed"],"title":"JobStatus","description":"Job status enumeration."},"JobParameters":{"properties":{"retrosynthesis_engine":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Retrosynthesis Engine","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."},"building_block_libraries":{"items":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"Unique identifier for a resource."},"type":"array","maxItems":100,"title":"Building Block Libraries","description":"The building block libraries the job's routes end in. Empty on a TwinOracle (`synth-`) engine, which prices its own building blocks."},"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},"synth_options":{"anyOf":[{"$ref":"#/components/schemas/SynthOptions"},{"type":"null"}],"title":"Synth Options"}},"type":"object","required":["retrosynthesis_engine","building_block_libraries"],"title":"JobParameters","description":"Retrosynthesis procedure configuration parameters."},"Route":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A SMILES representation of a synthetically accessible\nretrosynthetic route reaction tree. Reactants are purchasable\nbuilding blocks, and the product is the target molecule."},"building_blocks":{"items":{"$ref":"#/components/schemas/BuildingBlock"},"type":"array","title":"Building Blocks"},"steps":{"items":{"$ref":"#/components/schemas/ReactionStep"},"type":"array","title":"Steps"},"stereocenters_mapped":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stereocenters Mapped","description":"Whether the target molecule's stereocentres were traced through\nevery reaction step of the route to its building blocks, so the\nroute makes the stereoisomer that was asked for. `null` when the\nretrosynthesis engine did not report it."}},"type":"object","required":["smiles","building_blocks","steps"],"title":"Route","description":"A retrosynthesis route computed using a retrosynthesis engine.\n\nContains a collection of building blocks and single-step reactions that represent\na complete synthesis route for a target molecule through individual reactions that\nbuild bottom-up to the target molecule."},"BuildingBlock":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Smiles","description":"A SMILES representation of a building block."},"metadata":{"items":{"$ref":"#/components/schemas/BuildingBlockMetadata"},"type":"array","title":"Metadata"}},"type":"object","required":["smiles","metadata"],"title":"BuildingBlock","description":"A building block molecule represented by a SMILES structure."},"BuildingBlockMetadata":{"properties":{"identifier":{"type":"string","maxLength":100000,"minLength":1,"title":"Identifier","description":"An identifier used for annotating building block molecules.\nDifferent annotation styles can be used to distinguish against\ndataset providers.","default":"unknown"},"dataset_provider":{"type":"string","maxLength":100000,"minLength":1,"title":"Dataset Provider","description":"Name of the dataset provider that owns and distributes a specified\nbuilding block molecule.","default":"unknown"},"availability":{"type":"string","maxLength":100000,"minLength":1,"title":"Availability","description":"The availability status of the building block molecule. A\nmolecule is `in stock` if it is available for purchase and\n`unavailable` otherwise.","default":"unavailable"},"price":{"type":"number","title":"Price","description":"Price of the building block molecule for a specific\n`dataset_provider`. A molecule can have different prices\ndepending on the provider. Prices are subject to change over\ntime depending on the sourced building block library.","default":0}},"type":"object","title":"BuildingBlockMetadata","description":"Metadata associated with a building block molecule."},"ReactionStep":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A single-step chemical reaction denoted using a SMILES\nrepresentation. Reactants are guaranteed to be either a\npurchasable building block or synthetically synthesizable\nmolecule."},"order":{"type":"integer","title":"Order","description":"Post-order position of the reaction step in the synthetic\nroute. Note that this field is not required to reproduce\nthe retrosynthesis pathway."}},"type":"object","required":["smiles","order"],"title":"ReactionStep","description":"A single-step reaction representing a synthesis step in a reaction tree."},"BaseErrorContent":{"description":"An error occurred while handling the request. Refer to the `error` data for more information. For any further issues or enquiries about an error, contact support at [support@pending.ai](mailto:support@pending.ai) with details about your request including your `request_id`.","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/BaseErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"required":["status_code"],"title":"Request Error","type":"object"},"BaseErrorInfo":{"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":{"default":null,"description":"Longer message describing an error wtih more information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","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":{"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":{"/jobs":{"post":{"tags":["Jobs"],"summary":"Create a Job","description":"Create a new Job resource for a retrosynthesis query molecule. The job is\nqueued for processing and the response contains the initial job metadata.\nThe retrosynthesis process is performed asynchronously and the job status\ncan be polled using the job retrieval endpoint, or waited on with `wait`.\n\n- A TwinOracle engine (`synth-<id>`, on the PAI Synth API) runs the query as\na fast search: its job takes `synth_options` (defaults if omitted) and no\nbuilding block libraries, since TwinOracle prices its own.","operationId":"create_job_jobs_post","parameters":[{"description":"Seconds to wait for the job to finish before responding,\n        up to 25. The job is returned as it is then, finished or not:\n        check its `status`, and poll if it's still `submitted` or `processing`.","required":false,"schema":{"type":"integer","maximum":25,"minimum":0,"title":"Wait","description":"Seconds to wait for the job to finish before responding,\n        up to 25. The job is returned as it is then, finished or not:\n        check its `status`, and poll if it's still `submitted` or `processing`.","default":0},"name":"wait","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJob"}}},"required":true},"responses":{"200":{"description":"Returns the Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Malformed request data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","description":"Not `BaseErrorContent`: see the examples."}}}},"402":{"description":"Plan or usage limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}},"503":{"description":"Service is currently unavailable.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}}}}}}}
```

## Retrieve a Job

> Retrieve a Job resource by its ID\`. Synthesis routes are returned along\
> with additional job metadata to indicate the status of the job which is\
> updated and can be used for polling until results become available, or\
> waited on with \`wait\`.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"v1.11.4"},"tags":[{"name":"Jobs","description":"For low-throughput screening or synthetic route exploration, a **Retrosynthesis** *job* can be submitted for a single `query` target molecule. The molecule, represented in [SMILES](http://opensmiles.org/opensmiles.html) format, is provided alongside a set of guiding `parameters` impacting route diversity and results.\n- **Fast synthetic accessibility** can be assessed by reducing the time requirement for planning to `processing_time=60` and yield only a single route `number_of_routes=1`. - **Novel route exploration** can be achieved by increasing the time and resource allocation, allowing for multiple routes to be generated and evaluated. Additionally, decreasing `building_block_limit` and `reaction_limit` forces the engine to consider more diverse reaction pathways, potentially leading to more novel synthetic routes.\nEach job requires specifying a `retrosynthesis_engine` and `building_block_libraries` list corresponding to respective resource `id` fields of the engine and libraries. Our unique representation of synthetic routes provides a detailed reaction tree overview. See our [examples](https://docs.pending.ai/libraries/guides) for handling results for detailed analysis.\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":{"Job":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Id","description":"Unique identifier for a resource."},"object":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z_-]+$","title":"Object","description":"The named type for the resource.","default":"job"},"query":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Query","description":"A SMILES molecule to perform retrosynthesis on."},"status":{"$ref":"#/components/schemas/JobStatus","title":"Status","description":"The current status of the retrosynthesis job."},"created":{"type":"string","format":"date-time","title":"Created","description":"A timestamp for when the resource was created."},"updated":{"type":"string","format":"date-time","title":"Updated","description":"A timestamp for when the resource was last updated."},"parameters":{"$ref":"#/components/schemas/JobParameters","title":"Parameters"},"routes":{"items":{"$ref":"#/components/schemas/Route"},"type":"array","title":"Routes"},"query_is_building_block":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Query Is Building Block"},"ai_disclaimer":{"type":"string","maxLength":100000,"minLength":1,"title":"Ai Disclaimer","description":"Required EU AI Act compliance field. Provides a disclaimer about\nthe use of AI in generating retrosynthesis synthetic results.","default":"Pending AI's Retrosynthesis Engine is powered by artificial intelligence which is an experimental technology and may occasionally be misleading or incorrect."}},"type":"object","required":["id","query","status","parameters","routes"],"title":"Job","description":"A retrosynthesis Job for a single SMILES query molecule.\n\nJobs provide an interface for controlling the synthesis process and\nretrieving the detailed results from the retrosynthesis engine. The\nparameters provide more information about the job configuration."},"JobStatus":{"type":"string","enum":["submitted","processing","failed","completed"],"title":"JobStatus","description":"Job status enumeration."},"JobParameters":{"properties":{"retrosynthesis_engine":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Retrosynthesis Engine","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."},"building_block_libraries":{"items":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","description":"Unique identifier for a resource."},"type":"array","maxItems":100,"title":"Building Block Libraries","description":"The building block libraries the job's routes end in. Empty on a TwinOracle (`synth-`) engine, which prices its own building blocks."},"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},"synth_options":{"anyOf":[{"$ref":"#/components/schemas/SynthOptions"},{"type":"null"}],"title":"Synth Options"}},"type":"object","required":["retrosynthesis_engine","building_block_libraries"],"title":"JobParameters","description":"Retrosynthesis procedure configuration parameters."},"SynthOptions":{"properties":{"max_price":{"type":"number","maximum":50000,"minimum":1,"title":"Max Price","description":"Leave out building blocks dearer than this, in USD per gram.","default":10000},"max_depth":{"type":"integer","maximum":20,"minimum":1,"title":"Max Depth","description":"Most steps a route may have.","default":12},"timeout":{"type":"integer","maximum":15,"minimum":2,"title":"Timeout","description":"Each search's time limit, in seconds.","default":10},"early_exit":{"type":"boolean","title":"Early Exit","description":"Stop each search at the first route.","default":true},"max_routes":{"anyOf":[{"type":"integer","maximum":50,"minimum":1},{"type":"null"}],"title":"Max Routes","description":"Most routes to keep for each molecule; every route found if omitted. Different ways to make the molecule are kept before other building blocks for the same route."}},"type":"object","title":"SynthOptions","description":"TwinOracle (PAI Synth) search options, for a job or batch on a `synth-` engine.\n\nThe same options, with the same limits, as a single fast search in the web\napp (retro-api-webapp's `SynthOptions`, stored on each job as its camel-cased\n`synthOptions`). Ignored on a Mentor engine."},"Route":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A SMILES representation of a synthetically accessible\nretrosynthetic route reaction tree. Reactants are purchasable\nbuilding blocks, and the product is the target molecule."},"building_blocks":{"items":{"$ref":"#/components/schemas/BuildingBlock"},"type":"array","title":"Building Blocks"},"steps":{"items":{"$ref":"#/components/schemas/ReactionStep"},"type":"array","title":"Steps"},"stereocenters_mapped":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stereocenters Mapped","description":"Whether the target molecule's stereocentres were traced through\nevery reaction step of the route to its building blocks, so the\nroute makes the stereoisomer that was asked for. `null` when the\nretrosynthesis engine did not report it."}},"type":"object","required":["smiles","building_blocks","steps"],"title":"Route","description":"A retrosynthesis route computed using a retrosynthesis engine.\n\nContains a collection of building blocks and single-step reactions that represent\na complete synthesis route for a target molecule through individual reactions that\nbuild bottom-up to the target molecule."},"BuildingBlock":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\]+$","title":"Smiles","description":"A SMILES representation of a building block."},"metadata":{"items":{"$ref":"#/components/schemas/BuildingBlockMetadata"},"type":"array","title":"Metadata"}},"type":"object","required":["smiles","metadata"],"title":"BuildingBlock","description":"A building block molecule represented by a SMILES structure."},"BuildingBlockMetadata":{"properties":{"identifier":{"type":"string","maxLength":100000,"minLength":1,"title":"Identifier","description":"An identifier used for annotating building block molecules.\nDifferent annotation styles can be used to distinguish against\ndataset providers.","default":"unknown"},"dataset_provider":{"type":"string","maxLength":100000,"minLength":1,"title":"Dataset Provider","description":"Name of the dataset provider that owns and distributes a specified\nbuilding block molecule.","default":"unknown"},"availability":{"type":"string","maxLength":100000,"minLength":1,"title":"Availability","description":"The availability status of the building block molecule. A\nmolecule is `in stock` if it is available for purchase and\n`unavailable` otherwise.","default":"unavailable"},"price":{"type":"number","title":"Price","description":"Price of the building block molecule for a specific\n`dataset_provider`. A molecule can have different prices\ndepending on the provider. Prices are subject to change over\ntime depending on the sourced building block library.","default":0}},"type":"object","title":"BuildingBlockMetadata","description":"Metadata associated with a building block molecule."},"ReactionStep":{"properties":{"smiles":{"type":"string","maxLength":10000,"minLength":1,"pattern":"^[A-Za-z0-9@\\.\\+\\-\\[\\]\\(\\)\\=:\\#\\%\\*\\$/\\\\>]+$","title":"Smiles","description":"A single-step chemical reaction denoted using a SMILES\nrepresentation. Reactants are guaranteed to be either a\npurchasable building block or synthetically synthesizable\nmolecule."},"order":{"type":"integer","title":"Order","description":"Post-order position of the reaction step in the synthetic\nroute. Note that this field is not required to reproduce\nthe retrosynthesis pathway."}},"type":"object","required":["smiles","order"],"title":"ReactionStep","description":"A single-step reaction representing a synthesis step in a reaction tree."},"BaseErrorContent":{"description":"An error occurred while handling the request. Refer to the `error` data for more information. For any further issues or enquiries about an error, contact support at [support@pending.ai](mailto:support@pending.ai) with details about your request including your `request_id`.","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/BaseErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"required":["status_code"],"title":"Request Error","type":"object"},"BaseErrorInfo":{"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":{"default":null,"description":"Longer message describing an error wtih more information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","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":{"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":{"/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Retrieve a Job","description":"Retrieve a Job resource by its ID`. Synthesis routes are returned along\nwith additional job metadata to indicate the status of the job which is\nupdated and can be used for polling until results become available, or\nwaited on with `wait`.","operationId":"retrieve_job_jobs__job_id__get","parameters":[{"description":"Unique identifier for a `Job` 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":"Job Id","description":"Unique identifier for a `Job` object. The IDs\n        for objects are used to perform different operations."},"name":"job_id","in":"path"},{"description":"Seconds to wait for the job to finish before responding,\n        up to 25. The job is returned as it is then, finished or not:\n        check its `status`, and poll if it's still `submitted` or `processing`.","required":false,"schema":{"type":"integer","maximum":25,"minimum":0,"title":"Wait","description":"Seconds to wait for the job to finish before responding,\n        up to 25. The job is returned as it is then, finished or not:\n        check its `status`, and poll if it's still `submitted` or `processing`.","default":0},"name":"wait","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":{"200":{"description":"Returns the Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","description":"Not `BaseErrorContent`: see the examples."}}}},"404":{"description":"Resource could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```

## Delete a Job

> Delete a Job resource and any generated synthetic routes. The job will no\
> longer be processed if it is still queued and any results will be removed\
> if they exist. Results are no longer accessible after deletion.

```json
{"openapi":"3.1.0","info":{"title":"Pending AI Retrosynthesis API","version":"v1.11.4"},"tags":[{"name":"Jobs","description":"For low-throughput screening or synthetic route exploration, a **Retrosynthesis** *job* can be submitted for a single `query` target molecule. The molecule, represented in [SMILES](http://opensmiles.org/opensmiles.html) format, is provided alongside a set of guiding `parameters` impacting route diversity and results.\n- **Fast synthetic accessibility** can be assessed by reducing the time requirement for planning to `processing_time=60` and yield only a single route `number_of_routes=1`. - **Novel route exploration** can be achieved by increasing the time and resource allocation, allowing for multiple routes to be generated and evaluated. Additionally, decreasing `building_block_limit` and `reaction_limit` forces the engine to consider more diverse reaction pathways, potentially leading to more novel synthetic routes.\nEach job requires specifying a `retrosynthesis_engine` and `building_block_libraries` list corresponding to respective resource `id` fields of the engine and libraries. Our unique representation of synthetic routes provides a detailed reaction tree overview. See our [examples](https://docs.pending.ai/libraries/guides) for handling results for detailed analysis.\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":{"DeleteResource":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Id","description":"Unique identifier for a resource."},"object":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z_-]+$","title":"Object","description":"The named type for the resource."},"deleted":{"type":"boolean","title":"Deleted","description":"Indicates whether the resource was successfully deleted.","default":true}},"type":"object","required":["id","object"],"title":"DeleteResource","description":"The deletion status when a resource is deleted."},"BaseErrorContent":{"description":"An error occurred while handling the request. Refer to the `error` data for more information. For any further issues or enquiries about an error, contact support at [support@pending.ai](mailto:support@pending.ai) with details about your request including your `request_id`.","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/BaseErrorInfo"},{"type":"null"}],"default":null,"description":"Response content containing extra information for an error.","title":"Error Information"}},"required":["status_code"],"title":"Request Error","type":"object"},"BaseErrorInfo":{"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":{"default":null,"description":"Longer message describing an error wtih more information.","title":"Detailed Message"}},"required":["code","path"],"title":"Error Information","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":{"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":{"/jobs/{job_id}":{"delete":{"tags":["Jobs"],"summary":"Delete a Job","description":"Delete a Job resource and any generated synthetic routes. The job will no\nlonger be processed if it is still queued and any results will be removed\nif they exist. Results are no longer accessible after deletion.","operationId":"delete_job_jobs__job_id__delete","parameters":[{"description":"Unique identifier for a `Job` 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":"Job Id","description":"Unique identifier for a `Job` object. The IDs\n        for objects are used to perform different operations."},"name":"job_id","in":"path"}],"responses":{"200":{"description":"Returns the deletion status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResource"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","description":"Not `BaseErrorContent`: see the examples."}}}},"404":{"description":"Resource could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"409":{"description":"Conflicting state, refer to error details.","headers":{"Location":{"description":"URL of the resource the request conflicts with.","schema":{"type":"string","format":"uri"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseErrorContent"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestValidationErrorContent"}}}}}}}}}
```
