Python SDK

Use the official `omtx` package to submit diligence and Hub jobs, upload artifacts, request signed artifact URLs, request shard access, and start Molecule Fulfillment workflows from Python.

Install

pipBash
pip install omtx
Quick startPython
from omtx import OmClient

client = OmClient(api_key="YOUR_API_KEY")

profile = client.users.profile()
print("Available Wallet Credits:", profile["available_credits"])

health = client.status()
print("API version:", health["version"])

models = client.models.catalog(limit=5)
print("Model count:", models["count"])

catalog = client.datasets.catalog()
print("Generated Data rows:", catalog["data_generated"]["count"])

gene_keys = client.diligence.list_gene_keys()
print("Sample gene keys:", [item["gene_key"] for item in gene_keys["items"][:5]])

Data access helpers

Combined loading (recommended for training sets)Python
loaded = client.load_data(
    protein_uuid="YOUR_GENERATED_PROTEIN_UUID",
    binders=50000,
    nonbinder_multiplier=5,  # default
    # nonbinders=200000,      # optional explicit override
    sample_seed=42,
)
binders = loaded["binders"]
nonbinders = loaded["nonbinders"]
print("Rows loaded:", len(binders), len(nonbinders))
binders.show(top_n=24)  # defaults: smiles + binding_score
Separate pool loading (explicit control)Python
binders = client.load_binders(
    protein_uuid="YOUR_GENERATED_PROTEIN_UUID",
    n=1000,
    sample_seed=42,
)
nonbinders = client.load_nonbinders(
    protein_uuid="YOUR_GENERATED_PROTEIN_UUID",
    n=10000,
    sample_seed=42,
)
# Omit n (or set n=None) to load the full pool.
print("Rows loaded:", len(binders), len(nonbinders))
binders.show(top_n=24)  # defaults: smiles + binding_score
Manual shard export (advanced)Python
urls = client.binders.urls(
    protein_uuid="YOUR_GENERATED_PROTEIN_UUID",
)
print("Binder shard URLs:", len(urls["binder_urls"]))
print("Non-binder shard URLs:", len(urls["non_binder_urls"]))

Data Generation orders

Create quota or invoice ordersPython
sequences = [{"name": "target", "sequence": "M" * 120}]

quota_order = client.data_generation.quota_order(
    sequences=sequences,
    idempotency_key="dg-quota-target-001",
)

invoice_order = client.data_generation.invoice_order(
    sequences=sequences,
    idempotency_key="dg-invoice-target-001",
)
print(quota_order["order_number"])
print(invoice_order["url"])

Molecule Fulfillment

Search, quote, and invoicePython
pricing = client.molecules.pricing()
hits = client.molecules.search(
    smiles_list=["CC(=O)Oc1ccccc1C(=O)O"],
    max_results=5,
)
quote = client.molecules.quote(
    items=[{"smiles": "CC(=O)Oc1ccccc1C(=O)O", "quantity": 1}],
)
invoice = client.molecules.checkout(
    items=[{"smiles": "CC(=O)Oc1ccccc1C(=O)O", "quantity": 1}],
    shipping_address_id="addr_123",
)
print(pricing["provider"], quote["total_amount_cents"], invoice["order_number"])

Diligence jobs

Submit and waitPython
job = client.diligence.deep_diligence(
    query="BRAF clinical inhibitor landscape",
    preset="quick",
)

result = client.jobs.wait(
    job_id=job["job_id"],
    result_endpoint="/v2/jobs/deep-diligence/{job_id}",
    poll_interval=5,
    timeout=1800,
)

print("Claims:", result["result"]["total_claims"])

SDK Notes

  • Idempotency keys are generated automatically for POST and PUT calls. Diligence helpers also accept idempotency_key= when you want to reuse a specific key.
  • Use client.jobs.wait() for asynchronous diligence calls that return job_id.
  • Diligence wrappers include search, gather, and crawl in addition to deep_diligence/synthesize_report.
  • client.hub.submit(...) lets you start broad public Hub models from the SDK; account-scoped protein-specific models are discovered through client.models.catalog().
  • client.wallet.topup(...) explicitly funds Wallet Credits by saved card or invoice; saved-card top-ups use the account's funding limit and require exact approval text plus a retry-stable idempotency_key.
  • Upload files with client.artifacts.upload(...) before starting Hub workflows that use uploaded structures.
  • For larger uploaded files, use client.artifacts.upload_via_signed_url(...).
  • For large result files, use client.jobs.get_artifact_url(...) instead of inlining artifact bytes.
  • client.data_generation.* creates Data Generation orders through Data Generation Slots or invoice-backed ordering. Signed-in product checkout is handled in the web app.
  • client.molecules.* wraps OnePot-backed Molecule Fulfillment pricing, search, quote, checkout, orders, and order status.
  • Use client.jobs.history(limit=...) and cursor to page through recent jobs chronologically.
  • client.status() is the primary health helper.
  • load_data(...) loads binders and non-binders in one call (binders required, non-binders default to 5x multiplier).
  • load_binders(...) and load_nonbinders(...) are the primary dataframe loaders for separate training pools.
  • If n is omitted (or n=None), loaders pull the full pool; sampling occurs only when n is set.
  • OmData.show(...) uses smiles and binding_score by default.
  • For selectivity ranking, pass sort_by="selectivity_score".
  • OmData.show(...) displays inline in notebooks and returns None after successful display to avoid duplicate rendering.
  • binders.urls(...) returns flat binder_urls / non_binder_urls lists for quick iteration.
  • Use the client as a context manager to close sessions automatically.

Hub jobs and artifacts

Hub launch from uploaded structurePython
artifact = client.artifacts.upload("target.pdb")

job = client.hub.diffdock(
    protein_artifact_id=artifact["artifact_id"],
    ligand_smiles="CCO",
    idempotency_key="diffdock-demo-20260316",
)

status = client.jobs.wait(job["job_id"], poll_interval=5, timeout=1800)
print(status["job_type"], status["status"])
Large artifact flow via signed URLsPython
artifact = client.artifacts.upload_via_signed_url("target.cif")

job = client.hub.rfd3(
    pdb_artifact_id=artifact["artifact_id"],
    design_mode="monomer",
    contig="120",
    idempotency_key="rfd3-demo-20260331",
)

url_info = client.jobs.get_artifact_url(
    job["job_id"],
    "outputs/results.json",
)
print(url_info["download_url"])