API Reference
Overview

API Reference

The Litmus Science REST API enables programmatic submission of experiment requests, status tracking, and results retrieval.

Base URL

https://api.litmus.science

Authentication

All endpoints require authentication via Bearer token or API key:

# Bearer token
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.litmus.science/experiments
 
# API key
curl -H "X-API-Key: lk_your_api_key" https://api.litmus.science/experiments

See Authentication for details.

Rate Limits

TierRequests/MinuteRequests/Day
Standard1001,000
Pro1,00010,000
AI Agent5005,000

Rate limit headers are included in all responses:

  • X-RateLimit-Limit: Your limit
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Unix timestamp when limit resets

Endpoints Overview

Authentication

EndpointMethodDescription
/auth/registerPOSTRegister new user
/auth/tokenPOSTGet access token

Experiments

EndpointMethodDescription
/experimentsPOSTCreate experiment
/experimentsGETList experiments
/experiments/{id}GETGet experiment
/experiments/{id}PATCHUpdate experiment
/experiments/{id}DELETECancel experiment

Results

EndpointMethodDescription
/experiments/{id}/resultsGETGet results
/experiments/{id}/approvePOSTApprove results
/experiments/{id}/disputePOSTDispute results

Validation

EndpointMethodDescription
/validatePOSTValidate experiment
/validate/hypothesisPOSTValidate hypothesis
/estimatePOSTGet cost estimate

Templates

EndpointMethodDescription
/templatesGETList templates
/templates/{id}GETGet template

Operators

EndpointMethodDescription
/operator/jobsGETList available jobs
/operator/jobs/{id}/claimPOSTClaim job
/operator/jobs/{id}/submitPOSTSubmit results

Webhooks

EndpointMethodDescription
/webhooks/testPOSTTest webhook

Hypotheses

EndpointMethodDescription
/hypothesesPOSTCreate hypothesis
/hypothesesGETList hypotheses
/hypotheses/{id}GETGet hypothesis
/hypotheses/{id}PATCHUpdate hypothesis
/hypotheses/{id}DELETEDelete hypothesis
/hypotheses/{id}/to-experimentPOSTConvert to experiment

Edison Scientific

EndpointMethodDescription
/cloud-labs/edisonPOSTGenerate hypothesis via Edison
/cloud-labs/edison/startPOSTStart Edison run
/cloud-labs/edison/activeGETGet active Edison run
/cloud-labs/edison/runsGETList Edison runs
/cloud-labs/edison/runs/{id}GETGet Edison run status
/cloud-labs/edison/runs/{id}/draftPATCHUpdate draft hypothesis
/cloud-labs/edison/runs/clear-historyPOSTClear run history

Cloud Labs

EndpointMethodDescription
/cloud-labs/providersGETList cloud lab providers
/cloud-labs/providers/{id}GETGet provider details
/cloud-labs/supported-typesGETGet supported experiment types
/cloud-labs/interpretPOSTInterpret experiment with LLM
/cloud-labs/translatePOSTTranslate to cloud lab protocol
/cloud-labs/validatePOSTValidate for cloud lab
/cloud-labs/experiments/{id}/translatePOSTTranslate experiment
/cloud-labs/submissionsGETList submissions
/cloud-labs/submissions/{id}GETGet submission details

System

EndpointMethodDescription
/healthGETHealth check
/configGETConfiguration bootstrap
/auth/meGETGet current user

Error Responses

All errors follow this format:

{
  "error": {
    "code": "error_code",
    "message": "Human-readable message",
    "details": {}
  }
}

Common Error Codes

CodeHTTP StatusDescription
unauthorized401Invalid or missing credentials
forbidden403Valid credentials but insufficient permissions
not_found404Resource doesn't exist
validation_failed422Request validation failed
rate_limit_exceeded429Too many requests
safety_rejected403Experiment rejected for safety reasons

OpenAPI Specification

The complete OpenAPI 3.1 specification is available at:

  • Interactive docs: https://api.litmus.science/docs
  • ReDoc: https://api.litmus.science/redoc
  • Raw spec: https://api.litmus.science/openapi.json