ResistAI / Docs
Documentation
Send a genome and an AST result, get a reconciled verdict. One endpoint, three file formats.
Specification preview. This page documents the endpoint contract for pilot partners. The sandbox returns synthetic verdicts for the sample dataset.
Quickstart
Three steps from a new key to a first verdict.
1. Get a sandbox key
Complete the two-step pilot onboarding. Keys are prefixed rai_ruo_test_ and scoped to Research Use Only.
2. Set your environment
Your base URL is issued together with your sandbox key. The samples read it from RESISTAI_BASE_URL.
export RESISTAI_API_KEY="rai_ruo_test_..." export RESISTAI_BASE_URL="<issued with your key>"
3. Reconcile one isolate
Save the JSON example as request.json, then send it.
curl -X POST "$RESISTAI_BASE_URL/v1/reconcile" \ -H "Authorization: Bearer $RESISTAI_API_KEY" \ -H "Content-Type: application/json" \ -d @request.json
import json
import os
import requests
with open("request.json") as handle:
payload = json.load(handle)
response = requests.post(
f"{os.environ['RESISTAI_BASE_URL']}/v1/reconcile",
headers={"Authorization": f"Bearer {os.environ['RESISTAI_API_KEY']}"},
json=payload,
timeout=30,
)
response.raise_for_status()
result = response.json()
print(result["verdict"]["level"], result["verdict"]["gap_dilutions"]){
"sample_id": "DEMO-BSI-0147",
"organism": "Klebsiella pneumoniae",
"breakpoints": "EUCAST_v14.0",
"genotype": {
"format": "vcf",
"uri": "file://./DEMO-BSI-0147.vcf"
},
"phenotype": [
{
"agent": "meropenem",
"method": "broth-microdilution",
"mic_mg_per_l": 0.25
}
]
}POST/v1/reconcile
Compares the genotype of one isolate with its phenotypic results and returns a verdict for each agent. Authenticate with a bearer token.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| sample_id | string | Yes | Laboratory accession. Must not be a patient identifier. |
| organism | string | Yes | Binomial name. Sets the breakpoint table rows. |
| breakpoints | enum | No | EUCAST_v14.0 (default) or CLSI_M100. |
| genotype.format | enum | Yes | vcf or fasta. |
| genotype.uri | string | Yes | Local file path on the edge node, or an inline upload reference. |
| phenotype[].agent | string | Yes | Antimicrobial agent, lower case. |
| phenotype[].method | enum | Yes | broth-microdilution, gradient-strip or disk-diffusion. |
| phenotype[].mic_mg_per_l | number | No | Required unless zone_mm is given. |
| phenotype[].zone_mm | number | No | Required unless mic_mg_per_l is given. |
Example request
curl -X POST "$RESISTAI_BASE_URL/v1/reconcile" \ -H "Authorization: Bearer $RESISTAI_API_KEY" \ -H "Content-Type: application/json" \ -d @request.json
import json
import os
import requests
with open("request.json") as handle:
payload = json.load(handle)
response = requests.post(
f"{os.environ['RESISTAI_BASE_URL']}/v1/reconcile",
headers={"Authorization": f"Bearer {os.environ['RESISTAI_API_KEY']}"},
json=payload,
timeout=30,
)
response.raise_for_status()
result = response.json()
print(result["verdict"]["level"], result["verdict"]["gap_dilutions"]){
"sample_id": "DEMO-BSI-0147",
"organism": "Klebsiella pneumoniae",
"breakpoints": "EUCAST_v14.0",
"genotype": {
"format": "vcf",
"uri": "file://./DEMO-BSI-0147.vcf"
},
"phenotype": [
{
"agent": "meropenem",
"method": "broth-microdilution",
"mic_mg_per_l": 0.25
}
]
}Example response
{
"sample_id": "DEMO-BSI-0147",
"verdict": {
"level": "flag",
"headline": "Genotype R / phenotype S discrepancy",
"agent": "meropenem",
"phenotype": { "mic_mg_per_l": 0.25, "call": "S" },
"genotype": { "predicted_call_bound": ">8 mg/L (category R)", "call": "R" },
"gap_dilutions": 6,
"workflow": "research_review_queue"
},
"evidence": [
{ "gene": "blaKPC-3", "call": "detected", "af": 0.98, "dp": 212 }
],
"suggested_follow_up": "mCIM/eCIM to confirm carbapenemase activity, repeat MIC by reference broth microdilution (ISO 20776-1), PCR or re-sequencing to confirm the gene call, and population analysis profiling if heteroresistance is suspected",
"use": "research-use-only"
}The genotype predicts a category, not a measured MIC. predicted_call_bound is the breakpoint bound of the predicted category (EUCAST v14.0: R > 8 mg/L), not an MIC value.
Status codes
| Code | Meaning |
|---|---|
| 200 | Reconciled. A verdict is returned for every agent supplied. |
| 400 | Malformed body, unknown organism or unsupported agent. |
| 401 | Missing or invalid API key. |
| 422 | Rejected at the schema boundary: a field looks like a patient identifier. |
| 429 | Sandbox rate limit reached. Retry after the interval in the Retry-After header. |
Supported file formats
Genotype is supplied as FASTA or VCF. Phenotype is supplied inline or as a CSV batch.
Assembled contigs
Draft or complete assemblies. Genes and promoter regions are called directly from contigs. Mean depth must be supplied separately if known.
Variant calls
Calls against a named reference. DP and AF must be present in INFO or FORMAT so low-confidence loci can be flagged.
Susceptibility results
One row per isolate and agent with columns sample_id, agent, method, and mic_mg_per_l or zone_mm. Instrument exports are mapped on import.
CSV / AST layout
sample_id,agent,method,mic_mg_per_l DEMO-BSI-0147,meropenem,broth-microdilution,0.25 DEMO-SST-0392,oxacillin,broth-microdilution,2 DEMO-UTI-0811,meropenem,broth-microdilution,16 DEMO-VAP-0263,meropenem,broth-microdilution,1
Identifier-free ingestion and local edge deployment
Reconciliation can run on a node inside your laboratory network. The service is designed to reject direct patient identifiers at ingestion; patient information is never required. This is a design description, not independently verified security architecture.
Sequencer and AST instrument
FASTA, VCF and AST exports stay on the laboratory network.
ResistAI edge node
Parses files, strips non-schema fields and rejects identifiers. Runs reconciliation locally.
De-identified verdict
Only accession ID, organism, calls and metrics may leave, and only if cloud sync is enabled.
Surveillance dashboard
Aggregated discrepancy trends for surveillance and research teams. Optional.
- Schema rejection. Requests carrying fields that resemble names, dates of birth or record numbers fail with 422 before any processing.
- Accession IDs only. Isolates are keyed by laboratory accession. Any re-linking to a patient happens in your own systems, outside ResistAI.
- Offline by default. The edge node works without outbound access. Cloud sync of de-identified verdicts is opt-in.
This describes the system design. It is not a certification or a compliance attestation; your own data protection assessment still applies.