Quick Start
Call the smarts.bio bioinformatics agent from your Python scripts, TypeScript code, or any HTTP client.
1. Get an API Key
Log in to chat.smarts.bio, open your Organization Settings, click API Keys, and generate a new key. Copy it — it won't be shown again.
Keep it safe. Never commit API keys to source control. Use environment variables or a secrets manager.
2. Install the SDK
pip install smarts-bio
3. Your First Query
from smartsbio import SmartsBio
client = SmartsBio(api_key="sk_live_...")
# Discover available workspaces
workspaces = client.workspaces.list()
ws_id = workspaces[0].id
# Run a bioinformatics query
response = client.query.run(
"Find all published studies on BRCA1 variants in lung cancer",
workspace_id=ws_id,
)
print(response.answer)4. Stream the Response
For long-running queries, use streaming to receive results in real-time:
from smartsbio import SmartsBio
client = SmartsBio(api_key="sk_live_...")
for chunk in client.query.stream("Align these sequences: ATGCGTAA, ATGCATAA"):
if chunk.type == "status":
print(f"\n[{chunk.status}]", end="", flush=True)
elif chunk.type == "content":
print(chunk.content, end="", flush=True)