---
title: "Serialize Ionworks Model"
method: POST
path: "/discovery/ionworks_models/serialize"
tags: ["discovery"]
---

# Serialize Ionworks Model

`POST /discovery/ionworks_models/serialize`

Build an ionworks model and return its pybamm ``Serialise`` JSON.

Lets callers without the licensed ``ionworkspipeline`` package use
ionworks models (``ECM``, ``LumpedSPMR``, ``GITTModel``, ...): the JSON
loads with plain ``pybamm`` via ``Serialise.load_custom_model``. Standard
pybamm models are already usable directly, so requesting one returns 400.

Returned verbatim because the JSON may contain ``Infinity``/``NaN``
literals; Python's ``json`` (and the SDK) parse these fine.

## Request body

- SerializeIonworksModelBody — Body for ``POST /discovery/ionworks_models/serialize``.
  - `name` string, required — Ionworks model class name to build and serialize, e.g. 'ECM', 'LumpedSPMR', 'MSMRFullCellModel', 'GITTModel'. Must be one of the names returned under 'ionworks_models' by GET /discovery/pybamm_models.
  - `options` object — Options dict to pass to the model constructor.

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/ionworks/apis/fastapi.md) · [All operations](https://skmtc.dev/ionworks/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ionworks/fastapi/revisions/7337a3cbdaf2/schema)
