{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/query":{"get":{"tags":["client"],"summary":"Query","description":"Runs a query.","operationId":"query_query_get","parameters":[{"name":"dataset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Dataset Id"}},{"name":"reaction_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"title":"Reaction Id"}},{"name":"reaction_smarts","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reaction Smarts"}},{"name":"min_conversion","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Conversion"}},{"name":"max_conversion","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Conversion"}},{"name":"min_yield","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Yield"}},{"name":"max_yield","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Yield"}},{"name":"doi","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Doi"}},{"name":"component","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Component"}},{"name":"use_stereochemistry","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Stereochemistry"}},{"name":"similarity","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueryResult"},"title":"Response Query Query Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reaction":{"get":{"tags":["client"],"summary":"Get Reaction","description":"Fetches a Reaction by ID.","operationId":"get_reaction_reaction_get","parameters":[{"name":"reaction_id","in":"query","required":true,"schema":{"type":"string","title":"Reaction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reactions":{"post":{"tags":["client"],"summary":"Get Reactions","description":"Fetches a list of Reactions by ID.","operationId":"get_reactions_reactions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactionIdList"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/QueryResult"},"type":"array","title":"Response Get Reactions Reactions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/datasets":{"get":{"tags":["client"],"summary":"Get Datasets","description":"Returns info about the current datasets, most recently submitted first.","operationId":"get_datasets_datasets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DatasetInfo"},"type":"array","title":"Response Get Datasets Datasets Get"}}}}}}},"/dataset":{"get":{"tags":["client"],"summary":"Get Dataset","description":"Returns info about a single dataset.","operationId":"get_dataset_dataset_get","parameters":[{"name":"dataset_id","in":"query","required":true,"schema":{"type":"string","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/molfile":{"get":{"tags":["client"],"summary":"Get Molfile","description":"Returns a molblock for the given SMILES.","operationId":"get_molfile_molfile_get","parameters":[{"name":"smiles","in":"query","required":true,"schema":{"type":"string","title":"Smiles"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Get Molfile Molfile Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/download_search_results":{"post":{"tags":["client"],"summary":"Get Search Results","description":"Downloads search results as a Dataset proto.","operationId":"get_search_results_download_search_results_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactionIdList"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/submit_query":{"get":{"tags":["client"],"summary":"Submit Query","description":"Submits a query as a background task.","operationId":"submit_query_submit_query_get","parameters":[{"name":"dataset_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Dataset Id"}},{"name":"reaction_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"title":"Reaction Id"}},{"name":"reaction_smarts","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reaction Smarts"}},{"name":"min_conversion","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Conversion"}},{"name":"max_conversion","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Conversion"}},{"name":"min_yield","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Yield"}},{"name":"max_yield","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Yield"}},{"name":"doi","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Doi"}},{"name":"component","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Component"}},{"name":"use_stereochemistry","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Stereochemistry"}},{"name":"similarity","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Submit Query Submit Query Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fetch_query_result":{"get":{"tags":["client"],"summary":"Fetch Query Result","description":"Checks the query status, returning the results if the query is complete.","operationId":"fetch_query_result_fetch_query_result_get","parameters":[{"name":"task_id","in":"query","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/input_stats":{"get":{"tags":["client"],"summary":"Get Input Stats","description":"Return the most frequently used input SMILES for a dataset.","operationId":"get_input_stats_input_stats_get","parameters":[{"name":"dataset_id","in":"query","required":true,"schema":{"type":"string","title":"Dataset Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatsResult"},"title":"Response Get Input Stats Input Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/product_stats":{"get":{"tags":["client"],"summary":"Get Product Stats","description":"Return the most frequently used product SMILES for a dataset.","operationId":"get_product_stats_product_stats_get","parameters":[{"name":"dataset_id","in":"query","required":true,"schema":{"type":"string","title":"Dataset Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatsResult"},"title":"Response Get Product Stats Product Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/compound_svg":{"post":{"tags":["view"],"summary":"Get Compound","description":"Returns an SVG of a molecule.","operationId":"get_compound_compound_svg_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Get Compound Compound Svg Post"}}}}}}},"/reaction_summary":{"get":{"tags":["view"],"summary":"Get Reaction Summary","description":"Renders a reaction as an HTML table with images and text.","operationId":"get_reaction_summary_reaction_summary_get","parameters":[{"name":"reaction_id","in":"query","required":true,"schema":{"type":"string","title":"Reaction Id"}},{"name":"compact","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Compact"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nl_query":{"get":{"tags":["nl"],"summary":"Nl Query","description":"Runs a natural-language search.\n\nThe interpreted query and resolved structures are returned alongside the results\nso the user can see -- and trust or correct -- how their question was understood.\nThe model's translation and name lookups are cached (best-effort, in Valkey), so a\nrepeated question skips the model call; the database query always re-runs so\nresults stay fresh. A Valkey outage falls back to live calls rather than failing\nthe request.\n\nWith ``dry_run=true`` the question is translated and resolved but the database\nsearch is not executed -- useful for inspecting exactly what query would run.","operationId":"nl_query_nl_query_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":2000,"title":"Q"}},{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry Run"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NLQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DatasetInfo":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"num_reactions":{"type":"integer","title":"Num Reactions"},"submitted_at":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Submitted At"}},"type":"object","required":["dataset_id","name","description","num_reactions","submitted_at"],"title":"DatasetInfo","description":"Dataset info."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"NLComponent":{"properties":{"identifier":{"type":"string","title":"Identifier","description":"The compound as the user named it: a common/trade/IUPAC name (e.g. 'ibuprofen', 'benzene'), a SMILES, or -- only when mode is SMARTS -- a SMARTS pattern. Prefer the plain name; do not translate names to SMILES."},"target":{"type":"string","enum":["INPUT","OUTPUT"],"title":"Target","description":"INPUT if the compound is a reactant/reagent/solvent consumed by the reaction ('using X', 'from X', 'with X'); OUTPUT if it is produced by the reaction ('synthesizing X', 'to make X', 'yields X')."},"mode":{"type":"string","enum":["EXACT","SIMILAR","SUBSTRUCTURE","SMARTS"],"title":"Mode","description":"EXACT for a specific named molecule (the default). SUBSTRUCTURE when the user wants molecules that merely contain a group/scaffold ('containing a pyridine ring'). SIMILAR for 'similar to'/'like X'. SMARTS only when the user supplies or describes an explicit query pattern."}},"type":"object","required":["identifier","target","mode"],"title":"NLComponent","description":"A single component constraint extracted from the question."},"NLQuery":{"properties":{"components":{"items":{"$ref":"#/components/schemas/NLComponent"},"type":"array","title":"Components","description":"Per-compound constraints; AND-combined with the other fields."},"min_yield":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Yield","description":"Minimum percent yield (0-100), if requested."},"max_yield":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Yield","description":"Maximum percent yield (0-100), if requested."},"min_conversion":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Conversion","description":"Minimum percent conversion (0-100), if requested."},"max_conversion":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Conversion","description":"Maximum percent conversion (0-100), if requested."},"reaction_smarts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reaction Smarts","description":"A reaction SMARTS (reactants>>products) when the user describes a transformation rather than individual components. Usually omitted."},"similarity_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity Threshold","description":"Tanimoto threshold (0-1) for SIMILAR components; default 0.5."},"use_stereochemistry":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Stereochemistry","description":"True only if the user asks to respect stereochemistry/chirality."},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit","description":"Maximum number of reactions to return, if stated."}},"type":"object","title":"NLQuery","description":"Structured query produced by the language model from natural language."},"NLQueryResponse":{"properties":{"query":{"type":"string","title":"Query"},"interpretation":{"$ref":"#/components/schemas/NLQuery"},"resolved_components":{"items":{"$ref":"#/components/schemas/ResolvedComponent"},"type":"array","title":"Resolved Components"},"query_components":{"items":{"type":"string"},"type":"array","title":"Query Components"},"results":{"items":{"$ref":"#/components/schemas/QueryResult"},"type":"array","title":"Results"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","required":["query","interpretation","resolved_components","query_components","results"],"title":"NLQueryResponse","description":"Response for a natural-language query."},"QueryResult":{"properties":{"dataset_id":{"type":"string","title":"Dataset Id"},"reaction_id":{"type":"string","title":"Reaction Id"},"proto":{"type":"string","title":"Proto"}},"type":"object","required":["dataset_id","reaction_id","proto"],"title":"QueryResult","description":"Container for a single result from database query."},"ReactionIdList":{"properties":{"reaction_ids":{"items":{"type":"string"},"type":"array","title":"Reaction Ids"}},"type":"object","required":["reaction_ids"],"title":"ReactionIdList","description":"Reaction ID input."},"ResolvedComponent":{"properties":{"identifier":{"type":"string","title":"Identifier"},"smiles":{"type":"string","title":"Smiles"},"resolver":{"type":"string","title":"Resolver"},"target":{"type":"string","enum":["INPUT","OUTPUT"],"title":"Target"},"mode":{"type":"string","enum":["EXACT","SIMILAR","SUBSTRUCTURE","SMARTS"],"title":"Mode"}},"type":"object","required":["identifier","smiles","resolver","target","mode"],"title":"ResolvedComponent","description":"A component after name resolution, surfaced for transparency."},"StatsResult":{"properties":{"smiles":{"type":"string","title":"Smiles"},"times_appearing":{"type":"integer","title":"Times Appearing"}},"type":"object","required":["smiles","times_appearing"],"title":"StatsResult","description":"Stats result."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"/api"}]}