API Reference
Edison Scientific

Edison Scientific API

Edison Scientific provides AI-powered hypothesis generation by analyzing scientific literature and research context. The integration allows you to start research queries and receive suggested hypotheses with supporting rationale.

Generate Hypothesis

POST /cloud-labs/edison

Generate a hypothesis directly from a research query. This is a synchronous endpoint for simple queries.

Request Body

{
  "query": "Novel antimicrobial peptides targeting gram-negative bacteria",
  "context": "Looking for compounds that disrupt outer membrane integrity"
}

Response

{
  "hypothesis": {
    "statement": "Peptide X disrupts the outer membrane of gram-negative bacteria",
    "null_hypothesis": "Peptide X has no effect on gram-negative bacterial membranes",
    "rationale": "Based on structural similarity to known membrane-active peptides..."
  },
  "experiment_type": "MIC_MBC_ASSAY",
  "intake_draft": {
    "compliance": { "bsl": "BSL1" },
    "mic_mbc_assay": {
      "target_organisms": ["Escherichia coli", "Pseudomonas aeruginosa"]
    }
  },
  "sources": [
    {
      "title": "Antimicrobial peptides: mechanisms of action",
      "doi": "10.1000/example"
    }
  ]
}

Start Edison Run

POST /cloud-labs/edison/start

Start an asynchronous Edison run for complex research queries. Returns immediately with a run ID for status polling.

Request Body

{
  "query": "Novel mechanisms of antibiotic resistance in hospital-acquired infections",
  "job_type": "hypothesis_generation",
  "experiment_type": "MIC_MBC_ASSAY"
}

Parameters

FieldTypeRequiredDescription
querystringYesThe research question or area of interest
job_typestringNoType of analysis: hypothesis_generation (default), literature_review
experiment_typestringNoPreferred experiment type for the hypothesis

Response

{
  "run_id": "edison_run_abc123",
  "status": "PENDING",
  "query": "Novel mechanisms of antibiotic resistance in hospital-acquired infections",
  "created_at": "2026-01-27T10:00:00Z"
}

Get Active Run

GET /cloud-labs/edison/active

Get the currently active Edison run for the authenticated user. Returns null if no run is active.

Response

{
  "run_id": "edison_run_abc123",
  "status": "RUNNING",
  "query": "Novel mechanisms of antibiotic resistance",
  "progress": {
    "stage": "analyzing_literature",
    "percentage": 45
  },
  "created_at": "2026-01-27T10:00:00Z"
}

List Edison Runs

GET /cloud-labs/edison/runs

List all Edison runs for the authenticated user.

Query Parameters

ParameterTypeDescription
statusstringFilter by status: PENDING, RUNNING, COMPLETED, FAILED
limitintegerResults per page (1-100, default 20)
offsetintegerPagination offset

Response

{
  "runs": [
    {
      "run_id": "edison_run_abc123",
      "query": "Novel mechanisms of antibiotic resistance",
      "status": "COMPLETED",
      "experiment_type": "MIC_MBC_ASSAY",
      "created_at": "2026-01-27T10:00:00Z",
      "completed_at": "2026-01-27T10:05:00Z"
    }
  ],
  "total": 15,
  "limit": 20,
  "offset": 0
}

Get Edison Run Status

GET /cloud-labs/edison/runs/{run_id}

Get detailed status and results of a specific Edison run.

Response (Completed)

{
  "run_id": "edison_run_abc123",
  "status": "COMPLETED",
  "query": "Novel mechanisms of antibiotic resistance",
  "experiment_type": "MIC_MBC_ASSAY",
  "result": {
    "hypothesis": {
      "statement": "Efflux pump inhibitors restore antibiotic sensitivity",
      "null_hypothesis": "Efflux pump inhibition has no effect on antibiotic sensitivity"
    },
    "reasoning_trace": [
      {
        "step": 1,
        "action": "literature_search",
        "summary": "Searched for recent papers on antibiotic resistance mechanisms"
      },
      {
        "step": 2,
        "action": "analyze_findings",
        "summary": "Identified efflux pumps as key resistance mechanism"
      }
    ],
    "sources": [...]
  },
  "created_at": "2026-01-27T10:00:00Z",
  "completed_at": "2026-01-27T10:05:00Z"
}

Response (Failed)

{
  "run_id": "edison_run_abc123",
  "status": "FAILED",
  "query": "...",
  "error": "Unable to find sufficient literature for the query",
  "created_at": "2026-01-27T10:00:00Z"
}

Update Draft Hypothesis

PATCH /cloud-labs/edison/runs/{run_id}/draft

Update the generated hypothesis before saving to your library.

Request Body

{
  "edited_hypothesis": {
    "statement": "Refined hypothesis statement",
    "null_hypothesis": "Updated null hypothesis"
  }
}

Clear Run History

POST /cloud-labs/edison/runs/clear-history

Clear all Edison runs for the authenticated user.

Response

{
  "deleted_count": 15
}

Edison Run Status

StatusDescription
PENDINGRun queued, waiting to start
RUNNINGAnalysis in progress
COMPLETEDResults ready
FAILEDRun encountered an error

Workflow

  1. Start a run with POST /cloud-labs/edison/start
  2. Poll for status with GET /cloud-labs/edison/runs/{run_id} or check GET /cloud-labs/edison/active
  3. Review results when status is COMPLETED
  4. Edit if needed with PATCH /cloud-labs/edison/runs/{run_id}/draft
  5. Save to library by creating a hypothesis with the Edison response

Example: Full Workflow

import requests
import time
 
API_URL = "https://api.litmus.science"
headers = {"Authorization": "Bearer YOUR_TOKEN"}
 
# Start Edison run
response = requests.post(
    f"{API_URL}/cloud-labs/edison/start",
    json={"query": "Novel approaches to treating antibiotic-resistant infections"},
    headers=headers
)
run_id = response.json()["run_id"]
 
# Poll for completion
while True:
    status = requests.get(
        f"{API_URL}/cloud-labs/edison/runs/{run_id}",
        headers=headers
    ).json()
 
    if status["status"] == "COMPLETED":
        break
    elif status["status"] == "FAILED":
        raise Exception(status["error"])
 
    time.sleep(5)
 
# Save to hypothesis library
hypothesis = requests.post(
    f"{API_URL}/hypotheses",
    json={
        "title": "Edison-generated: Antibiotic resistance",
        "statement": status["result"]["hypothesis"]["statement"],
        "null_hypothesis": status["result"]["hypothesis"]["null_hypothesis"],
        "experiment_type": status["experiment_type"],
        "edison_response": status["result"]
    },
    headers=headers
)