---
title: "Run a SPICE circuit simulation directly in the worker. Accepts a standard SPICE netlist and performs operating-point (.op), DC sweep (.dc), AC frequency sweep (.ac), or transient (.tran) analysis using a built-in modified-nodal-analysis engine with Newton-Raphson nonlinear solving. Supports R, L, C, V, I sources (DC/AC/SIN/PULSE), diodes, BJTs (Ebers-Moll), MOSFETs (Shichman-Hodges level 1), controlled sources (E/G), .param expressions, .subckt/X hierarchical subcircuits, .measure and .four (Fourier/THD), and a built-in parts library (reference 2n3904/2n2222/1n4148/1n5819/2n7000/tl072/lm358/led_red etc. by name and the model is auto-injected), up to 150 components. Returns voltage vectors for all circuit nodes (magnitude + phase for AC). Use spice_template to generate netlists from parameterized templates."
method: POST
path: "/api/spice_simulate"
tags: ["rf"]
---

# Run a SPICE circuit simulation directly in the worker. Accepts a standard SPICE netlist and performs operating-point (.op), DC sweep (.dc), AC frequency sweep (.ac), or transient (.tran) analysis using a built-in modified-nodal-analysis engine with Newton-Raphson nonlinear solving. Supports R, L, C, V, I sources (DC/AC/SIN/PULSE), diodes, BJTs (Ebers-Moll), MOSFETs (Shichman-Hodges level 1), controlled sources (E/G), .param expressions, .subckt/X hierarchical subcircuits, .measure and .four (Fourier/THD), and a built-in parts library (reference 2n3904/2n2222/1n4148/1n5819/2n7000/tl072/lm358/led_red etc. by name and the model is auto-injected), up to 150 components. Returns voltage vectors for all circuit nodes (magnitude + phase for AC). Use spice_template to generate netlists from parameterized templates.

`POST /api/spice_simulate`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/spice_simulate`
- Auth: none declared

## Request body

- object
  - `netlist` string, required: SPICE netlist (ngspice-compatible). Must include at least one analysis command (.ac, .dc, .tran, .op) and end with .end
  - `analysis` 'ac' | 'dc' | 'tran' | 'op': Override analysis type (auto-detected from netlist if omitted)
  - `temperature_c` number: Simulation temperature in Celsius
  - `options` object: Additional ngspice .options (e.g. { reltol: 0.001 })
  - `certify` boolean: If true, attach an a-posteriori existence certificate for the DC operating point (Newton–Kantorovich: proves a true solution exists within a computed radius, or refuses). Adds ~one extra back-solve.
  - `tolerances` object: Component-tolerance box, e.g. {"R1":0.05,"V1":0.02} (fractional). With output_node, returns a certified min/max interval for that node over all component variations. R/V/I elements only.
  - `output_node` string: Node whose voltage is certified over the tolerance box (required with tolerances).

## Response `200`

Computed result for spice_simulate

- object
  - `result` object, required
    - `vectors` object, required: Named voltage/current vectors keyed by node name
    - `nodes` string[], required: List of circuit node names
    - `analysis_type` string, required: Analysis type that was performed
    - `runtime_ms` number, required: Simulation wall-clock time in milliseconds
    - `warnings` string[], required: Any ngspice warnings generated during simulation
    - `component_count` number, required: Number of components in the netlist
    - `certificate` unknown
    - `tolerance_certificate` unknown
    - `measures` unknown
    - `fourier` unknown
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
