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
npm install @smartsbio/sdk
# No installation needed — use any HTTP client
# Install the smarts CLI brew install smartsbio/tap/smarts # or: curl -fsSL https://smarts.bio/install.sh | sh
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)import { SmartsBio } from '@smartsbio/sdk';
const client = new SmartsBio({ apiKey: 'sk_live_...' });
// Discover available workspaces
const workspaces = await client.workspaces.list();
const wsId = workspaces[0].id;
// Run a bioinformatics query
const response = await client.query.run({
prompt: 'Find all published studies on BRCA1 variants in lung cancer',
workspaceId: wsId,
});
console.log(response.answer);# First, get your workspaces
curl https://api.smarts.bio/v1/workspaces \
-H "Authorization: Bearer sk_live_..."
# Then run a query
curl -X POST https://api.smarts.bio/v1/query \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"prompt": "Find all published studies on BRCA1 variants in lung cancer",
"workspace_id": "ws_abc123"
}'# Authenticate once (browser device-code login) smarts login # or, for CI/headless: smarts auth set-key sk_live_... # List available workspaces and select one smarts workspace list smarts workspace use ws_abc123 # Run a bioinformatics query smarts query "Find all published studies on BRCA1 variants in lung cancer"
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)import { SmartsBio } from '@smartsbio/sdk';
const client = new SmartsBio({ apiKey: 'sk_live_...' });
for await (const chunk of client.query.stream({
prompt: 'Align these sequences: ATGCGTAA, ATGCATAA',
})) {
if (chunk.type === 'status') process.stdout.write(`\n[${chunk.status}]`);
if (chunk.type === 'content') process.stdout.write(chunk.content ?? '');
}curl -X POST https://api.smarts.bio/v1/query/stream \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{"prompt": "Align these sequences: ATGCGTAA, ATGCATAA"}'
# Response is Server-Sent Events:
# data: {"type":"status","status":"Searching databases..."}
# data: {"type":"content","content":"The sequences differ at position 5..."}
# data: {"type":"done"}# smarts query streams the response by default smarts query "Align these sequences: ATGCGTAA, ATGCATAA"
Not writing code? You can use smarts.bio directly from ChatGPT, Claude or Gemini — no API key, no install. See the hosted MCP server.