Skip to navigation

API Reference

View as Markdown

OpenAPI Schema

The API Reference tab details the following endpoints:

  • /v1/infer Inference endpoint for molecular dynamics simulations
  • /v1/health/live Health liveliness endpoint
  • /v1/health/ready Health readiness endpoint
  • /v1/status System status monitoring endpoint

Endpoints

POST /v1/infer

Run a molecular dynamics simulation on a single atomic structure.

Request Body:

The request body contains the following fields:

FieldTypeRequiredDescription
atomsobjectYesAtomic structure for the simulation
configobjectNoMD simulation configuration (uses defaults if not provided)
infostringNoOptional metadata to echo back

BMDAtomicData Fields (atoms):

The following table lists the atoms field parameters (BMDAtomicData):

FieldTypeRequiredDescription
coordarray[float]YesFlattened coordinates [x1,y1,z1,x2,y2,z2,…] in Angstrom
numbersarray[int]YesAtomic numbers
cellarray[float]NoUnit cell (9 elements, row-major) in Angstrom
pbcarray[bool]NoPeriodic boundary conditions [x,y,z], default [true,true,true]
chargeintNoSystem charge, default 0
multintNoSpin multiplicity (2S+1), default 1
massarray[float]NoAtomic masses in amu (uses standard if not provided)
velocityarray[float]NoInitial velocities [vx1,vy1,vz1,…] in Å/fs (Maxwell-Boltzmann if not provided)

MDConfig Fields (config):

The following table lists the config field parameters (MDConfig):

FieldTypeDefaultDescription
temperaturefloat300.0Target temperature in K
dtfloat1.0Timestep in fs
nvtbooltrueEnable NVT ensemble
frictionfloat1.0Langevin friction in ps^-1
nptboolfalseEnable NPT ensemble
pressurefloat0.0Target pressure in kBar
barostat_anisotropicboolfalseEnable anisotropic barostat
barostat_everyint25Barostat update frequency
barostat_prob_shearfloat0.5Shear move probability
barostat_shear_maxfloat0.01Max shear magnitude
barostat_diag_maxfloat0.01Max diagonal change
barostat_log_scale_maxfloat0.001Max log-scale move
md_timefloat0.0Starting time in ps (for restart)
md_time_maxfloat10.0Max simulation time in ps
save_intervalint100Save every N steps
istepint0Starting step (for restart)
efieldarray[float][0,0,0]Electric field [Ex,Ey,Ez] in μV/Å

Response:

The response contains the following fields:

FieldTypeDescription
trajectoryarrayList of trajectory snapshots
configobjectFinal MDConfig state (updated istep/md_time)
statusstringStatus message (“Success” or error)
infostringEchoed metadata from request

BMDSnapshot Fields (trajectory items):

The following table lists the trajectory items (BMDSnapshot):

FieldTypeDescription
coordarray[float]Atomic coordinates in Angstrom
velocityarray[float]Atomic velocities in Å/fs
energyfloatPotential energy in eV
cellarray[float]Unit cell (if periodic)
stressarray[float]Stress tensor in kBar (if periodic)
chargesarray[float]Partial charges (if available)
istepintStep number
md_timefloatSimulation time in ps

GET /v1/health/ready

Check if the NIM is ready to accept inference requests.

Response:

{
"status": "ready",
"backends_alive": 2,
"backends_total": 2
}

GET /v1/health/live

Check if the Triton server is live.

Response:

{
"status": "live"
}

GET /v1/status

Get detailed system status including worker metrics.

Response:

{
"total": {
"tasks_received": 100,
"tasks_completed": 95,
"queue_size_atoms": 1024,
"queue_size_tasks": 5,
"requests_received": 50,
"requests_completed": 48,
"requests_in_progress": 2,
"max_system_size": 36876
},
"workers": [
{
"device": "cuda:0",
"tasks_received": 50,
"tasks_completed": 48,
"queue_size_atoms": 512,
"queue_size_tasks": 2,
"batch_size": 36876,
"max_batch_size": 47136,
"gpu_model": "NVIDIA H100 80GB HBM3"
}
]
}

Error Responses

The API returns the following error responses:

HTTP StatusMeaningWhen
200SuccessRequest completed. Check status field for simulation outcome.
400Bad RequestMalformed JSON or missing required fields.
422Validation ErrorInvalid field types or values (for example, mismatched coord and numbers lengths).
500Internal Server ErrorUnexpected server failure or GPU out-of-memory (OOM) error.
503Service UnavailableNIM not ready (still estimating batch sizes at startup).

Error Response Schema (422):

{
"detail": [
{
"loc": ["body", "atoms", "coord"],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Timeout and Memory Behavior

  • Requests with systems exceeding max_system_size (check by using GET /v1/status) might return 500 with an OOM error.
  • There is no built-in server-side request timeout. Use client-side timeouts for long simulations.
  • Long trajectories (large md_time_max) increase response time proportionally. Consider breaking long simulations into restart chunks.

Example Requests

The following sections show how to use the API to start a simulation.

Basic NVT Simulation

Start this simulation by running the following command:

curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true]
},
"config": {
"temperature": 300.0,
"dt": 1.0,
"md_time_max": 0.1,
"nvt": true,
"save_interval": 10
}
}'

NPT Simulation With Pressure Control

Start this simulation by running the following command:

curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true]
},
"config": {
"temperature": 300.0,
"dt": 1.0,
"md_time_max": 1.0,
"nvt": true,
"npt": true,
"pressure": 1.0,
"barostat_every": 25,
"save_interval": 100
}
}'

NVE Simulation (Constant Energy)

Start this simulation by running the following command:

curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true],
"velocity": [0.0, 0.0, 0.01, 0.0, 0.0, -0.01]
},
"config": {
"nvt": false,
"npt": false,
"dt": 0.5,
"md_time_max": 1.0,
"save_interval": 10
}
}'

Restart From a Previous State

Start this simulation by running the following command:

curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.52],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true],
"velocity": [0.001, 0.002, 0.003, -0.001, -0.002, -0.003]
},
"config": {
"temperature": 300.0,
"nvt": true,
"dt": 1.0,
"istep": 100,
"md_time": 0.1,
"md_time_max": 0.2,
"save_interval": 10
}
}'