Developer APIQuickstart

Developer API quickstart

1. Create an API key

Sign in to the developer console, select Create key, and copy the bsk_live_... value when it appears. The secret is shown once; the service stores only its hash and display prefix.

The default key scopes are:

  • capabilities:read
  • runs:read
  • runs:write
export BIOSIMULANT_API_KEY="bsk_live_..."

Never commit a key or place it in browser-side code. Revoke a key from the developer console if it is exposed.

2. Install the Python package

python -m pip install "biosimulant>=0.0.19"

This is the primary biosimulant distribution; there is no separate cloud package.

3. Run a pinned lab

from biosimulant import Client
 
with Client() as client:
    result = client.run(
        "demi/microbiology-hello-world-growth@1.0.0",
        inputs={
            "initial_cells": 10,
            "available_food": 80,
        },
        timeout=300,
    )
 
print(result.outputs)
print(result.provenance["resolved_ref"])

Client() reads BIOSIMULANT_API_KEY. Set BIOSIMULANT_API_BASE_URL only for a staging or local API environment.

A reference without @version resolves the latest accessible version when the run is created. Pin namespace/name@version in production and reproducible workflows.

4. Return immediately instead

with Client() as client:
    run = client.runs.create(
        ref="demi/microbiology-hello-world-growth@1.0.0",
        inputs={"initial_cells": 10},
        metadata={"sample_id": "plate-17"},
    )
    print(run.id, run.status)

Persist the run ID. You can retrieve the run later with client.runs.retrieve(run_id).