Metadata-Version: 2.3
Name: onepot
Version: 0.1.4
Summary: Python client for the onepot API
Requires-Dist: httpx==0.28.1
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# onepot-python

Python client for the onepot API.

## Installation

```bash
uv add onepot
# or
pip install onepot
```

## Usage

```python
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,
)
```

### Ordering

```python
order = client.order(
    smiles=["CCO", "c1ccccc1"],
    email="you@example.com",
    notes="Optional notes",
)
# {"order_id": "a1b2c3d4-...", "molecule_count": 2}
```

## curl Examples

### Search

```bash
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
  }'
```

### Search with Chemistry Risk

```bash
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
  }'
```

### Order

```bash
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"
  }'
```

## 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

```python
{
    "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
}
```
