Python client for the onepot API
Project description
onepot-python
Python client for the onepot API.
Installation
uv add onepot
# or
pip install onepot
Usage
from onepot import Client
client = Client(api_key="your-api-key")
response = client.search(
smiles_list=["Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1", ...],
max_results=10,
include_chemistry_risk_score=True,
max_price=500, # only results up to $500
max_supplier_risk="medium", # exclude high supplier risk
max_chemistry_risk="medium", # exclude high chemistry risk
)
Streaming Search
For single-molecule searches with real-time progress updates:
# Iterate over progress events
for event in client.search_stream("c1ccc(NC(=O)c2ccccc2)cc1", max_results=10):
print(event["status"], event["message"])
if event["status"] == "complete":
results = event["results"]
Ordering
order = client.order(
smiles=["CCO", "c1ccccc1"],
email="you@example.com",
notes="Optional notes",
)
# {"order_id": "a1b2c3d4-...", "molecule_count": 2}
curl Examples
Search
curl -X POST https://api.onepot.ai/v1/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"smiles_list": ["c1ccc(-c2ccccc2)cc1"],
"max_results": 10
}'
Streaming Search
curl -sN -X POST https://api.onepot.ai/v1/search/stream \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"smiles": "c1ccc(NC(=O)c2ccccc2)cc1",
"max_results": 5
}'
Search with Chemistry Risk
curl -X POST https://api.onepot.ai/v1/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"smiles_list": ["c1ccc(-c2ccccc2)cc1"],
"max_results": 10,
"include_chemistry_risk_score": true
}'
Search with Filters
curl -X POST https://api.onepot.ai/v1/search \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"smiles_list": ["c1ccc(-c2ccccc2)cc1"],
"max_results": 10,
"max_price": 500,
"max_supplier_risk": "medium",
"max_chemistry_risk": "low"
}'
Order
curl -X POST https://api.onepot.ai/v1/order \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"smiles": ["CCO", "c1ccccc1"],
"email": "you@example.com",
"notes": "Optional notes"
}'
Filtering
All filter parameters are optional. When set, results that exceed the threshold are excluded.
| Parameter | Type | Values | Description |
|---|---|---|---|
max_price |
int | e.g. 200, 500 | Maximum price in USD |
max_supplier_risk |
string | "low", "medium", "high" |
Maximum supplier risk level |
max_chemistry_risk |
string | "low", "medium", "high" |
Maximum chemistry risk level |
Setting max_chemistry_risk automatically includes the chemistry_risk field in the response.
Pricing
Credits are charged per SMILES in the query:
| Option | Credits per SMILES |
|---|---|
| Base search | 1 |
include_chemistry_risk=True |
5 |
include_chemistry_risk_score=True |
10 |
Response Format
{
"queries": [
{
"query_smiles": "Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1",
"query_inchikey": "VZZJRYRQSPEMTK-CALCHBBNSA-N",
"results": [
{
"chemistry_risk": "medium", # if include_chemistry_risk=True
"chemistry_risk_score": 0.5, # if include_chemistry_risk_score=True
"inchikey": "VZZJRYRQSPEMTK-UHFFFAOYSA-N",
"price_usd": 590,
"similarity": 1.0,
"smiles": "Cc1c(C(=O)Nc2ccc(N3CC(C)OC(C)C3)nc2)cccc1-c1ccc(OC(F)(F)F)cc1",
"supplier_risk": "high",
},
...
]
},
...
],
"credits_used": 10,
"credits_remaining": 990
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onepot-0.1.6.tar.gz.
File metadata
- Download URL: onepot-0.1.6.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
140eccd0320f8b7255b0034a7ccaa70960597f3260744a16f19835395e420232
|
|
| MD5 |
7b9dc74508420d125015c4c78f429702
|
|
| BLAKE2b-256 |
7aa8a822eef7431757a1721b856397e3709575e6d5728e11809c6eb7e78b54d6
|
File details
Details for the file onepot-0.1.6-py3-none-any.whl.
File metadata
- Download URL: onepot-0.1.6-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4fe2dae5b628e47ddcaeab855cb170e080ec7650ecc7d59a8c3e9392d10014f
|
|
| MD5 |
c1b1e6487c9bfb4d2bd60a5d863b4670
|
|
| BLAKE2b-256 |
b34f33bc46ce22a5750f59f44f01b5f508dc2dca64284cb98bbeed65e6e3b010
|