Skip to main content
Docs

Search guides and API endpoints, for example “Idempotency-Key” or “submit job”.

    Tools · Cheminformatics & Structure

    Image to Structure (OCSR)

    Read chemical structures and reaction schemes from images of papers, slides and whiteboards as SMILES, with each reading checked by a second model
    On this page

    Prices, workflows, and method papersOpen in the app

    Run it from the API

    Submit with Submit a job and the job_type below. Price it first with Estimate job reservation cost: submitting reserves that amount from your wallet, and the charge settles at the actual runtime.

    Image to Structure (OCSR) image-to-structure

    Job type
    image-to-structure
    Hardware
    cput4 (default)
    Typical runtime
    10 min on Nvidia T4

    Payload

    Payload fields
    FieldTypeDescription
    imagerequiredimageFile | artifactRef
    reactionsboolean

    Default: true

    max_structuresinteger

    Default: 50Limits: ≥ 1, ≤ 200

    Example

    from cognichem_client import CogniChem
    
    client = CogniChem.from_env()  # reads COGNICHEM_API_KEY
    payload = {
        "image": {"name": "scheme.png", "content_b64": "<file contents, base64>"},
        "reactions": True,
        "max_structures": 10,
    }
    
    estimate = client.jobs.estimate(job_type="image-to-structure", payload=payload, resource="t4")
    print(f"Reserves ${estimate.cost:.2f}")
    
    job = client.jobs.submit(
        job_name="my-image-to-structure-run",
        job_type="image-to-structure",
        payload=payload,
        resource="t4",
    )
    status = client.jobs.wait(job.process_id)
    if status.status == "completed":
        client.jobs.result(job.process_id, save_path=".")

    Sample data from the job catalog; long values are shortened here. Each job_name must be unique among your jobs.

    Workflow inputs

    • ImagePNG, JPEG

    Workflow outputs

    • ArchiveZIP
    • ImagePNG
    • MoleculesSMILES
    • TableCSV
    • TableCSV